Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SceneOrbiter.h
1#pragma once
2
3#include <Inventor/Axis.h>
4#include <Inventor/ViewerComponents/nodes/SceneInteractor.h>
5
9class SoEvent;
10class SoViewingCube;
11class InteractionOrbiter;
12class SoNodeSensor;
13class SoFieldSensor;
14
151class VIEWERCOMPONENTS_API SceneOrbiter : public SceneInteractor
152{
153
154public:
155
160 {
171 TRACKBALL
172 };
173
176
178 virtual ~SceneOrbiter();
179
195 void setConstraintLevel( float level );
196
204
210
215
222
227
231 void enableViewingCube( bool enabled );
232
237
242
247
248private:
249 virtual void mouseWheelMoved( SoMouseWheelEvent* wheelEvent, SoHandleEventAction* action );
250 virtual void mouseMoved( SoLocation2Event* mouseEvent, SoHandleEventAction* action );
251 virtual void mousePressed( SoMouseButtonEvent* mouseEvent, SoHandleEventAction* action );
252 virtual void mouseReleased( SoMouseButtonEvent* mouseEvent, SoHandleEventAction* action );
253 virtual void keyPressed( SoKeyboardEvent* keyEvent, SoHandleEventAction* action );
254 virtual void keyReleased( SoKeyboardEvent* keyEvent, SoHandleEventAction* action );
255 virtual void touch( SoTouchEvent* touchEvent, SoHandleEventAction* action );
256 virtual void zoom(SoScaleGestureEvent* scaleEvent, SoHandleEventAction* action);
257 virtual void rotate( SoRotateGestureEvent* rotateEvent, SoHandleEventAction* action );
258
259private:
260 InteractionOrbiter* m_interaction;
261 SoViewingCube* m_viewingCube;
262 SoRef<SoSwitch> m_viewingCubeSwitch;
263 SoFieldSensor* m_upAxisSensor;
264
265 // Tools to handle the external camera update (like ViewingCube)
266 SoNodeSensor* m_cameraSensor;
267 static void cameraSensorCallback(void* data, SoSensor* sensor);
268 // Keep up to date the viewport to use it in the cameraSensorCallback
269 SbViewportRegion m_viewportRegion;
270};
Class for representing a viewport.
Base class for building a basic OpenInventor application without using the classic viewer classes.
CameraMode
Type of camera (perspective or orthographic)
(Preview feature) Tool class for building a basic interactive OpenInventor application with mode-less...
SoViewingCube * getViewingCube()
Returns the viewing cube object.
RotationMethod
Defines how the mouse events or touch events control the rotations of the scene.
@ TURNTABLE
Constrained mode which forces the camera to follow meridians and parallel circles related to the up-a...
RotationMethod getRotationMethod()
Returns the current scene rotation method.
SceneOrbiter()
Constructor.
float getConstraintLevel()
Returns the current constraint level which limits the turntable rotation.
void setUpAxis(openinventor::inventor::Axis::Type axis)
Sets the up axis of the scene.
bool isViewingCubeEnabled() const
Returns if viewing cube is enabled.
openinventor::inventor::Axis::Type getUpAxis()
Returns the current up axis of the scene.
void setConstraintLevel(float level)
Sets the constraint level to limit the turntable rotation.
virtual void setCameraMode(SceneInteractor::CameraMode mode)
Selects perspective or orthographic camera.
void setRotationMethod(RotationMethod method)
Sets the scene rotation method.
void enableViewingCube(bool enabled)
Enables or disables viewing cube.
virtual ~SceneOrbiter()
Destructor.
Base class for all events.
Definition SoEvent.h:116
Sensor class that can be attached to Open Inventor fields.
Allows nodes in a graph to receive input events.
Keyboard key press and release events.
2D location events.
Mouse button press and release events.
Mouse wheel events.
virtual void touch()
Marks an instance as modified, simulating a change to it.
Sensor class that can be attached to Open Inventor nodes.
Smart pointer for any class inheriting SoRefCounter.
Definition SoRef.h:90
Class for rotate gesture events.
Class for scale (pinch) gesture events.
Abstract base class for Open Inventor sensors.
Definition SoSensor.h:100
Base class for touch events.
Interactive cubic shape to control the orientation of a camera.
Type
Specification of either an X, a Y or a Z axis.
Definition Axis.h:51