00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SO_CAMERA_INTERACTOR
00022 #define SO_CAMERA_INTERACTOR
00023
00024 #include <Inventor/SbBox.h>
00025 #include <Inventor/projectors/SbSphereSheetProjector.h>
00026 #include <Inventor/misc/SoRefCounter.h>
00027 #include <Inventor/STL/stack>
00028 #include <Inventor/SbVec.h>
00029 #include <Inventor/SbPImpl.h>
00030
00031 class SoCamera;
00032 class SbViewportRegion;
00033 class SbViewVolume;
00034 class SoCameraInteractorImpl;
00035
00121 class SoCameraInteractor : public SoRefCounter
00122 {
00123 public:
00124
00130 SoCameraInteractor( SoCamera* camera );
00131
00137 static SoCameraInteractor* getNewInstance( SoCamera* camera );
00138
00159 virtual void zoom( float zoom );
00160
00187 virtual void dolly( float scaleFactor );
00188
00198 virtual void changeViewVolume( float height, float aspect );
00199
00203 SoCamera* getCamera() const;
00204
00205 #if 1 SoDEPRECATED
00216 SbVec3f getViewportCenter() const;
00217
00218 #endif
00232 SbVec3f getFocalPoint() const;
00233
00239 void setPosition( const SbVec3f& pos );
00240
00248 void setPosition( const SbVec2f& pos, float distFromEye, const SbViewportRegion& vpRegion );
00249
00255 void translate( const SbVec3f& trans );
00256
00263 void translate( const SbVec2f& displacement, const SbViewportRegion& vpRegion );
00264
00273 void pointAt( const SbVec3f& targetPoint );
00274
00286 SbRotation lookAt( const SbVec3f& position, const SbVec3f& target, const SbVec3f& up );
00287
00291 SbVec3f getDirectionVector() const;
00292
00301 void roll( float angle );
00302
00311 void pivot( float angle );
00312
00321 void tilt( float angle );
00322
00330 void rotate( const SbRotation& rot );
00331
00338 void setOrientation( const SbRotation& rot );
00339
00346 void setRotationCenter( const SbVec3f& pos );
00347
00354 void setRotationAxis( const SbVec3f& axis );
00355
00366 void rotate( float angle );
00367
00378 void viewAxis( const SbVec3f& direction, const SbVec3f& up );
00379
00387 void viewX( bool reverse = false );
00388
00397 void viewY( bool reverse = false );
00398
00407 void viewZ( bool reverse = false );
00408
00414 void viewIn( const SbBox3f& bbox );
00415
00426 void viewIn( SoPath* path, const SbViewportRegion& vpRegion );
00427
00438 void viewIn( SoNode* node, const SbViewportRegion& vpRegion );
00439
00447 void viewAll( SoPath* path, const SbViewportRegion& vpRegion );
00448
00456 void viewAll( SoNode* node, const SbViewportRegion& vpRegion );
00457
00467 SbVec3f projectToPlane( const SbVec2f& point, float distFromEye, const SbViewportRegion& vpRegion ) const;
00468
00477 SbVec2f projectToScreen( const SbVec3f& point, const SbViewportRegion& vpRegion ) const;
00478
00484 void adjustClippingPlanes( SoNode* sceneRoot, const SbViewportRegion& vpRegion );
00485
00500 void zoomInWindow( const SbVec2f& topLeftCorner, const SbVec2f& bottomRightCorner, const SbViewportRegion& vpRegion);
00501
00515 void dollyInWindow( const SbVec2f& topLeftCorner, const SbVec2f& bottomRightCorner, const SbViewportRegion& vpRegion );
00516
00528 void dollyWithZoomCenter( const SbVec2f& centerPos, float scaleFactor, const SbViewportRegion& vpRegion );
00529
00541 void activatePanning( const SbVec2f& initPos, const SbViewportRegion& vpRegion );
00542
00553 void pan( const SbVec2f& newPos, const SbViewportRegion& vpRegion );
00554
00570 void activateOrbiting( const SbVec2f& startPos );
00571
00588 void orbit( const SbRotation& rotation );
00589
00601 void orbit( const SbVec2f& newPos );
00602
00607 void pushCamera();
00608
00614 SbBool popCamera();
00615
00621 void synchronize( SoCamera* camera );
00622
00623 private:
00624
00625 SoRef<SoCameraInteractorImpl> m_impl;
00626
00627 private:
00628
00633 SoCameraInteractor() {}
00634
00635 };
00636
00637 #endif // SO_CAMERA_INTERACTOR
00638