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_EXAMINER_VIEWER
00025 #define SO_WX_EXAMINER_VIEWER
00026
00028
00029
00030
00032
00033 #include <Inventor/Wx/viewers/SoWxFullViewer.h>
00034 #include <Inventor/SbLinear.h>
00035
00036 #include <Inventor/Gui/viewers/SoGuiExaminerViewer.h>
00037
00038
00039 class SbSphereSheetProjector;
00040 class SoFieldSensor;
00041 class SoSeparator;
00042 class SoSwitch;
00043 class SoTranslation;
00044 class SoScale;
00045
00046 class SbTime;
00047
00048 class SoGuiExaminerViewer;
00049
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00080 class SoDEPRECATED SoWxExaminerViewer : public SoWxFullViewer
00184 {
00185
00186 public:
00187
00191 enum ViewingMode
00192 {
00196 VIEWING_MODE_SPIN,
00197
00207 VIEWING_MODE_SPIN_CONSTRAINED,
00208
00212 VIEWING_MODE_PAN,
00213
00218 VIEWING_MODE_ZOOM
00219 };
00220
00224 enum ConstrainedViewingMode
00225 {
00229 NONE,
00233 CONSTRAINED_VIEWING_MODE_X,
00234
00238 CONSTRAINED_VIEWING_MODE_Y,
00239
00243 CONSTRAINED_VIEWING_MODE_Z,
00244 };
00245
00250 SoWxExaminerViewer( wxWindow* parent = NULL,
00251 const char* name = NULL,
00252 SbBool buildInsideParent = TRUE,
00253 SoWxFullViewer::BuildFlag flag = SoWxFullViewer::BUILD_ALL,
00254 SoWxViewer::Type type = SoWxViewer::BROWSER );
00258 ~SoWxExaminerViewer();
00259
00266 void setViewingMode( ViewingMode viewingMode ) ;
00267
00271 ViewingMode getViewingMode() const
00272 { return (ViewingMode)m_guiExamViewer->getViewingMode(); }
00273
00285 void setConstrainedViewingMode( ConstrainedViewingMode mode );
00286
00290 ConstrainedViewingMode getConstrainedViewingMode() const
00291 { return m_constrainedMode; }
00292
00297 void setFeedbackVisibility(SbBool onOrOff);
00298
00302 SbBool isFeedbackVisible() const { return m_guiExamViewer->isFeedbackVisible(); }
00303
00307 void setFeedbackSize( int newSize );
00308
00312 int getFeedbackSize() const { return m_guiExamViewer->getFeedbackSize(); }
00313
00321 void setAnimationEnabled(SbBool onOrOff);
00322
00326 SbBool isAnimationEnabled() { return m_guiExamViewer->isAnimationEnabled(); }
00327
00331 void stopAnimating();
00332
00336 SbBool isAnimating() { return m_guiExamViewer->isAnimating(); }
00337
00338
00339
00340
00341 virtual void viewAll();
00342 virtual void resetToHomePosition();
00343 virtual void setCamera( SoCamera* cam );
00344 virtual void setViewing( SbBool onOrOff );
00345 virtual void setCursorEnabled( SbBool onOrOff );
00346 virtual void setSeekMode( SbBool onOrOff );
00347
00358 virtual void activateSpinning( const SbVec2s& newLocator );
00359
00370 virtual void activatePanning( const SbVec2s& newLocator );
00371
00382 virtual void activateDolly( const SbVec2s& newLocator );
00383
00394 virtual void activateRoll( const SbVec2s& newLocator );
00395
00402 virtual void rollCamera( const SbVec2s& newLocator );
00403
00410 virtual void spinCamera( const SbVec2f& newLocator );
00411
00422 virtual void spinConstrainedCamera( const SbVec2f& newLocator, int axisIndex );
00423
00432 virtual void dollyCamera( const SbVec2s& newLocator );
00433
00440 virtual void reverseDollyCamera( const SbVec2s& newLocator );
00441
00448 virtual void panCamera( const SbVec2f &newLocator );
00449
00450 private:
00451
00452 SoGuiExaminerViewer* getGuiExaminerViewer() const;
00453 void visibilityChangeCB( wxShowEvent& se );
00454
00455 private:
00456
00461 virtual void rotateCamera( const SbRotation& rot );
00462
00472 void constrainCameraRotation( bool x = false, bool y = false, bool z = false );
00473
00474
00475
00476
00477
00478 SoWxExaminerViewer( wxWindow* parent,
00479 const char* name,
00480 SbBool buildInsideParent,
00481 SoWxFullViewer::BuildFlag flag,
00482 SoWxViewer::Type type,
00483 SbBool buildNow,
00484 SbBool sync = true );
00485 private:
00486
00487
00488 virtual SbString getDefaultWidgetName() const;
00489 virtual SbString getDefaultTitle() const;
00490 virtual SbString getDefaultIconTitle() const;
00491
00492
00493 virtual void processEvent( wxEvent& anyEvent );
00494 virtual void actualRedraw();
00495
00496
00497 wxPanel* buildWidget( wxWindow* parent );
00498
00499
00500 virtual void bottomWheelMotion( float newVal );
00501 virtual void leftWheelMotion( float newVal );
00502 virtual void rightWheelMotion( float newVal );
00503 virtual void mouseWheelMotion( float newVal );
00504
00505
00506 virtual void bottomWheelStart();
00507 virtual void leftWheelStart();
00508
00509
00510 virtual void createPrefSheet();
00511
00512
00513 virtual void createViewerButtons( wxPanel* parent );
00514
00515
00516
00517
00518 virtual void buildPopupMenu();
00519
00520
00521 virtual void openViewerHelpCard();
00522
00523 virtual void pushButtonCB( int id );
00524
00525 virtual void updateCursor();
00526
00527 virtual void switchMode( int newMode );
00528
00529 virtual void doSpinAnimation();
00530
00531 private:
00532 SoGuiExaminerViewer* m_guiExamViewer;
00533
00534
00535 SoGuiExaminerViewer::ViewingSpinType m_viewingSpinType ;
00536 ConstrainedViewingMode m_constrainedMode;
00537
00538 SbBool m_firstBuild;
00539
00540
00541 SbTime m_lastMotionTime;
00542
00543 void setViewerMode();
00544 void updateViewerMode( wxMouseEvent& me );
00545
00546
00547 wxBitmapButton* m_buttonList[10];
00548 static void camPushCB( SoWxExaminerViewer* ev );
00549
00550
00551 void constructorCommon( SbBool buildNow );
00552
00553
00554 wxBitmap IDB_PUSH_PERSP;
00555 wxBitmap IDB_PUSH_ORTHO;
00556
00557 #ifndef HIDDEN_FROM_DOC
00558
00559
00560 void slotCamPushButton( wxCommandEvent& ce );
00561
00562
00563 void slot_popup_spin( wxCommandEvent& ce );
00564 void slot_popup_axes( wxCommandEvent& ce );
00565 void slot_popup_interactive( wxCommandEvent& ce );
00566
00567 #endif // HIDDEN_FROM_DOC
00568 };
00569
00570 #endif // SO_WX_EXAMINER_VIEWER
00571
00572
00573