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 #ifndef _SO_QT_FULL_VIEWER_
00026 #define _SO_QT_FULL_VIEWER_
00027 #include <Inventor/Qt/OivQtCompat.h>
00028
00029 #include <QScrollBar>
00030 #include <QPushButton>
00031 #include <QString>
00032 #include <QLabel>
00033 #include <QMenu>
00034 #include <QAction>
00035 #include <QVBoxLayout>
00036 #include <QHBoxLayout>
00037
00038 #include <Inventor/Qt/viewers/SoQtViewer.h>
00039
00040 #include <Inventor/SbPList.h>
00041
00042 #include <Inventor/Gui/viewers/SoGuiFullViewer.h>
00043
00044 #include <QPointer>
00045
00046
00047 class SoFieldSensor;
00048 class SoQtThumbWheel;
00049 class SoStereoDialog;
00050 class QLineEdit;
00051 class SoRecordDialog;
00052
00054
00055
00056
00057
00058
00059
00060
00061
00063
00088 class SoQtFullViewer : public SoQtViewer
00089 {
00090
00091 Q_OBJECT
00092
00093 public:
00097 enum BuildFlag
00098 {
00102 BUILD_NONE = 0x00,
00106 BUILD_DECORATION = 0x01,
00110 BUILD_POPUP = 0x02,
00114 BUILD_ALL = 0xff
00115 };
00116
00124 virtual void setDecoration( SbBool onOrOff );
00125
00129 SbBool isDecoration() { return m_guiFullViewer->isDecoration(); }
00130
00160 void setPopupMenuEnabled( SbBool trueOrFalse );
00161
00165 SbBool isPopupMenuEnabled() { return m_guiFullViewer->isPopupMenuEnabled(); }
00166
00170 void setClientPopupMenu( QMenu* menu );
00171
00175 SbBool isClientPopupMenuInstalled() { return (ClientPopup!= NULL); }
00176
00180 QWidget* getAppPushButtonParent() const { return appButtonForm; }
00181
00190 void addAppPushButton( SoQtButton* newButton );
00191
00200 void insertAppPushButton( SoQtButton* newButton, int index );
00201
00205 void removeAppPushButton( SoQtButton* oldButton );
00206
00210 int findAppPushButton( SoQtButton* oldButton ) { return appButtonList->find(oldButton); }
00211
00215 int lengthAppPushButton() { return appButtonList->getLength(); }
00216
00220 QWidget* getRenderAreaWidget() { return raWidget; }
00221
00222
00223 virtual void setViewing( SbBool onOrOff );
00224
00225 virtual void setCamera( SoCamera* cam );
00226 virtual void hide();
00227 virtual void setHeadlight( SbBool onOrOff);
00228 virtual void setDrawStyle( SoQtViewer::DrawType type, SoQtViewer::DrawStyle style );
00229 virtual void setBufferingType( SoQtViewer::BufferType type );
00230
00234 virtual SoStereoDialog* getStereoDialog() { return stereoDialogBox; }
00235
00239 void setStereoDialog( SoStereoDialog* newDialog );
00240
00244 QPointer<QMenu> mainPopup;
00245
00249 QPointer<QMenu> funcPopup;
00250
00254 QPointer<QMenu> drawPopup;
00255
00259 QPointer<QMenu> prefPopup;
00260
00267 QAction* curPopupDrawItem;
00268
00269
00270
00271
00272 QAction* curPopupMoveItem;
00273
00274
00275
00276
00277 QAction* curPopupBufferItem;
00278
00282 QPointer<QMenu> ClientPopup;
00283
00284 private:
00285 virtual ~SoQtFullViewer();
00286
00287 SoGuiFullViewer* getGuiFullViewer() const;
00288
00289 virtual void openStereoDialog();
00290 virtual void openRecordDialog();
00291
00292 virtual void internalSetViewingMode( int ) {};
00293 virtual int internalGetViewingMode() const { return 0; };
00294 virtual void defineCursors() { SoQtViewer::defineCursors(); };
00295
00296
00297 float rightWheelVal, leftWheelVal, bottomWheelVal;
00298 SbBool popupEnabled;
00299
00300 private:
00301
00302 SoQtFullViewer( QWidget* parent,
00303 const char* name,
00304 SbBool buildInsideParent,
00305 SoQtFullViewer::BuildFlag flag,
00306 SoQtViewer::Type type,
00307 SbBool buildNow,
00308 SbBool sync );
00309
00310 SoQtFullViewer( QWidget* parent,
00311 const char* name,
00312 SbBool buildInsideParent,
00313 SoQtFullViewer::BuildFlag flag,
00314 SoQtViewer::Type type,
00315 SbBool buildNow,
00316 SbBool sync,
00317 SoGuiFullViewer* guiFullViewer );
00318
00319
00320 QWidget *mgrWidget;
00321 QWidget *raWidget;
00322
00323 QPointer<QWidget> leftTrimForm, bottomTrimForm, rightTrimForm;
00324 QWidget* subMgrWidget;
00325 QHBoxLayout* subHbl;
00326
00327 QPointer<QWidget> zoomForm;
00328 QLineEdit *zoomField;
00329 QScrollBar *zoomSlider;
00330 SoFieldSensor *zoomSensor;
00331
00332
00333 SoQtThumbWheel *rightWheel, *bottomWheel, *leftWheel , *extraWheel;
00334
00335 QPointer<QWidget> extraTrimForm;
00336 float extraWheelVal;
00337 QString extraWheelStr;
00338 int extraLabelHeight;
00339 QWidget *extraWheelLabel;
00340
00341
00342
00343 QPointer<QWidget> vwrButtonForm;
00344
00345 QBrush backgroundBrush;
00346
00347 QString rightWheelStr, bottomWheelStr, leftWheelStr;
00348 QLabel *rightWheelLabel, *bottomWheelLabel, *leftWheelLabel, *zoomLabel;
00349
00350
00351 SbPList *viewerButtonWidgets;
00352
00353 int numFullVwrButtons;
00354
00355
00356
00357
00358 virtual void pushButtonCB( int id );
00359
00360
00361
00362 QWidget *getButtonWidget() const { return appButtonForm; }
00363
00364
00365 QWidget *popupWidget, *popupToggleWidgets;
00366 QWidget *drawStyleWidgets, *bufferStyleWidgets[3];
00367 QString popupTitle;
00368
00369
00370
00371
00372 QWidget *buildWidget( QWidget* parent );
00373
00374 virtual void buildDecoration();
00375 virtual QWidget *buildLeftTrim( QWidget* parent );
00376 virtual QWidget *buildBottomTrim( QWidget* parent );
00377 virtual QWidget *buildRightTrim( QWidget* parent );
00378 virtual QWidget *buildZoomSlider( QWidget* parent );
00379 QWidget *buildAppButtons( QWidget* parent );
00380 QWidget *buildViewerButtons( QWidget* parent );
00381 virtual void createViewerButtons( QWidget* parent );
00382
00383
00384
00385
00386 virtual void buildPopupMenu();
00387
00388 virtual void destroyPopupMenu();
00389 void setPopupMenuString( const QString& name );
00390 QWidget* buildFunctionsSubmenu( QWidget* popup );
00391 QWidget* buildDrawStyleSubmenu( QWidget* popup );
00392
00393
00394 virtual void displayPopupMenu( QPoint point );
00395
00396
00397
00398
00399 virtual void rightWheelMotion( float f );
00400 virtual void bottomWheelMotion( float f);
00401 virtual void leftWheelMotion( float f );
00402
00403
00404
00405
00406 virtual void rightWheelStart();
00407 virtual void bottomWheelStart();
00408 virtual void leftWheelStart();
00409 virtual void rightWheelFinish();
00410 virtual void bottomWheelFinish();
00411 virtual void leftWheelFinish();
00412
00413
00414
00415
00416 void setBottomWheelString( const QString& name );
00417 void setLeftWheelString( const QString& name );
00418 void setRightWheelString( const QString& name );
00419
00420
00421
00422
00423
00424 virtual void openViewerHelpCard();
00425
00426
00427 virtual void afterRealizeHook();
00428
00429 private:
00430 QPointer<QWidget> appButtonForm;
00431
00432 int SO_WHEEL_DELTA;
00433
00434 virtual void setSeekButton( SbBool onOff );
00435
00436 private:
00437 void constructorCommon( SoQtFullViewer::BuildFlag buildFlag, SbBool buildNow );
00438
00439 SoGuiFullViewer* m_guiFullViewer;
00440
00441 SbBool firstBuild;
00442 SbBool m_seekState;
00443
00444
00445 SbPList* appButtonList;
00446 void doAppButtonLayout( int start, SoQtButton* newButton );
00447
00448 SoStereoDialog *stereoDialogBox;
00449 SoRecordDialog* m_recordDialogBox;
00450
00451
00452 SbVec2f zoomSldRange;
00453 void setCameraZoom( float zoom );
00454 float getCameraZoom();
00455 void setZoomSliderPosition( float zoom );
00456 void setZoomFieldString( float zoom );
00457
00458 static void zoomSensorCB( void* d, SoSensor* s );
00459
00460
00461 SoQtButton* buttonList[10];
00462
00463
00464 QWidget* prefSheetShellWidget;
00465 char* prefSheetStr;
00466
00467
00468 int seekDistWheelVal;
00469 QWidget* seekDistField;
00470
00471
00472 QWidget* clipWheelForm;
00473 int clipNearWheelVal, clipFarWheelVal;
00474 QWidget* clipNearField, clipFarField;
00475
00476
00477 QWidget* stereoWheelForm, stereoField, stereoLabel;
00478 int stereoWheelVal;
00479
00480 void UPDATE_CHECKMARK( QAction* curItem, QAction* item );
00481
00482 QVBoxLayout* mgrVbl;
00483
00484 private:
00485
00486
00487 QPixmap IDB_PUSH_PICK;
00488 QPixmap IDB_PUSH_VIEW;
00489 QPixmap IDB_PUSH_HELP;
00490 QPixmap IDB_PUSH_HOME;
00491 QPixmap IDB_PUSH_SETHOME;
00492 QPixmap IDB_PUSH_VIEWALL;
00493 QPixmap IDB_PUSH_SEEK;
00494 QPixmap IDB_PUSH_GRAYSEEK;
00495
00496
00497 QAction* IDM_DPOPUP_ASIS;
00498 QAction* IDM_DPOPUP_HLINE;
00499 QAction* IDM_DPOPUP_NOTEX;
00500 QAction* IDM_DPOPUP_LOWRES;
00501 QAction* IDM_DPOPUP_WIRE;
00502 QAction* IDM_DPOPUP_POINTS;
00503 QAction* IDM_DPOPUP_BBOX;
00504
00505 QAction* IDM_DPOPUP_MSAMEAS ;
00506 QAction* IDM_DPOPUP_MNOTEX;
00507 QAction* IDM_DPOPUP_MLOWRES;
00508 #ifdef _WIN32
00509 QAction* IDM_DPOPUP_MHLINE;
00510 #endif
00511 QAction* IDM_DPOPUP_MWIRE;
00512 QAction* IDM_DPOPUP_MPOINTS;
00513 QAction* IDM_DPOPUP_MBBOX;
00514
00515 QAction* IDM_DPOPUP_SBUFFER;
00516 QAction* IDM_DPOPUP_DBUFFER;
00517 QAction* IDM_DPOPUP_IBUFFER;
00518
00519 QAction* IDM_PPOPUP_SEEK;
00520 QAction* IDM_PPOPUP_CLIP;
00521 QAction* IDM_PPOPUP_SPIN;
00522 QAction* IDM_PPOPUP_INTERACTIVE;
00523 QAction* IDM_PPOPUP_AXES;
00524 QAction* IDM_PPOPUP_STEREO;
00525 QAction* IDM_PPOPUP_FSAA;
00526 QAction* IDM_PPOPUP_RECORD;
00527
00528 QAction* IDM_MPOPUP_VIEWING;
00529 QAction* IDM_MPOPUP_DECORAT;
00530 QAction* IDM_MPOPUP_FULLSCREEN;
00531 QAction* IDM_MPOPUP_HLIGHT;
00532
00533 #ifndef HIDDEN_FROM_DOC
00534 protected Q_SLOTS:
00535
00539 void leftWheelDrag( int value );
00540 void leftWheelOther();
00541 void rightWheelDrag( int value );
00542 void rightWheelOther();
00543 void bottomWheelDrag( int value );
00544 void bottomWheelOther();
00545
00549 void slotPushPickButton();
00550 void slotPushViewButton();
00551 void slotPushHelpButton();
00552 void slotPushHomeButton();
00553 void slotPushSetHomeButton();
00554 void slotPushViewAllButton();
00555 void slotPushSeekButton();
00556
00557
00561 void slot_popup_home();
00562 void slot_popup_setHome();
00563 void slot_popup_viewAll();
00564 void slot_popup_seek();
00565
00566
00570 void slot_popup_seekToPoint();
00571 void slot_popup_clip();
00572 void slot_popup_interactive();
00573 void slot_popup_stereo();
00574 void slot_popup_fsaa();
00575 void slot_popup_recording();
00576
00577
00581 void slot_popup_viewing();
00582 void slot_popup_decoration();
00583 void slot_popup_fullscreen();
00584 void slot_popup_headLight();
00585
00586
00590 void slot_popup_asIs();
00591 void slot_popup_hiddenLine();
00592 void slot_popup_noTexture();
00593 void slot_popup_lowResolution();
00594 void slot_popup_wireFrame();
00595 void slot_popup_points();
00596 void slot_popup_boundingBox();
00597 void slot_popup_moveSameAsStill();
00598 void slot_popup_moveNoTexture();
00599 void slot_popup_moveLowRes();
00600 void slot_popup_moveWireFrame();
00601 void slot_popup_movePoints();
00602 void slot_popup_moveBoundingBox();
00603 void slot_popup_singleBuffer();
00604 void slot_popup_doubleBuffer();
00605 void slot_popup_interactiveBuffer();
00606
00607 #endif // HIDDEN_FROM_DOC
00608
00609 private Q_SLOTS:
00610 void visibilityChangeCB( SbBool visible );
00611 void zoomSliderCB( int value );
00612 void textChangedSlot();
00613 void setNum( int value );
00614 void slot_internalStereoDialogDestroyed();
00615 void slot_externalStereoDialogDestroyed();
00616 void slot_internalRecordDialogDestroyed();
00617 };
00618
00619 #endif
00620
00621
00622