Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
RenderAreaInteractive.h
Go to the documentation of this file.
1#ifndef RenderAreaInteractive_H
2#define RenderAreaInteractive_H
3
6
7class QRenderAreaCore;
8class QMouseEvent;
9class QWheelEvent;
10class QKeyEvent;
11
12class SceneInteractor;
13class SoGroup;
14
22{
23
24 public:
25
35 {
37 MANUAL
38 };
39
43 RenderAreaInteractive( QWidget* parent );
44
49
50 /*
51 * Sets the scene graph to render.
52 */
53 virtual void setSceneGraph( SoNode* sceneGraph );
54
67
72SoDEPRECATED
78
83
88 virtual void viewAll( const SbViewportRegion &viewport );
89
95 virtual void viewAxis( const SbVec3f& direction, const SbVec3f& up );
96
100 virtual void activateStereo( bool activated );
101
105 virtual bool isStereoSupported() const;
106
110 void setStereoCameraOffset( float offset );
111
115 void setStereoCameraBalance( float balance );
116
117#if 1 SoDEPRECATED
123SoDEPRECATED
129#endif
138 virtual SbBool processEvent(const SoEvent *event);
139
147 virtual SbBool processEvents(const std::vector<const SoEvent*>& eventList);
148
149 private:
150
151 RenderAreaInteractive( QWidget* parent, bool buildRootSceneGraph );
152
156 virtual SoRenderAreaCore::RenderStatus render();
157
162 virtual void initializeGL();
163
172 virtual void mousePressEvent( QMouseEvent* event );
173
178 virtual void mouseReleaseEvent( QMouseEvent* event );
179
184 virtual void mouseMoveEvent( QMouseEvent* event );
185
190 virtual void wheelEvent( QWheelEvent* event );
191
195 virtual void keyPressEvent ( QKeyEvent * event );
196
200 virtual void keyReleaseEvent ( QKeyEvent * event );
201
205 virtual void enterEvent(QEvent * event);
206
210 virtual void leaveEvent(QEvent * event);
211
215 virtual void mouseDoubleClickEvent(QMouseEvent * event);
216
221 virtual bool event(QEvent * qevent);
222
226 void buildSceneGraph();
227
228 SceneInteractor* m_rootSceneGraph;
229 // Auto interactive mode
230 bool m_isAutoInteractive;
231
232private:
233
234 void init( bool buildRootSceneGraph );
235
236 void startRender( SiRenderArea::RenderEventArg& arg );
237
242 static SbBool s_abortRenderCallback( SoAction* action, void* );
243
244 SoGroup* m_appSceneGraph;
245 ClippingPlanesAdjustMode m_clippingMode;
247
248 QtEventToSoEvent m_eventbuilder;
249
250 bool m_isDragging;
251};
252
253#endif // RenderAreaInteractive_H
static void init()
Class to render an OpenInventor scene in a Qt OpenGL window.
Definition RenderArea.h:46
Class to render an OpenInventor scene in a Qt OpenGL window.
virtual SceneInteractor * getSceneInteractor() const
Return the root of the scene graph.
virtual SbBool processEvents(const std::vector< const SoEvent * > &eventList)
Processes the passed event to the scene graph managed here.
void setStereoCameraOffset(float offset)
Set the stereo offset.
ClippingPlanesAdjustMode getClippingPlanesAdjustMode()
Get the camera clipping planes adjustment mode.
SoDEPRECATED void setInteractiveMode(SoInteractiveComplexity::InteractiveMode mode)
Sets the current interactive mode.
void setStereoCameraBalance(float balance)
Set the stereo balance.
virtual void activateStereo(bool activated)
Activate/Deactivate stereo.
SoDEPRECATED SceneInteractor * getRootSceneGraph() const
Return the root of the scene graph.
virtual bool isStereoSupported() const
Returns true if stereo can be activated.
virtual ~RenderAreaInteractive()
Destructor.
void setClippingPlanesAdjustMode(ClippingPlanesAdjustMode mode)
Set the camera clipping planes adjustment mode.
virtual void viewAxis(const SbVec3f &direction, const SbVec3f &up)
Moves the camera to be aligned with the given direction vector while keeping the "up" direction of th...
virtual SbBool processEvent(const SoEvent *event)
Processes the passed event to the scene graph managed here.
virtual void setSceneGraph(SoNode *sceneGraph)
Sets the scene graph to render.
virtual SoDEPRECATED SoInteractiveComplexity::InteractiveMode getInteractiveMode() const
Gets the current interactive mode.
ClippingPlanesAdjustMode
Camera clipping planes adjustment mode.
virtual void viewAll(const SbViewportRegion &viewport)
Move the camera to view the scene defined by the given path.
RenderAreaInteractive(QWidget *parent)
This constructor initializes the QOpenGLWidget using the default QSurfaceFormat.
3D vector class.
Definition SbVec.h:932
Class for representing a viewport.
Base class for building a basic OpenInventor application without using the classic viewer classes.
RenderStatus
Returned by the render method.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> RenderArea inter...
Abstract base class for all actions.
Definition SoAction.h:132
Base class for all events.
Definition SoEvent.h:116
Base class for all group nodes.
Definition SoGroup.h:122
Abstract base class for all database nodes.
Definition SoNode.h:145
int SbBool
Boolean type.
Definition SbBase.h:87
#define QTVIEWERCOMPONENTS_API
Definition port.h:387
Structure given when a start render event is raised.