45 #ifndef OPENMESHAPPS_QGLVIEWERWIDGET_HH 46 #define OPENMESHAPPS_QGLVIEWERWIDGET_HH 52 #include <OpenMesh/Core/Geometry/VectorT.hh> 74 typedef QGLWidget Super;
106 const std::string& current_draw_mode()
const 107 {
return draw_mode_ ? draw_mode_names_[draw_mode_-1] : nomode_; }
109 float radius()
const {
return radius_; }
112 const GLdouble* modelview_matrix()
const {
return modelview_matrix_; }
113 const GLdouble* projection_matrix()
const {
return projection_matrix_; }
115 float fovy()
const {
return 45.0f; }
117 QAction* findAction(
const char *name);
118 void addAction(QAction* action,
const char* name);
119 void removeAction(
const char* name);
120 void removeAction(QAction* action);
125 virtual void draw_scene(
const std::string& _draw_mode);
127 double performance(
void);
129 void setDefaultMaterial(
void);
130 void setDefaultLight(
void);
135 void slotDrawMode(QAction *_mode);
136 void slotSnapshot(
void );
148 void resizeGL(
int w,
int h );
153 virtual void mousePressEvent( QMouseEvent* );
154 virtual void mouseReleaseEvent( QMouseEvent* );
155 virtual void mouseMoveEvent( QMouseEvent* );
156 virtual void wheelEvent( QWheelEvent* );
157 virtual void keyPressEvent( QKeyEvent* );
162 void update_projection_matrix();
173 GLdouble projection_matrix_[16],
174 modelview_matrix_[16];
179 QActionGroup* draw_modes_group_;
180 typedef std::map<QString,QAction*> ActionMap;
181 ActionMap names_to_actions;
182 unsigned int draw_mode_;
183 unsigned int n_draw_modes_;
184 std::vector<std::string> draw_mode_names_;
185 static std::string nomode_;
192 QPoint last_point_2D_;
200 #endif // OPENMESHAPPS_QGLVIEWERWIDGET_HH