50 #ifndef OPENMESHAPPS_QGLVIEWERWIDGET_HH
51 #define OPENMESHAPPS_QGLVIEWERWIDGET_HH
57 #include <OpenMesh/Core/Geometry/VectorT.hh>
79 typedef QGLWidget Super;
111 const std::string& current_draw_mode()
const
112 {
return draw_mode_ ? draw_mode_names_[draw_mode_-1] : nomode_; }
114 float radius()
const {
return radius_; }
117 const GLdouble* modelview_matrix()
const {
return modelview_matrix_; }
118 const GLdouble* projection_matrix()
const {
return projection_matrix_; }
120 float fovy()
const {
return 45.0f; }
122 QAction* findAction(
const char *name);
123 void addAction(QAction* action,
const char* name);
124 void removeAction(
const char* name);
125 void removeAction(QAction* action);
130 virtual void draw_scene(
const std::string& _draw_mode);
132 double performance(
void);
134 void setDefaultMaterial(
void);
135 void setDefaultLight(
void);
140 void slotDrawMode(QAction *_mode);
141 void slotSnapshot(
void );
153 void resizeGL(
int w,
int h );
158 virtual void mousePressEvent( QMouseEvent* );
159 virtual void mouseReleaseEvent( QMouseEvent* );
160 virtual void mouseMoveEvent( QMouseEvent* );
161 virtual void wheelEvent( QWheelEvent* );
162 virtual void keyPressEvent( QKeyEvent* );
167 void update_projection_matrix();
178 GLdouble projection_matrix_[16],
179 modelview_matrix_[16];
184 QActionGroup* draw_modes_group_;
185 typedef std::map<QString,QAction*> ActionMap;
186 ActionMap names_to_actions;
187 unsigned int draw_mode_;
188 unsigned int n_draw_modes_;
189 std::vector<std::string> draw_mode_names_;
190 static std::string nomode_;
197 QPoint last_point_2D_;
205 #endif // OPENMESHAPPS_QGLVIEWERWIDGET_HH
void del_draw_mode(const std::string &_s)
delete draw mode from popup menu
QAction * add_draw_mode(const std::string &_s)
add draw mode to popup menu, and return the QAction created