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_WALK_VIEWER_
00026 #define _SO_QT_WALK_VIEWER_
00027 #include <Inventor/Qt/OivQtCompat.h>
00028 #include <Inventor/Qt/viewers/SoQtConstrainedViewer.h>
00029 #include <Inventor/SbLinear.h>
00030 #include <Inventor/SbTime.h>
00031
00032 #include <Inventor/Gui/viewers/SoGuiWalkViewer.h>
00033
00034 class SoFieldSensor;
00035
00088 class SoQtWalkViewer : public SoQtConstrainedViewer
00089 {
00090
00091 Q_OBJECT
00092
00093 public:
00094
00103 SoQtWalkViewer( QWidget* parent = NULL,
00104 const char* name = NULL,
00105 SbBool buildInsideParent = TRUE,
00106 SoQtFullViewer::BuildFlag flag = SoQtFullViewer::BUILD_ALL,
00107 SoQtViewer::Type type = SoQtViewer::BROWSER );
00111 ~SoQtWalkViewer();
00112
00113
00114
00115
00116 virtual void setViewing( SbBool onOrOff );
00117 virtual void setCamera( SoCamera* cam );
00118 virtual void setCursorEnabled( SbBool onOrOff );
00119 virtual void setSeekMode( SbBool onOrOff );
00120
00121
00122 virtual void setCameraType(SoType type);
00123
00127 void setViewerSpeed( float speed ) { m_guiWalkViewer->setViewerSpeed( speed ); }
00131 float getViewerSpeed() const { return m_guiWalkViewer->getViewerSpeed(); }
00132
00133
00134
00135
00136
00137 private:
00138 SoQtWalkViewer( QWidget* parent,
00139 const char* name,
00140 SbBool buildInsideParent,
00141 SoQtFullViewer::BuildFlag flag,
00142 SoQtViewer::Type type,
00143 SbBool buildNow,
00144 SbBool sync );
00145
00146 private:
00147
00148 SoGuiWalkViewer* getGuiWalkViewer() const;
00149
00150 private:
00151
00152 virtual SbString getDefaultWidgetName() const;
00153 virtual SbString getDefaultTitle() const;
00154 virtual SbString getDefaultIconTitle() const;
00155
00156
00157 virtual void processEvent( QEvent* anyevent );
00158 virtual void actualRedraw();
00159 virtual void rightWheelMotion( float newVal );
00160 virtual void mouseWheelMotion( float newVal );
00161 virtual void dollyCamera( float dist );
00162
00163
00164 virtual QWidget* buildLeftTrim( QWidget* parent );
00165
00166
00167 virtual void createPrefSheet();
00168
00169
00170 virtual void openViewerHelpCard();
00171
00172 virtual void updateCursor();
00173
00174 private:
00175
00176 SoGuiWalkViewer* m_guiWalkViewer;
00177
00178 QCursor tiltCursor;
00179
00180
00181 int heightWheelVal;
00182
00183 void updateViewerMode( unsigned int state );
00184 void switchMode( int newMode );
00185
00186
00187 void constructorCommon( SbBool buildNow );
00188
00189 protected Q_SLOTS:
00190 #ifndef HIDDEN_FROM_DOC
00191 void extraWheelDrag( int value );
00192 void extraWheelOther(void);
00193 #endif //HIDDEN_FROM_DOC
00194 };
00195
00196 #endif
00197
00198