45 #ifndef OPENMESHAPPS_QGLVIEWERWIDGET_HH
46 #define OPENMESHAPPS_QGLVIEWERWIDGET_HH
50 #include <OpenMesh/Core/Geometry/VectorT.hh>
54 #if QT_VERSION_MAJOR < 6
57 #include <QtOpenGLWidgets/QOpenGLWidget>
68 #if QT_VERSION_MAJOR < 6
78 #if QT_VERSION_MAJOR < 6
79 typedef QGLWidget Super;
81 typedef QOpenGLWidget Super;
96 #if QT_VERSION_MAJOR > 5
116 const std::string& current_draw_mode()
const
117 {
return draw_mode_ ? draw_mode_names_[draw_mode_-1] : nomode_; }
119 float radius()
const {
return radius_; }
122 const GLdouble* modelview_matrix()
const {
return modelview_matrix_; }
123 const GLdouble* projection_matrix()
const {
return projection_matrix_; }
125 float fovy()
const {
return 45.0f; }
127 QAction* findAction(
const char *name);
128 void addAction(QAction* action,
const char* name);
129 void removeAction(
const char* name);
130 void removeAction(QAction* action);
135 virtual void draw_scene(
const std::string& _draw_mode);
137 double performance(
void);
139 void setDefaultMaterial(
void);
140 void setDefaultLight(
void);
145 void slotDrawMode(QAction *_mode);
146 void slotSnapshot(
void );
158 void resizeGL(
int w,
int h );
163 virtual void mousePressEvent( QMouseEvent* );
164 virtual void mouseReleaseEvent( QMouseEvent* );
165 virtual void mouseMoveEvent( QMouseEvent* );
166 virtual void wheelEvent( QWheelEvent* );
167 virtual void keyPressEvent( QKeyEvent* );
172 void update_projection_matrix();
183 GLdouble projection_matrix_[16],
184 modelview_matrix_[16];
189 QActionGroup* draw_modes_group_;
190 typedef std::map<QString,QAction*> ActionMap;
191 ActionMap names_to_actions;
192 unsigned int draw_mode_;
193 unsigned int n_draw_modes_;
194 std::vector<std::string> draw_mode_names_;
195 static std::string nomode_;
202 QPoint last_point_2D_;
Definition: QGLViewerWidget.hh:73
QAction * add_draw_mode(const std::string &_s)
add draw mode to popup menu, and return the QAction created
Definition: QGLViewerWidget.cc:650
void del_draw_mode(const std::string &_s)
delete draw mode from popup menu
Definition: QGLViewerWidget.cc:717