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
00184 class SoWxExaminerViewer : public SoWxFullViewer
00185 {
00186
00187 public:
00188
00192 enum ViewingMode
00193 {
00197 VIEWING_MODE_SPIN,
00198
00208 VIEWING_MODE_SPIN_CONSTRAINED,
00209
00213 VIEWING_MODE_PAN,
00214
00219 VIEWING_MODE_ZOOM
00220 };
00221
00225 enum ConstrainedViewingMode
00226 {
00230 NONE,
00234 CONSTRAINED_VIEWING_MODE_X,
00235
00239 CONSTRAINED_VIEWING_MODE_Y,
00240
00244 CONSTRAINED_VIEWING_MODE_Z,
00245 };
00246
00251 SoWxExaminerViewer( wxWindow* parent = NULL,
00252 const char* name = NULL,
00253 SbBool buildInsideParent = TRUE,
00254 SoWxFullViewer::BuildFlag flag = SoWxFullViewer::BUILD_ALL,
00255 SoWxViewer::Type type = SoWxViewer::BROWSER );
00259 ~SoWxExaminerViewer();
00260
00267 void setViewingMode( ViewingMode viewingMode ) ;
00268
00272 ViewingMode getViewingMode() const
00273 { return (ViewingMode)m_guiExamViewer->getViewingMode(); }
00274
00286 void setConstrainedViewingMode( ConstrainedViewingMode mode );
00287
00291 ConstrainedViewingMode getConstrainedViewingMode() const
00292 { return m_constrainedMode; }
00293
00298 void setFeedbackVisibility(SbBool onOrOff);
00299
00303 SbBool isFeedbackVisible() const { return m_guiExamViewer->isFeedbackVisible(); }
00304
00308 void setFeedbackSize( int newSize );
00309
00313 int getFeedbackSize() const { return m_guiExamViewer->getFeedbackSize(); }
00314
00322 void setAnimationEnabled(SbBool onOrOff);
00323
00327 SbBool isAnimationEnabled() { return m_guiExamViewer->isAnimationEnabled(); }
00328
00332 void stopAnimating();
00333
00337 SbBool isAnimating() { return m_guiExamViewer->isAnimating(); }
00338
00339
00340
00341
00342 virtual void viewAll();
00343 virtual void resetToHomePosition();
00344 virtual void setCamera( SoCamera* cam );
00345 virtual void setViewing( SbBool onOrOff );
00346 virtual void setCursorEnabled( SbBool onOrOff );
00347 virtual void setSeekMode( SbBool onOrOff );
00348
00359 virtual void activateSpinning( const SbVec2s& newLocator );
00360
00371 virtual void activatePanning( const SbVec2s& newLocator );
00372
00383 virtual void activateDolly( const SbVec2s& newLocator );
00384
00395 virtual void activateRoll( const SbVec2s& newLocator );
00396
00403 virtual void rollCamera( const SbVec2s& newLocator );
00404
00411 virtual void spinCamera( const SbVec2f& newLocator );
00412
00423 virtual void spinConstrainedCamera( const SbVec2f& newLocator, int axisIndex );
00424
00433 virtual void dollyCamera( const SbVec2s& newLocator );
00434
00441 virtual void reverseDollyCamera( const SbVec2s& newLocator );
00442
00449 virtual void panCamera( const SbVec2f &newLocator );
00450
00451 private:
00452
00453 SoGuiExaminerViewer* getGuiExaminerViewer() const;
00454 void visibilityChangeCB( wxShowEvent& se );
00455
00456 private:
00457
00462 virtual void rotateCamera( const SbRotation& rot );
00463
00473 void constrainCameraRotation( bool x = false, bool y = false, bool z = false );
00474
00475
00476
00477
00478
00479 SoWxExaminerViewer( wxWindow* parent,
00480 const char* name,
00481 SbBool buildInsideParent,
00482 SoWxFullViewer::BuildFlag flag,
00483 SoWxViewer::Type type,
00484 SbBool buildNow,
00485 SbBool sync = true );
00486 private:
00487
00488
00489 virtual SbString getDefaultWidgetName() const;
00490 virtual SbString getDefaultTitle() const;
00491 virtual SbString getDefaultIconTitle() const;
00492
00493
00494 virtual void processEvent( wxEvent& anyEvent );
00495 virtual void actualRedraw();
00496
00497
00498 wxPanel* buildWidget( wxWindow* parent );
00499
00500
00501 virtual void bottomWheelMotion( float newVal );
00502 virtual void leftWheelMotion( float newVal );
00503 virtual void rightWheelMotion( float newVal );
00504 virtual void mouseWheelMotion( float newVal );
00505
00506
00507 virtual void bottomWheelStart();
00508 virtual void leftWheelStart();
00509
00510
00511 virtual void createPrefSheet();
00512
00513
00514 virtual void createViewerButtons( wxPanel* parent );
00515
00516
00517
00518
00519 virtual void buildPopupMenu();
00520
00521
00522 virtual void openViewerHelpCard();
00523
00524 virtual void pushButtonCB( int id );
00525
00526 virtual void updateCursor();
00527
00528 virtual void switchMode( int newMode );
00529
00530 virtual void doSpinAnimation();
00531
00532 private:
00533 SoGuiExaminerViewer* m_guiExamViewer;
00534
00535
00536 SoGuiExaminerViewer::ViewingSpinType m_viewingSpinType ;
00537 ConstrainedViewingMode m_constrainedMode;
00538
00539 SbBool m_firstBuild;
00540
00541
00542 SbTime m_lastMotionTime;
00543
00544 void setViewerMode();
00545 void updateViewerMode( wxMouseEvent& me );
00546
00547
00548 wxBitmapButton* m_buttonList[10];
00549 static void camPushCB( SoWxExaminerViewer* ev );
00550
00551
00552 void constructorCommon( SbBool buildNow );
00553
00554
00555 wxBitmap IDB_PUSH_PERSP;
00556 wxBitmap IDB_PUSH_ORTHO;
00557
00558 #ifndef HIDDEN_FROM_DOC
00559
00560
00561 void slotCamPushButton( wxCommandEvent& ce );
00562
00563
00564 void slot_popup_spin( wxCommandEvent& ce );
00565 void slot_popup_axes( wxCommandEvent& ce );
00566 void slot_popup_interactive( wxCommandEvent& ce );
00567
00568 #endif // HIDDEN_FROM_DOC
00569 };
00570
00571 #endif // SO_WX_EXAMINER_VIEWER
00572
00573
00574