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
00089 class SoQtFullViewer : public SoQtViewer
00090 {
00091
00092 Q_OBJECT
00093
00094 public:
00098 enum BuildFlag
00099 {
00103 BUILD_NONE = 0x00,
00107 BUILD_DECORATION = 0x01,
00111 BUILD_POPUP = 0x02,
00115 BUILD_ALL = 0xff
00116 };
00117
00125 virtual void setDecoration( SbBool onOrOff );
00126
00130 SbBool isDecoration() { return m_guiFullViewer->isDecoration(); }
00131
00162 void setPopupMenuEnabled( SbBool trueOrFalse );
00163
00167 SbBool isPopupMenuEnabled() { return m_guiFullViewer->isPopupMenuEnabled(); }
00168
00172 void setClientPopupMenu( QMenu* menu );
00173
00177 SbBool isClientPopupMenuInstalled() { return (ClientPopup!= NULL); }
00178
00182 QWidget* getAppPushButtonParent() const { return appButtonForm; }
00183
00192 void addAppPushButton( SoQtButton* newButton );
00193
00202 void insertAppPushButton( SoQtButton* newButton, int index );
00203
00207 void removeAppPushButton( SoQtButton* oldButton );
00208
00212 int findAppPushButton( SoQtButton* oldButton ) { return appButtonList->find(oldButton); }
00213
00217 int lengthAppPushButton() { return appButtonList->getLength(); }
00218
00222 QWidget* getRenderAreaWidget() { return raWidget; }
00223
00224
00225 virtual void setViewing( SbBool onOrOff );
00226
00227 virtual void setCamera( SoCamera* cam );
00228 virtual void hide();
00229 virtual void setHeadlight( SbBool onOrOff);
00230 virtual void setDrawStyle( SoQtViewer::DrawType type, SoQtViewer::DrawStyle style );
00231 virtual void setBufferingType( SoQtViewer::BufferType type );
00232
00236 virtual SoStereoDialog* getStereoDialog() { return stereoDialogBox; }
00237
00241 void setStereoDialog( SoStereoDialog* newDialog );
00242
00246 QPointer<QMenu> mainPopup;
00247
00251 QPointer<QMenu> funcPopup;
00252
00256 QPointer<QMenu> drawPopup;
00257
00261 QPointer<QMenu> prefPopup;
00262
00269 QAction* curPopupDrawItem;
00270
00271
00272
00273
00274 QAction* curPopupMoveItem;
00275
00276
00277
00278
00279 QAction* curPopupBufferItem;
00280
00284 QPointer<QMenu> ClientPopup;
00285
00286 private:
00287 virtual ~SoQtFullViewer();
00288
00289 SoGuiFullViewer* getGuiFullViewer() const;
00290
00291 virtual void openStereoDialog();
00292 virtual void openRecordDialog();
00293
00294 virtual void internalSetViewingMode( int ) {};
00295 virtual int internalGetViewingMode() const { return 0; };
00296 virtual void defineCursors() { SoQtViewer::defineCursors(); };
00297
00298
00299 float rightWheelVal, leftWheelVal, bottomWheelVal;
00300 SbBool popupEnabled;
00301
00302 private:
00303
00304 SoQtFullViewer( QWidget* parent,
00305 const char* name,
00306 SbBool buildInsideParent,
00307 SoQtFullViewer::BuildFlag flag,
00308 SoQtViewer::Type type,
00309 SbBool buildNow,
00310 SbBool sync );
00311
00312 SoQtFullViewer( QWidget* parent,
00313 const char* name,
00314 SbBool buildInsideParent,
00315 SoQtFullViewer::BuildFlag flag,
00316 SoQtViewer::Type type,
00317 SbBool buildNow,
00318 SbBool sync,
00319 SoGuiFullViewer* guiFullViewer );
00320
00321
00322 QWidget *mgrWidget;
00323 QWidget *raWidget;
00324
00325 QPointer<QWidget> leftTrimForm, bottomTrimForm, rightTrimForm;
00326 QWidget* subMgrWidget;
00327 QHBoxLayout* subHbl;
00328
00329 QPointer<QWidget> zoomForm;
00330 QLineEdit *zoomField;
00331 QScrollBar *zoomSlider;
00332 SoFieldSensor *zoomSensor;
00333
00334
00335 SoQtThumbWheel *rightWheel, *bottomWheel, *leftWheel , *extraWheel;
00336
00337 QPointer<QWidget> extraTrimForm;
00338 float extraWheelVal;
00339 QString extraWheelStr;
00340 int extraLabelHeight;
00341 QWidget *extraWheelLabel;
00342
00343
00344
00345 QPointer<QWidget> vwrButtonForm;
00346
00347 QBrush backgroundBrush;
00348
00349 QString rightWheelStr, bottomWheelStr, leftWheelStr;
00350 QLabel *rightWheelLabel, *bottomWheelLabel, *leftWheelLabel, *zoomLabel;
00351
00352
00353 SbPList *viewerButtonWidgets;
00354
00355 int numFullVwrButtons;
00356
00357
00358
00359
00360 virtual void pushButtonCB( int id );
00361
00362
00363
00364 QWidget *getButtonWidget() const { return appButtonForm; }
00365
00366
00367 QWidget *popupWidget, *popupToggleWidgets;
00368 QWidget *drawStyleWidgets, *bufferStyleWidgets[3];
00369 QString popupTitle;
00370
00371
00372
00373
00374 QWidget *buildWidget( QWidget* parent );
00375
00376 virtual void buildDecoration();
00377 virtual QWidget *buildLeftTrim( QWidget* parent );
00378 virtual QWidget *buildBottomTrim( QWidget* parent );
00379 virtual QWidget *buildRightTrim( QWidget* parent );
00380 virtual QWidget *buildZoomSlider( QWidget* parent );
00381 QWidget *buildAppButtons( QWidget* parent );
00382 QWidget *buildViewerButtons( QWidget* parent );
00383 virtual void createViewerButtons( QWidget* parent );
00384
00385
00386
00387
00388 virtual void buildPopupMenu();
00389
00390 virtual void destroyPopupMenu();
00391 void setPopupMenuString( const QString& name );
00392 QWidget* buildFunctionsSubmenu( QWidget* popup );
00393 QWidget* buildDrawStyleSubmenu( QWidget* popup );
00394
00395
00396 virtual void displayPopupMenu( QPoint point );
00397
00398
00399
00400
00401 virtual void rightWheelMotion( float f );
00402 virtual void bottomWheelMotion( float f);
00403 virtual void leftWheelMotion( float f );
00404
00405
00406
00407
00408 virtual void rightWheelStart();
00409 virtual void bottomWheelStart();
00410 virtual void leftWheelStart();
00411 virtual void rightWheelFinish();
00412 virtual void bottomWheelFinish();
00413 virtual void leftWheelFinish();
00414
00415
00416
00417
00418 void setBottomWheelString( const QString& name );
00419 void setLeftWheelString( const QString& name );
00420 void setRightWheelString( const QString& name );
00421
00422
00423
00424
00425
00426 virtual void openViewerHelpCard();
00427
00428
00429 virtual void afterRealizeHook();
00430
00431 private:
00432 QPointer<QWidget> appButtonForm;
00433
00434 int SO_WHEEL_DELTA;
00435
00436 virtual void setSeekButton( SbBool onOff );
00437
00438 private:
00439 void constructorCommon( SoQtFullViewer::BuildFlag buildFlag, SbBool buildNow );
00440
00441 SoGuiFullViewer* m_guiFullViewer;
00442
00443 SbBool firstBuild;
00444 SbBool m_seekState;
00445
00446
00447 SbPList* appButtonList;
00448 void doAppButtonLayout( int start, SoQtButton* newButton );
00449
00450 SoStereoDialog *stereoDialogBox;
00451 SoRecordDialog* m_recordDialogBox;
00452
00453
00454 SbVec2f zoomSldRange;
00455 void setCameraZoom( float zoom );
00456 float getCameraZoom();
00457 void setZoomSliderPosition( float zoom );
00458 void setZoomFieldString( float zoom );
00459
00460 static void zoomSensorCB( void* d, SoSensor* s );
00461
00462
00463 SoQtButton* buttonList[10];
00464
00465
00466 QWidget* prefSheetShellWidget;
00467 char* prefSheetStr;
00468
00469
00470 int seekDistWheelVal;
00471 QWidget* seekDistField;
00472
00473
00474 QWidget* clipWheelForm;
00475 int clipNearWheelVal, clipFarWheelVal;
00476 QWidget* clipNearField, clipFarField;
00477
00478
00479 QWidget* stereoWheelForm, stereoField, stereoLabel;
00480 int stereoWheelVal;
00481
00482 void UPDATE_CHECKMARK( QAction* curItem, QAction* item );
00483
00484 QVBoxLayout* mgrVbl;
00485
00486 private:
00487
00488
00489 QPixmap IDB_PUSH_PICK;
00490 QPixmap IDB_PUSH_VIEW;
00491 QPixmap IDB_PUSH_HELP;
00492 QPixmap IDB_PUSH_HOME;
00493 QPixmap IDB_PUSH_SETHOME;
00494 QPixmap IDB_PUSH_VIEWALL;
00495 QPixmap IDB_PUSH_SEEK;
00496 QPixmap IDB_PUSH_GRAYSEEK;
00497
00498
00499 QAction* IDM_DPOPUP_ASIS;
00500 QAction* IDM_DPOPUP_HLINE;
00501 QAction* IDM_DPOPUP_NOTEX;
00502 QAction* IDM_DPOPUP_LOWRES;
00503 QAction* IDM_DPOPUP_WIRE;
00504 QAction* IDM_DPOPUP_POINTS;
00505 QAction* IDM_DPOPUP_BBOX;
00506
00507 QAction* IDM_DPOPUP_MSAMEAS ;
00508 QAction* IDM_DPOPUP_MNOTEX;
00509 QAction* IDM_DPOPUP_MLOWRES;
00510 #ifdef _WIN32
00511 QAction* IDM_DPOPUP_MHLINE;
00512 #endif
00513 QAction* IDM_DPOPUP_MWIRE;
00514 QAction* IDM_DPOPUP_MPOINTS;
00515 QAction* IDM_DPOPUP_MBBOX;
00516
00517 QAction* IDM_DPOPUP_SBUFFER;
00518 QAction* IDM_DPOPUP_DBUFFER;
00519 QAction* IDM_DPOPUP_IBUFFER;
00520
00521 QAction* IDM_PPOPUP_SEEK;
00522 QAction* IDM_PPOPUP_CLIP;
00523 QAction* IDM_PPOPUP_SPIN;
00524 QAction* IDM_PPOPUP_INTERACTIVE;
00525 QAction* IDM_PPOPUP_AXES;
00526 QAction* IDM_PPOPUP_STEREO;
00527 QAction* IDM_PPOPUP_FSAA;
00528 QAction* IDM_PPOPUP_RECORD;
00529
00530 QAction* IDM_MPOPUP_DIRECTVIZ;
00531 QAction* IDM_MPOPUP_VIEWING;
00532 QAction* IDM_MPOPUP_DECORAT;
00533 QAction* IDM_MPOPUP_FULLSCREEN;
00534 QAction* IDM_MPOPUP_HLIGHT;
00535
00536 #ifndef HIDDEN_FROM_DOC
00537 protected Q_SLOTS:
00538
00542 void leftWheelDrag( int value );
00543 void leftWheelOther();
00544 void rightWheelDrag( int value );
00545 void rightWheelOther();
00546 void bottomWheelDrag( int value );
00547 void bottomWheelOther();
00548
00552 void slotPushPickButton();
00553 void slotPushViewButton();
00554 void slotPushHelpButton();
00555 void slotPushHomeButton();
00556 void slotPushSetHomeButton();
00557 void slotPushViewAllButton();
00558 void slotPushSeekButton();
00559
00560
00564 void slot_popup_home();
00565 void slot_popup_setHome();
00566 void slot_popup_viewAll();
00567 void slot_popup_seek();
00568
00569
00573 void slot_popup_seekToPoint();
00574 void slot_popup_clip();
00575 void slot_popup_interactive();
00576 void slot_popup_stereo();
00577 void slot_popup_fsaa();
00578 void slot_popup_recording();
00579
00580
00584 void slot_popup_viewing();
00585 void slot_popup_directViz();
00586 void slot_popup_decoration();
00587 void slot_popup_fullscreen();
00588 void slot_popup_headLight();
00589
00590
00594 void slot_popup_asIs();
00595 void slot_popup_hiddenLine();
00596 void slot_popup_noTexture();
00597 void slot_popup_lowResolution();
00598 void slot_popup_wireFrame();
00599 void slot_popup_points();
00600 void slot_popup_boundingBox();
00601 void slot_popup_moveSameAsStill();
00602 void slot_popup_moveNoTexture();
00603 void slot_popup_moveLowRes();
00604 void slot_popup_moveWireFrame();
00605 void slot_popup_movePoints();
00606 void slot_popup_moveBoundingBox();
00607 void slot_popup_singleBuffer();
00608 void slot_popup_doubleBuffer();
00609 void slot_popup_interactiveBuffer();
00610
00611 #endif // HIDDEN_FROM_DOC
00612
00613 private Q_SLOTS:
00614 void visibilityChangeCB( SbBool visible );
00615 void zoomSliderCB( int value );
00616 void textChangedSlot();
00617 void setNum( int value );
00618 void slot_internalStereoDialogDestroyed();
00619 void slot_externalStereoDialogDestroyed();
00620 void slot_internalRecordDialogDestroyed();
00621 };
00622
00623 #endif
00624
00625
00626