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>
72#if QT_VERSION_MAJOR < 6
82 #if QT_VERSION_MAJOR < 6
83 typedef QGLWidget Super;
85 typedef QOpenGLWidget Super;
100#if QT_VERSION_MAJOR > 5
120 const std::string& current_draw_mode()
const
121 {
return draw_mode_ ? draw_mode_names_[draw_mode_-1] : nomode_; }
123 float radius()
const {
return radius_; }
126 const GLdouble* modelview_matrix()
const {
return modelview_matrix_; }
127 const GLdouble* projection_matrix()
const {
return projection_matrix_; }
129 float fovy()
const {
return 45.0f; }
131 QAction* findAction(
const char *name);
132 void addAction(QAction* action,
const char* name);
133 void removeAction(
const char* name);
134 void removeAction(QAction* action);
139 virtual void draw_scene(
const std::string& _draw_mode);
141 double performance(
void);
143 void setDefaultMaterial(
void);
144 void setDefaultLight(
void);
149 void slotDrawMode(QAction *_mode);
150 void slotSnapshot(
void );
162 void resizeGL(
int w,
int h );
167 virtual void mousePressEvent( QMouseEvent* );
168 virtual void mouseReleaseEvent( QMouseEvent* );
169 virtual void mouseMoveEvent( QMouseEvent* );
170 virtual void wheelEvent( QWheelEvent* );
171 virtual void keyPressEvent( QKeyEvent* );
176 void update_projection_matrix();
187 GLdouble projection_matrix_[16],
188 modelview_matrix_[16];
193 QActionGroup* draw_modes_group_;
194 typedef std::map<QString,QAction*> ActionMap;
195 ActionMap names_to_actions;
196 unsigned int draw_mode_;
197 unsigned int n_draw_modes_;
198 std::vector<std::string> draw_mode_names_;
199 static std::string nomode_;
206 QPoint last_point_2D_;
Definition: QGLViewerWidget.hh:77
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