Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SceneExaminer.h
Go to the documentation of this file.
1#ifndef _SceneExaminer_
2#define _SceneExaminer_
3
7#include <vector>
8
10class SoKeyboardEvent;
13class SoEvent;
14class SoTouchEvent;
18class SeekAnimator;
19class NavigationInteraction;
20class SelectionInteraction;
21class BaseInteraction;
22class SoSensor;
23class SoOneShotSensor;
25
170{
171
172public:
173
178 {
180 SELECTION
181 };
182
187 {
189 PLANE
190 };
191
194
196 virtual ~SceneExaminer();
197
201 void enableSelection(bool enabled);
202
207
211 void enableZoom(bool enabled);
212
217
221 void enablePan(bool enabled);
222
227
231 void enableOrbit(bool enabled);
232
237
241 void enableRotate(bool enabled);
242
247
251 void enableSeek(bool enabled);
252
257
262
266 bool isSpinEnabled() const;
267
277 void enableSpin(bool enable);
278
283
288
293
298
302 void setSeekMode( bool onOrOff );
303
308
313
314private:
315 virtual void mouseWheelMoved( SoMouseWheelEvent* wheelEvent, SoHandleEventAction* action );
316 virtual void mouseMoved( SoLocation2Event* mouseEvent, SoHandleEventAction* action );
317 virtual void mousePressed( SoMouseButtonEvent* mouseEvent, SoHandleEventAction* action );
318 virtual void mouseReleased( SoMouseButtonEvent* mouseEvent, SoHandleEventAction* action );
319 virtual void keyPressed( SoKeyboardEvent* keyEvent, SoHandleEventAction* action );
320 virtual void keyReleased( SoKeyboardEvent* keyEvent, SoHandleEventAction* action );
321 virtual void touch( SoTouchEvent* touchEvent, SoHandleEventAction* action );
322 virtual void zoom( SoScaleGestureEvent* scaleEvent, SoHandleEventAction* action );
323 virtual void rotate( SoRotateGestureEvent* rotateEvent, SoHandleEventAction* action );
324 virtual void doubleTap(SoDoubleTapGestureEvent* doubleTapEvent, SoHandleEventAction* action);
325 virtual void longTap(SoLongTapGestureEvent* longTapEvent, SoHandleEventAction* action);
326
327private:
328 void switchInteractionMode(SoHandleEventAction* action);
329
330 NavigationInteraction* m_navigation;
331 SelectionInteraction* m_selection;
332 BaseInteraction* m_currentInteraction;
333 bool m_isSelectionEnabled;
334 std::vector<SiInteractionModeListener*> m_interactionModeListeners;
335 SoOneShotSensor* m_modeSwitchDelayer;
336};
337
338#endif // _SceneExaminer_
virtual void enable(QWidget *w, XtEventHandler f, XtPointer data, void *unused=NULL)
Tool class for building a basic interactive OpenInventor application with scene "examiner" viewing be...
NavigationMode
Navigation Mode.
SceneExaminer()
Constructor.
bool isOrbitEnabled()
Returns if camera orbiting is enabled.
bool isSpinEnabled() const
Returns true if spin animation is enabled.
void removeInteractionModeListener(SiInteractionModeListener *listener)
Remove interaction listener.
InteractionMode
Interaction Mode (navigation or selection)
void setInteractionMode(SceneExaminer::InteractionMode mode)
Set interaction mode to navigation or selection.
bool isPanEnabled()
Returns if camera panning is enabled.
void setSeekMode(bool onOrOff)
Set the interaction into or out off seek mode (default is off).
void enableSelection(bool enabled)
Enable or disable selection mode.
void enableZoom(bool enabled)
Enable or disable zoom.
void enableSpin(bool enable)
Enables or disables the spin animation.
void enablePan(bool enabled)
Enable or disable camera panning.
SceneExaminer::InteractionMode getInteractionMode()
Returns the current interaction mode.
void enableRotate(bool enabled)
Enable or disable camera rotation.
void enableOrbit(bool enabled)
Enable or disable camera orbiting.
bool isSelectionEnabled()
Returns if selection is enabled.
SceneExaminer::NavigationMode getNavigationMode()
Returns the current navigation mode.
bool isRotateEnabled()
Returns if camera rotation is enabled.
bool isZoomEnabled()
Returns if zoom is enabled.
virtual void setCameraMode(SceneInteractor::CameraMode mode)
Select perspective or orthographic camera.
virtual ~SceneExaminer()
Destructor.
void setNavigationMode(SceneExaminer::NavigationMode mode)
Set navigation mode.
void enableSeek(bool enabled)
Enable or disable seek.
bool isSeekEnabled()
Returns if seek is enabled.
void addInteractionModeListener(SiInteractionModeListener *listener)
Add interaction listener.
Base class for building a basic OpenInventor application without using the classic viewer classes.
CameraMode
Type of camera (perspective or orthographic)
This interface provides the list of interaction methods that subclasses must define.
Class for double-tap gesture events.
Base class for all events.
Definition SoEvent.h:116
Allows nodes in a graph to receive input events.
Keyboard key press and release events.
2D location events.
Class for long tap gesture events.
Mouse button press and release events.
Mouse wheel events.
virtual void touch()
Marks an instance as modified, simulating a change to it.
Sensor for one-time only callbacks.
Class for rotate gesture events.
Class for scale (pinch) gesture events.
Abstract base class for Open Inventor sensors.
Definition SoSensor.h:97
Base class for touch events.
#define VIEWERCOMPONENTS_API
Definition port.h:384