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