00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 #ifndef SO_WX_PLANE_VIEWER
00025 #define SO_WX_PLANE_VIEWER
00026 
00028 
00029 
00030 
00032 
00033 #include <Inventor/Wx/viewers/SoWxFullViewer.h>
00034 
00035 #include <Inventor/Gui/viewers/SoGuiPlaneViewer.h>
00036 #include <Inventor/SbLinear.h>
00037 
00038 class SoGuiPlaneViewer;
00039 
00041 
00042 
00043 
00044 
00045 
00046 
00047 
00048 
00049 
00050 
00051 
00052 
00053 
00054 
00055 
00056 
00057 
00058 
00059 
00060 
00061 
00062 
00063 
00064 
00065 
00066 
00067 
00068 
00070 
00130 class  SoWxPlaneViewer : public SoWxFullViewer 
00131 {
00132 
00133     public:
00142   SoWxPlaneViewer( wxWindow* parent = NULL,
00143                    const char* name = NULL, 
00144                    SbBool buildInsideParent = TRUE, 
00145                    SoWxFullViewer::BuildFlag flag = SoWxFullViewer::BUILD_ALL, 
00146                    SoWxViewer::Type type = SoWxViewer::BROWSER );
00150   ~SoWxPlaneViewer();
00151 
00155   void setPlane( const SbVec3f& newNormal, const SbVec3f& newRight );
00156 
00157   
00158   virtual void setViewing( SbBool onOrOff );
00159   virtual void setCamera( SoCamera* cam );
00160   virtual void setCursorEnabled( SbBool onOrOff );
00161   virtual void setSeekMode( SbBool onOrOff );
00162  
00163   
00164   
00165   
00166   private:
00167 
00168     SoGuiPlaneViewer* getGuiPlaneViewer() const;
00169 
00170     SoWxPlaneViewer( wxWindow* parent,
00171                      const char* name, 
00172                      SbBool buildInsideParent, 
00173                      SoWxFullViewer::BuildFlag flag, 
00174                      SoWxViewer::Type type, 
00175                      SbBool buildNow,
00176                      SbBool sync = true );
00177 
00178   private:
00179   
00180     void visibilityChangeCB( wxShowEvent& se );
00181 
00182 private:
00183 
00184   wxPanel* buildWidget(wxWindow* parent);
00185 
00186   
00187   virtual SbString getDefaultWidgetName() const;
00188   virtual SbString getDefaultTitle() const;
00189   virtual SbString getDefaultIconTitle() const;
00190 
00191   
00192   virtual void processEvent( wxEvent& anyEvent );
00193   virtual void actualRedraw();
00194 
00195   
00196   virtual void bottomWheelMotion( float newVal );
00197   virtual void leftWheelMotion( float newVal );
00198   virtual void rightWheelMotion( float newVal );
00199   virtual void mouseWheelMotion( float newVal );
00200 
00201   
00202   virtual void createPrefSheet();
00203 
00204   
00205   virtual void createViewerButtons( wxPanel* parent );
00206 
00207   
00208   virtual void openViewerHelpCard();
00209 
00210   
00211   virtual void computeSeekFinalOrientation();
00212 
00213   
00214   
00215   
00216   
00217   
00218   
00219   virtual void pushButtonCB( int id );
00220 
00221   virtual void updateCursor();
00222 
00223  private:
00224 
00225    enum BUTTONS_ID
00226    {
00227      X_PUSH_ID = wxID_HIGHEST + 3001,
00228      Y_PUSH_ID,
00229      Z_PUSH_ID,
00230      CAM_PUSH_ID,
00231    };
00232 
00233   wxBitmap X_PUSH;
00234   wxBitmap Y_PUSH;
00235   wxBitmap Z_PUSH;
00236   wxBitmap CAM_PUSH_PERSP;
00237   wxBitmap CAM_PUSH_ORTHO;
00238 
00239   SoGuiPlaneViewer* m_guiPlaneViewer; 
00240 
00241   
00242   wxBitmapButton* buttonList[10];
00243 
00244   
00245   
00246   
00247 
00248   void updateViewerMode( wxMouseEvent& me );
00249   void switchMode( int newMode );
00250   
00251   
00252   void constructorCommon( SbBool buildNow );
00253 
00254   
00255   void processPopupItem( int item );
00256 
00257   void slot_xButton( wxCommandEvent& ce );
00258   void slot_yButton( wxCommandEvent& ce );   
00259   void slot_zButton( wxCommandEvent& ce );   
00260   void slotCamPushButton( wxCommandEvent& ce );  
00261 };
00262 
00263 
00264 #endif  // SO_WX_PLANE_VIEWER
00265 
00266 
00267