80 #if QT_VERSION_MAJOR < 6
81 typedef QGLWidget Super;
83 typedef QOpenGLWidget Super;
98#if QT_VERSION_MAJOR > 5
118 const std::string& current_draw_mode()
const
119 {
return draw_mode_ ? draw_mode_names_[draw_mode_-1] : nomode_; }
121 float radius()
const {
return radius_; }
124 const GLdouble* modelview_matrix()
const {
return modelview_matrix_; }
125 const GLdouble* projection_matrix()
const {
return projection_matrix_; }
127 float fovy()
const {
return 45.0f; }
129 QAction* findAction(
const char *name);
130 void addAction(QAction* action,
const char* name);
131 void removeAction(
const char* name);
132 void removeAction(QAction* action);
137 virtual void draw_scene(
const std::string& _draw_mode);
139 double performance(
void);
141 void setDefaultMaterial(
void);
142 void setDefaultLight(
void);
147 void slotDrawMode(QAction *_mode);
148 void slotSnapshot(
void );
160 void resizeGL(
int w,
int h );
165 virtual void mousePressEvent( QMouseEvent* );
166 virtual void mouseReleaseEvent( QMouseEvent* );
167 virtual void mouseMoveEvent( QMouseEvent* );
168 virtual void wheelEvent( QWheelEvent* );
169 virtual void keyPressEvent( QKeyEvent* );
174 void update_projection_matrix();
185 GLdouble projection_matrix_[16],
186 modelview_matrix_[16];
191 QActionGroup* draw_modes_group_;
192 typedef std::map<QString,QAction*> ActionMap;
193 ActionMap names_to_actions;
194 unsigned int draw_mode_;
195 unsigned int n_draw_modes_;
196 std::vector<std::string> draw_mode_names_;
197 static std::string nomode_;
204 QPoint last_point_2D_;
QAction * add_draw_mode(const std::string &_s)
add draw mode to popup menu, and return the QAction created
Definition QGLViewerWidget.cc:650