00001 #ifndef _SceneExaminer_ 00002 #define _SceneExaminer_ 00003 00004 #include <Inventor/ViewerComponents/nodes/SceneInteractor.h> 00005 #include <Inventor/events/SoMouseButtonEvent.h> 00006 #include <Inventor/events/SoLocation2Event.h> 00007 #include <vector> 00008 00009 class SoMouseWheelEvent; 00010 class SoKeyboardEvent; 00011 class SoLocation2Event; 00012 class SoScaleGestureEvent; 00013 class SoEvent; 00014 class SoTouchEvent; 00015 class SoRotateGestureEvent; 00016 class SoDoubleTapGestureEvent; 00017 class SoLongTapGestureEvent; 00018 class SeekAnimator; 00019 class NavigationInteraction; 00020 class SelectionInteraction; 00021 class BaseInteraction; 00022 class SiInteractionModeListener; 00023 00163 class VIEWERCOMPONENTS_API SceneExaminer : public SceneInteractor 00164 { 00165 00166 public: 00167 00171 enum InteractionMode 00172 { 00173 NAVIGATION, 00174 SELECTION 00175 }; 00176 00180 enum NavigationMode 00181 { 00182 ORBIT, 00183 PLANE 00184 }; 00185 00187 SceneExaminer(); 00188 00190 virtual ~SceneExaminer(); 00191 00195 void enableSelection(bool enabled); 00196 00200 bool isSelectionEnabled(); 00201 00205 void enableZoom(bool enabled); 00206 00210 bool isZoomEnabled(); 00211 00215 void enablePan(bool enabled); 00216 00220 bool isPanEnabled(); 00221 00225 void enableOrbit(bool enabled); 00226 00230 bool isOrbitEnabled(); 00231 00235 void enableRotate(bool enabled); 00236 00240 bool isRotateEnabled(); 00241 00245 void enableSeek(bool enabled); 00246 00250 bool isSeekEnabled(); 00251 00255 void setNavigationMode(SceneExaminer::NavigationMode mode); 00256 00260 bool isSpinEnabled() const; 00261 00265 void enableSpin(bool enable); 00266 00270 SceneExaminer::NavigationMode getNavigationMode(); 00271 00275 void setInteractionMode(SceneExaminer::InteractionMode mode); 00276 00280 SceneExaminer::InteractionMode getInteractionMode(); 00281 00282 virtual void setCameraMode( SceneInteractor::CameraMode mode ); 00283 00287 void setSeekMode( bool onOrOff ); 00288 00292 void addInteractionModeListener( SiInteractionModeListener* listener ); 00293 00297 void removeInteractionModeListener( SiInteractionModeListener* listener ); 00298 00299 private: 00300 virtual void mouseWheelMoved( SoMouseWheelEvent* wheelEvent, SoHandleEventAction* action ); 00301 virtual void mouseMoved( SoLocation2Event* mouseEvent, SoHandleEventAction* action ); 00302 virtual void mousePressed( SoMouseButtonEvent* mouseEvent, SoHandleEventAction* action ); 00303 virtual void mouseReleased( SoMouseButtonEvent* mouseEvent, SoHandleEventAction* action ); 00304 virtual void keyPressed( SoKeyboardEvent* keyEvent, SoHandleEventAction* action ); 00305 virtual void keyReleased( SoKeyboardEvent* keyEvent, SoHandleEventAction* action ); 00306 virtual void touch( SoTouchEvent* touchEvent, SoHandleEventAction* action ); 00307 virtual void zoom( SoScaleGestureEvent* scaleEvent, SoHandleEventAction* action ); 00308 virtual void rotate( SoRotateGestureEvent* rotateEvent, SoHandleEventAction* action ); 00309 virtual void doubleTap(SoDoubleTapGestureEvent* doubleTapEvent, SoHandleEventAction* action); 00310 virtual void longTap(SoLongTapGestureEvent* longTapEvent, SoHandleEventAction* action); 00311 00312 private: 00313 void switchInteractionMode(); 00314 00315 NavigationInteraction* m_navigation; 00316 SelectionInteraction* m_selection; 00317 BaseInteraction* m_currentInteraction; 00318 bool m_isSelectionEnabled; 00319 std::vector<SiInteractionModeListener*> m_interactionModeListeners; 00320 }; 00321 00322 #endif // _SceneExaminer_ 00323