12 #include <osgViewer/Viewer>
13 #include <osgViewer/ViewerEventHandlers>
15 #include <QtOpenGL/QGLWidget>
31 #define OSGWIDGET_IDLE_COUNT // <-- count how often idle is called (used to analyze performance issues and wether to use OSGWIDGET_IDLE_TIMER)
32 #define OSGWIDGET_SUPPORT_GL2PS
45 #ifdef OSGADAPTER_GW_DERIVED
46 class OsgAdapterWidget :
public QGLWidget,
public osgViewer::GraphicsWindowEmbedded
66 virtual void resizeGL(
int width,
int height );
72 virtual void wheelEvent ( QWheelEvent* event );
74 #ifdef OSGADAPTER_GW_DERIVED
75 const osgViewer::GraphicsWindowEmbedded*
_gw;
77 osg::ref_ptr<osgViewer::GraphicsWindowEmbedded>
_gw;
80 osgGA::GUIEventAdapter*
makeEventAdapter( QMouseEvent* event, osgGA::GUIEventAdapter::EventType type );
117 #ifdef OSGWIDGET_IDLE_COUNT
123 virtual void idle(
double simulationTime=USE_REFERENCE_TIME );
134 _continuousUpdateForced = force;
142 #ifdef OSGVIEWER_OVERPAINT
143 virtual void overpaintGL( QPainter& ) {}
147 #ifdef OSGWIDGET_SUPPORT_GL2PS
148 virtual bool paintGL2PS(
const char* filename,
int format );
155 virtual void frame(
double simulationTime=USE_REFERENCE_TIME );
177 cout <<
"OsgViewerWidget::requestWarpPointer(" << x <<
"," << y <<
") called" << endl;
184 return _continuousUpdateForced;
197 bool _continuousUpdate;
198 bool _continuousUpdateForced;
200 #ifdef OSGWIDGET_IDLE_TIMER