Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
RenderAreaInteractive.h
Go to the documentation of this file.
1#pragma once
4
6
7namespace openinventor {
8namespace inventor {
9namespace viewercomponents {
10namespace qt {
11namespace qml {
12
27{
28
29public:
39 {
41 MANUAL
42 };
43
48
53
54 /*
55 * Sets the scene graph to render.
56 */
57 void setSceneGraph( SoNode* sceneGraph ) override;
58
71
76
81
86 virtual void viewAll( const SbViewportRegion& viewport );
87
93 virtual void viewAxis( const SbVec3f& direction, const SbVec3f& up );
94
98 virtual void activateStereo( bool activated );
99
103 virtual bool isStereoSupported() const;
104
108 void setStereoCameraOffset( float offset );
109
113 void setStereoCameraBalance( float balance );
114
122 SbBool processEvent( const SoEvent* event );
123
131 SbBool processEvents( const std::vector<const SoEvent*>& eventList );
132
133private:
134 RenderAreaInteractive( bool buildRootSceneGraph );
135
140 SoRenderAreaCore::RenderStatus render() override;
141
150 void mousePressEvent( QMouseEvent* event ) override;
151
156 void mouseReleaseEvent( QMouseEvent* event ) override;
157
162 void mouseMoveEvent( QMouseEvent* event ) override;
163
167 void hoverMoveEvent( QHoverEvent* event ) override;
168
173 void wheelEvent( QWheelEvent* event ) override;
174
178 void keyPressEvent( QKeyEvent* event ) override;
179
183 void keyReleaseEvent( QKeyEvent* event ) override;
184
188 virtual void enterEvent( QEvent* event );
189
193 virtual void leaveEvent( QEvent* event );
194
198 void mouseDoubleClickEvent( QMouseEvent* event ) override;
199
204 bool event( QEvent* qevent ) override;
205
209 void buildSceneGraph();
210
211 void createRenderAreaCore( SbVec2i32 region ) override;
212
213 SceneInteractor* m_rootSceneGraph;
214
215private:
216 void init( bool buildRootSceneGraph );
217
218 void startRender( SiRenderArea::RenderEventArg& arg );
219
224 static SbBool s_abortRenderCallback( SoAction* action, void* );
225
226 SoGroup* m_appSceneGraph;
227 ClippingPlanesAdjustMode m_clippingMode;
228
229 QtEventToSoEvent m_eventbuilder;
230
231 bool m_isDragging;
232};
233
234} // namespace qml
235} // namespace qt
236} // namespace viewercomponents
237} // namespace inventor
238} // namespace openinventor
static void init()
2D vector class.
Definition SbVec.h:517
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.
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
void setClippingPlanesAdjustMode(ClippingPlanesAdjustMode mode)
Sets the camera clipping planes adjustment mode.
void setStereoCameraBalance(float balance)
Set the stereo balance.
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 bool isStereoSupported() const
Returns true if stereo can be activated.
ClippingPlanesAdjustMode getClippingPlanesAdjustMode()
Get the camera clipping planes adjustment mode.
void setSceneGraph(SoNode *sceneGraph) override
Sets the scene graph to render.
SbBool processEvent(const SoEvent *event)
Processes the passed event to the scene graph managed here.
SbBool processEvents(const std::vector< const SoEvent * > &eventList)
Processes the passed event to the scene graph managed here.
virtual void viewAll(const SbViewportRegion &viewport)
Moves the camera to view the scene defined by the given path.
virtual void activateStereo(bool activated)
Activate/Deactivate stereo.
virtual SceneInteractor * getSceneInteractor() const
Return the root of the scene graph.
int SbBool
Boolean type.
Definition SbBase.h:87
#define QTVIEWERCOMPONENTS_API
Definition port.h:387
Structure given when a start render event is raised.