text in FileInfoWindow can be marked and copied,
code cleaning
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "geometryengine.h"
|
||||
#include "..\Header\SettingsWindow.h"
|
||||
#include <QOpenGLWidget>
|
||||
#include <QOpenGLFunctions>
|
||||
#include <QMatrix4x4>
|
||||
#include <QQuaternion>
|
||||
#include <QVector2D>
|
||||
#include <QBasicTimer>
|
||||
#include <QOpenGLShaderProgram>
|
||||
#include <QMatrix4x4>
|
||||
#include "GeometryEngine.h"
|
||||
#include "SettingsWindow.h"
|
||||
|
||||
|
||||
class GeometryEngine;
|
||||
@@ -21,10 +17,26 @@ public:
|
||||
explicit OglViewerWidget(QWidget *parent = 0);
|
||||
~OglViewerWidget();
|
||||
|
||||
signals:
|
||||
void loadFile(QString);
|
||||
|
||||
// attributes
|
||||
private:
|
||||
QOpenGLShaderProgram m_program;
|
||||
GeometryEngine *m_dataEngine;
|
||||
|
||||
QVector4D m_backgroundColorOn = { 0.02f, 0.02f, 0.02f, 1.0f };
|
||||
QVector4D m_backgroundColorOff = { 0.5f, 0.8f, 1.0f, 1.0f };
|
||||
|
||||
bool m_wireframe = false;
|
||||
bool m_lightOn = false;
|
||||
|
||||
struct {
|
||||
QVector4D position = { 1,1,1,0 };
|
||||
QVector3D intensities = { 1.0,1.0,1.0 };
|
||||
float attenuationFactor = 0.0f;
|
||||
float ambientCoefficient = 0.005f;
|
||||
} m_light;
|
||||
|
||||
SettingsWindow* m_settings;
|
||||
|
||||
struct {
|
||||
bool left = false;
|
||||
bool right = false;
|
||||
@@ -37,53 +49,37 @@ private:
|
||||
bool z = true;
|
||||
} m_rotDirections;
|
||||
|
||||
struct {
|
||||
QVector4D position = { 1,1,1,0 };
|
||||
QVector3D intensities = { 1.0,1.0,1.0 };
|
||||
float attenuationFactor = 0.0f;
|
||||
float ambientCoefficient = 0.005f;
|
||||
} m_light;
|
||||
|
||||
SettingsWindow* m_settings;
|
||||
|
||||
QVector4D m_backgroundColorOn = {0.02f, 0.02f, 0.02f, 1.0f};
|
||||
QVector4D m_backgroundColorOff = { 0.5f, 0.8f, 1.0f, 1.0f };
|
||||
|
||||
QOpenGLShaderProgram m_program;
|
||||
GeometryEngine *m_dataEngine;
|
||||
|
||||
QMatrix4x4 m_projection;
|
||||
QVector3D m_translation;
|
||||
QQuaternion m_rotation;
|
||||
|
||||
bool m_wireframe = false;
|
||||
bool m_lightOn = false;
|
||||
|
||||
double m_zSpeed = 1.0;
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
|
||||
void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
|
||||
void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
|
||||
void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
|
||||
void dragEnterEvent(QDragEnterEvent *e) Q_DECL_OVERRIDE;
|
||||
void dropEvent(QDropEvent * event) Q_DECL_OVERRIDE;
|
||||
void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
|
||||
// functions
|
||||
private:
|
||||
void initShaders();
|
||||
void setConnections();
|
||||
void resetView();
|
||||
void updateLightPosition();
|
||||
|
||||
protected:
|
||||
void initializeGL() Q_DECL_OVERRIDE;
|
||||
void resizeGL(int w, int h) Q_DECL_OVERRIDE;
|
||||
void paintGL() Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
void initShaders();
|
||||
void setConnections();
|
||||
void updateLightPosition();
|
||||
void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
|
||||
void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
|
||||
void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
|
||||
void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
|
||||
|
||||
void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
|
||||
|
||||
private slots:
|
||||
void resetView();
|
||||
void dragEnterEvent(QDragEnterEvent *e) Q_DECL_OVERRIDE;
|
||||
void dropEvent(QDropEvent * event) Q_DECL_OVERRIDE;
|
||||
|
||||
// slots
|
||||
public slots:
|
||||
void changeDirection(int direction);
|
||||
void toggleAxis(int axis);
|
||||
void toggleWireframe();
|
||||
void toggleLight();
|
||||
void showSettings();
|
||||
@@ -93,7 +89,9 @@ public slots:
|
||||
void setAttFac(double value);
|
||||
void setAmbCoef(double value);
|
||||
|
||||
// signals
|
||||
signals:
|
||||
void sendMessage(QString message, int severity);
|
||||
void loadFile(QString);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user