00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 #if defined(_WIN32)
00026 #  include <Inventor/Win/viewers/SoWinPlaneViewer.h>
00027 #else // _WIN32
00028 
00029 #ifndef  _SO_XT_PLANE_VIEWER_
00030 #define  _SO_XT_PLANE_VIEWER_
00031 
00032 #include <Inventor/MP/Xt/viewers/SoXtMPFullViewer.h>
00033 #include <Inventor/SbLinear.h>
00034 
00035 class SoXtBitmapButton;
00036 
00037 
00039 
00040 
00041 
00042 
00043 
00044 
00045 
00046 
00047 
00048 
00049 
00050 
00051 
00052 
00053 
00054 
00055 
00056 
00057 
00058 
00059 
00060 
00061 
00063 
00129 class  SoXtMPPlaneViewer : public SoXtMPFullViewer {
00130  public:
00135   SoXtMPPlaneViewer(
00136                     SoWidget parent = NULL,
00137                     const char *name = NULL, 
00138                     SbBool buildInsideParent = TRUE, 
00139                     SoXtMPFullViewer::BuildFlag flag = BUILD_ALL, 
00140                     SoXtMPViewer::Type type = BROWSER);
00144   ~SoXtMPPlaneViewer();
00145     
00149   void setPlane(const SbVec3f &newNormal, const SbVec3f &newRight);
00150 
00151   
00152   
00153   
00154   virtual void        setViewing(SbBool onOrOff);
00155   virtual void        setCamera(SoCamera *cam);
00156   virtual void        setCursorEnabled(SbBool onOrOff);
00157     
00158  private:
00159   
00160   
00161   
00162   
00163   SoEXTENDER
00164     SoXtMPPlaneViewer(
00165                       SoWidget parent,
00166                       const char *name, 
00167                       SbBool buildInsideParent, 
00168                       SoXtMPFullViewer::BuildFlag flag, 
00169                       SoXtMPViewer::Type type, 
00170                       SbBool buildNow);
00171 
00172   SoWidget              buildWidget(SoWidget parent);
00173         
00174   
00175   virtual SbString    getDefaultWidgetName() const;
00176   virtual SbString    getDefaultTitle() const;
00177   virtual SbString    getDefaultIconTitle() const;
00178     
00179   
00180   virtual void        processEvent(XAnyEvent *anyevent);
00181   virtual void        setSeekMode(SbBool onOrOff);
00182   virtual void        actualRedraw();
00183     
00184   
00185   virtual void        bottomWheelMotion(float newVal);
00186   virtual void        leftWheelMotion(float newVal);
00187   virtual void        rightWheelMotion(float newVal);
00188     
00189   
00190   virtual void        createPrefSheet();
00191     
00192   
00193   virtual void        createViewerButtons(SoWidget parent);
00194     
00195   
00196   virtual void        openViewerHelpCard();
00197     
00198   
00199   virtual void        computeSeekFinalOrientation();
00200 
00201  private:
00202   
00203   int             mode;
00204   SbBool          createdCursors;
00205   Cursor          transCursor, dollyCursor, seekCursor;
00206   SbVec2s         locator; 
00207     
00208   
00209   SbVec3f         locator3D;
00210   SbPlane         focalplane;
00211   float           transXspeed, transYspeed;
00212     
00213   
00214   SoXtBitmapButton  *buttonList[10];
00215   static void     pushButtonCB(SoWidget, int id, void *);
00216     
00217   void            updateViewerMode(unsigned int state);
00218   void            switchMode(int newMode);
00219   void            updateCursor();
00220   void            defineCursors();
00221   void            rollCamera(const SbVec2s &newLocator);
00222   void            translateCamera(const SbVec2f &newLocator);
00223   void            dollyCamera(const SbVec2s &newLocator);
00224     
00225   
00226   virtual void    bottomWheelStart();
00227   virtual void    leftWheelStart();
00228   void            computeTranslateValues();
00229     
00230   
00231   void constructorCommon(SbBool buildNow);
00232 
00233 };
00234 
00235 #endif  
00236 
00237 #endif // _WIN32
00238 
00239 
00240