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_FULL_VIEWER
00025 #define SO_WX_FULL_VIEWER
00026
00028
00029
00030
00032
00033 #include <Inventor/Wx/viewers/SoWxViewer.h>
00034
00035 #include <Inventor/SbPList.h>
00036 #include <Inventor/Gui/viewers/SoGuiFullViewer.h>
00037
00038 #define BASE_POPUP_MENU_ID wxID_HIGHEST+100
00039 #define LAYOUT_MGRWIDGET_ID 102
00040 #define LAYOUT_SUBMGRWIDGET_ID 103
00041
00042
00043 class SoFieldSensor;
00044 class SoStereoDialog;
00045 class SoGuiFullViewer;
00046 class SoRecordDialog;
00047
00049
00050
00051
00052
00053
00054
00055
00056
00058
00082 class SoWxFullViewer : public SoWxViewer
00083 {
00084 public:
00085
00087 enum BuildFlag
00088 {
00092 BUILD_NONE = 0x00,
00096 BUILD_DECORATION = 0x01,
00100 BUILD_POPUP = 0x02,
00104 BUILD_ALL = 0xff,
00105 };
00106
00114 void setDecoration( SbBool onOrOff );
00115
00119 SbBool isDecoration() { return m_guiFullViewer->isDecoration(); }
00120
00151 void setPopupMenuEnabled( SbBool trueOrFalse );
00152
00156 SbBool isPopupMenuEnabled() { return m_guiFullViewer->isPopupMenuEnabled(); }
00157
00161 void setClientPopupMenu( wxMenu* menu );
00162
00166 SbBool isClientPopupMenuInstalled() { return (ClientPopup!= NULL); }
00167
00171 wxPanel* getAppPushButtonParent() const { return appButtonForm; }
00172
00181 void addAppPushButton( wxButton* newButton );
00182
00191 void insertAppPushButton( wxButton* newButton, int index );
00192
00196 void removeAppPushButton( wxButton* oldButton );
00197
00201 int findAppPushButton( wxButton* oldButton ) { return m_appButtonList->find( oldButton ); }
00202
00206 int lengthAppPushButton() { return m_appButtonList->getLength(); }
00207
00211 wxPanel* getRenderAreaWidget() { return raWidget; }
00212
00213
00214 virtual void setViewing( SbBool onOrOff );
00215
00216 virtual void setCamera( SoCamera* cam );
00217 virtual void hide();
00218 virtual void setHeadlight( SbBool onOrOff );
00219 virtual void setDrawStyle( SoWxViewer::DrawType type, SoWxViewer::DrawStyle style );
00220 virtual void setBufferingType( SoWxViewer::BufferType type );
00221
00222
00223 SoStereoDialog* getStereoDialog() { return m_stereoDialogBox; }
00224 void setStereoDialog( SoStereoDialog* newDialog );
00225
00229 wxMenu* mainPopup;
00230
00234 wxMenu* funcPopup;
00235
00239 wxMenu* drawPopup;
00240
00244 wxMenu* prefPopup;
00245
00252 int curPopupDrawItem;
00253
00254
00255
00256
00257 int curPopupMoveItem;
00258
00259
00260
00261
00262 int curPopupBufferItem;
00263
00267 wxMenu* ClientPopup;
00268
00269 private:
00270 virtual ~SoWxFullViewer();
00271
00272
00273
00274 SoGuiFullViewer* getGuiFullViewer() const;
00275 void visibilityChangeCB( wxShowEvent& se );
00276
00277 private:
00278
00279 SoWxFullViewer( wxWindow* parent,
00280 const char* name,
00281 SbBool buildInsideParent,
00282 SoWxFullViewer::BuildFlag flag,
00283 SoWxViewer::Type type,
00284 SbBool buildNow,
00285 SbBool sync );
00286
00287 SoWxFullViewer( wxWindow* parent,
00288 const char* name,
00289 SbBool buildInsideParent,
00290 SoWxFullViewer::BuildFlag flag,
00291 SoWxViewer::Type type,
00292 SbBool buildNow,
00293 SbBool sync,
00294 SoGuiFullViewer* guiFullViewer );
00295
00296
00297 wxPanel* mgrWidget;
00298 wxPanel* raWidget;
00299 wxPanel* leftTrimForm, *bottomTrimForm, *rightTrimForm;
00300 wxPanel* subMgrWidget;
00301
00302
00303 wxPanel* zoomForm;
00304 wxTextCtrl* zoomField;
00305 wxSlider* zoomSlider;
00306 SoFieldSensor* zoomSensor;
00307
00308
00309 wxWindow* rightWheel, *bottomWheel, *leftWheel , *extraWheel;
00310
00311 wxPanel* extraTrimForm;
00312 float extraWheelVal;
00313 char* extraWheelStr;
00314 int extraLabelHeight;
00315 wxStaticText* extraWheelLabel;
00316
00317
00318
00319 wxPanel* vwrButtonForm;
00320
00321 char* rightWheelStr, *bottomWheelStr, *leftWheelStr;
00322 wxStaticText* rightWheelLabel, *bottomWheelLabel, *leftWheelLabel, *zoomLabel;
00323
00324
00325 SbPList* viewerButtonWidgets;
00326
00327 int numFullVwrButtons;
00328
00329
00330
00331
00332 virtual void pushButtonCB( int id );
00333
00334
00335
00336 wxPanel* getButtonWidget() const { return appButtonForm; }
00337
00338
00339 wxWindow* popupWidget, *popupToggleWidgets;
00340 wxWindow* drawStyleWidgets, *bufferStyleWidgets[3];
00341 char* popupTitle;
00342
00343
00344
00345
00346 wxPanel* buildWidget( wxWindow* parent );
00347
00348 virtual void buildDecoration();
00349 virtual wxPanel* buildLeftTrim( wxPanel* parent );
00350 virtual wxPanel* buildBottomTrim( wxPanel* parent );
00351 virtual wxPanel* buildRightTrim( wxPanel* parent );
00352 virtual wxPanel* buildZoomSlider( wxPanel* parent );
00353 wxPanel* buildAppButtons( wxPanel* parent );
00354 wxPanel* buildViewerButtons( wxPanel* parent );
00355 virtual void createViewerButtons( wxPanel* parent );
00356
00357
00358
00359
00360 virtual void buildPopupMenu();
00361 virtual void openStereoDialog();
00362 virtual void openRecordDialog();
00363
00364 virtual void destroyPopupMenu();
00365 void setPopupMenuString( const char* name );
00366 wxWindow* buildFunctionsSubmenu( wxWindow* popup );
00367 wxWindow* buildDrawStyleSubmenu( wxWindow* popup );
00368
00369
00370 virtual void displayPopupMenu();
00371
00372
00373
00374
00375 virtual void rightWheelMotion( float );
00376 virtual void bottomWheelMotion( float );
00377 virtual void leftWheelMotion( float );
00378
00379
00380
00381
00382 virtual void rightWheelStart();
00383 virtual void bottomWheelStart();
00384 virtual void leftWheelStart();
00385 virtual void rightWheelFinish();
00386 virtual void bottomWheelFinish();
00387 virtual void leftWheelFinish();
00388
00389
00390
00391
00392 void setBottomWheelString( const char* name );
00393 void setLeftWheelString( const char* name );
00394 void setRightWheelString( const char* name );
00395
00396
00397
00398
00399
00400 virtual void openViewerHelpCard();
00401
00402
00403 virtual void afterRealizeHook();
00404
00405 private:
00406 wxPanel* appButtonForm;
00407
00408 int SO_WHEEL_DELTA;
00409
00410 virtual void setSeekButton( SbBool onOff );
00411
00412
00413 wxBitmap IDB_PUSH_PICK;
00414 wxBitmap IDB_PUSH_VIEW;
00415 wxBitmap IDB_PUSH_HELP;
00416 wxBitmap IDB_PUSH_HOME;
00417 wxBitmap IDB_PUSH_SETHOME;
00418 wxBitmap IDB_PUSH_VIEWALL;
00419 wxBitmap IDB_PUSH_SEEK;
00420 wxBitmap IDB_PUSH_GRAYSEEK;
00421
00422
00423
00424 enum Functions
00425 {
00426 IDM_DPOPUP_FHOME = BASE_POPUP_MENU_ID,
00427 IDM_DPOPUP_FSHOME,
00428 IDM_DPOPUP_FVALL,
00429 IDM_DPOPUP_FSEEK
00430 };
00431
00432
00433 enum Style
00434 {
00435 IDM_DPOPUP_ASIS = BASE_POPUP_MENU_ID + 4,
00436 IDM_DPOPUP_HLINE,
00437 IDM_DPOPUP_NOTEX,
00438 IDM_DPOPUP_LOWRES,
00439 IDM_DPOPUP_WIRE,
00440 IDM_DPOPUP_POINTS,
00441 IDM_DPOPUP_BBOX
00442 };
00443
00444
00445 enum MoveStyle
00446 {
00447 IDM_DPOPUP_MSAMEAS = BASE_POPUP_MENU_ID + 11,
00448 IDM_DPOPUP_MNOTEX,
00449 IDM_DPOPUP_MLOWRES,
00450 IDM_DPOPUP_MWIRE,
00451 IDM_DPOPUP_MPOINTS,
00452 IDM_DPOPUP_MBBOX
00453 };
00454
00455
00456 enum Buffer
00457 {
00458 IDM_DPOPUP_SBUFFER = BASE_POPUP_MENU_ID + 18,
00459 IDM_DPOPUP_DBUFFER,
00460 IDM_DPOPUP_IBUFFER
00461 };
00462
00463
00464 enum Menu
00465 {
00466 IDM_PPOPUP_SEEK = BASE_POPUP_MENU_ID + 20,
00467 IDM_PPOPUP_CLIP,
00468 IDM_PPOPUP_SPIN,
00469 IDM_PPOPUP_INTERACTIVE,
00470 IDM_PPOPUP_AXES,
00471 IDM_PPOPUP_STEREO,
00472 IDM_PPOPUP_FSAA,
00473 IDM_PPOPUP_RECORDING
00474 };
00475
00476
00477 enum MainPopup
00478 {
00479
00480 IDM_MPOPUP_VIEWING = BASE_POPUP_MENU_ID + 27,
00481 IDM_MPOPUP_DECORAT,
00482 IDM_MPOPUP_FULLSCREEN,
00483 IDM_MPOPUP_HLIGHT
00484 };
00485
00486 #ifndef HIDDEN_FROM_DOC
00487 private:
00488
00489 void leftWheelDrag( wxCommandEvent& ce );
00490 void leftWheelOther( wxCommandEvent& ce );
00491 void rightWheelDrag( wxCommandEvent& ce );
00492 void rightWheelOther( wxCommandEvent& ce );
00493 void bottomWheelDrag( wxCommandEvent& ce );
00494 void bottomWheelOther( wxCommandEvent& ce );
00495
00496 void slotPushPickButton( wxCommandEvent& ce );
00497 void slotPushViewButton( wxCommandEvent& ce );
00498 void slotPushHelpButton( wxCommandEvent& ce );
00499 void slotPushHomeButton( wxCommandEvent& ce );
00500 void slotPushSetHomeButton( wxCommandEvent& ce );
00501 void slotPushViewAllButton( wxCommandEvent& ce );
00502 void slotPushSeekButton( wxCommandEvent& ce );
00503
00504
00505 void slot_popup_home( wxCommandEvent& ce );
00506 void slot_popup_setHome( wxCommandEvent& ce );
00507 void slot_popup_viewAll( wxCommandEvent& ce );
00508 void slot_popup_seek( wxCommandEvent& ce );
00509
00510
00511 void slot_popup_seekToPoint( wxCommandEvent& ce );
00512 void slot_popup_clip( wxCommandEvent& ce );
00513 void slot_popup_interactive( wxCommandEvent& ce );
00514 void slot_popup_stereo( wxCommandEvent& ce );
00515 void slot_popup_fsaa( wxCommandEvent& ce );
00516 void slot_popup_recording( wxCommandEvent& ce );
00517
00518
00519 void slot_popup_viewing( wxCommandEvent& ce );
00520 void slot_popup_decoration( wxCommandEvent& ce );
00521 void slot_popup_fullscreen( wxCommandEvent& ce );
00522 void slot_popup_headLight( wxCommandEvent& ce );
00523
00524
00525 void slot_popup_asIs( wxCommandEvent& ce );
00526 void slot_popup_hiddenLine( wxCommandEvent& ce );
00527 void slot_popup_noTexture( wxCommandEvent& ce );
00528 void slot_popup_lowResolution( wxCommandEvent& ce );
00529 void slot_popup_wireFrame( wxCommandEvent& ce );
00530 void slot_popup_points( wxCommandEvent& ce );
00531 void slot_popup_boundingBox( wxCommandEvent& ce );
00532 void slot_popup_moveSameAsStill( wxCommandEvent& ce );
00533 void slot_popup_moveNoTexture( wxCommandEvent& ce );
00534 void slot_popup_moveLowRes( wxCommandEvent& ce );
00535 void slot_popup_moveWireFrame( wxCommandEvent& ce );
00536 void slot_popup_movePoints( wxCommandEvent& ce );
00537 void slot_popup_moveBoundingBox( wxCommandEvent& ce );
00538 void slot_popup_singleBuffer( wxCommandEvent& ce );
00539 void slot_popup_doubleBuffer( wxCommandEvent& ce );
00540 void slot_popup_interactiveBuffer( wxCommandEvent& ce );
00541
00542 #endif // HIDDEN_FROM_DOC
00543
00544 private:
00545
00546 void constructorCommon( SoWxFullViewer::BuildFlag buildFlag, SbBool buildNow );
00547
00548 SoGuiFullViewer* m_guiFullViewer;
00549
00550 SbBool m_firstBuild;
00551 SbBool m_seekState;
00552
00553
00554 SbPList* m_appButtonList;
00555 void doAppButtonLayout( int start, wxButton* newButton );
00556
00557 SoStereoDialog* m_stereoDialogBox;
00558 SoRecordDialog* m_recordDialogBox;
00559
00560
00561 SbVec2f m_zoomSldRange;
00562 void setCameraZoom( float zoom );
00563 float getCameraZoom();
00564 void setZoomSliderPosition( float zoom );
00565 void setZoomFieldString( float zoom );
00566
00567 static void zoomSensorCB( void* data, SoSensor* sensor );
00568
00569
00570 wxControl* m_buttonList[10];
00571
00572 void UPDATE_CHECKMARK( int _curItem, int item );
00573
00574 void zoomSliderCB( wxCommandEvent& ce );
00575 void textChangedSlot( wxEvent& e );
00576 void setNum( int value );
00577 void slot_internalStereoDialogDestroyed( wxCommandEvent& ce );
00578 void slot_internalRecordDialogDestroyed( wxCommandEvent& ce );
00579 void slot_externalStereoDialogDestroyed( wxCommandEvent& ce );
00580 };
00581
00582 #endif // SO_WX_FULL_VIEWER
00583
00584
00585