Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SoQtWalkViewer.h
Go to the documentation of this file.
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2020 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : Alain Dumesny (MMM yyyy)
22**=======================================================================*/
23
24
25#ifndef _SO_QT_WALK_VIEWER_
26#define _SO_QT_WALK_VIEWER_
29#include <Inventor/SbLinear.h>
30#include <Inventor/SbTime.h>
31
33
34class SoFieldSensor;
35
88{
89
90 Q_OBJECT
91
92 public:
93
102 SoQtWalkViewer( QWidget* parent = NULL,
103 const char* name = NULL,
104 SbBool buildInsideParent = TRUE,
111
112 //
113 // redefine these to add Walk viewer functionality
114 //
115 virtual void setViewing( SbBool onOrOff );
116 virtual void setCamera( SoCamera* cam );
117 virtual void setCursorEnabled( SbBool onOrOff );
118 virtual void setSeekMode( SbBool onOrOff );
119
120 // This is redefined to prevent the camera type from being changed
121 virtual void setCameraType(SoType type);
122
126 void setViewerSpeed( float speed ) { m_guiWalkViewer->setViewerSpeed( speed ); }
130 float getViewerSpeed() const { return m_guiWalkViewer->getViewerSpeed(); }
131
132
133 // This constructor takes a boolean whether to build the widget now.
134 // Subclasses can pass FALSE, then call SoQtWalkViewer::buildWidget()
135 // when they are ready for it to be built.
136 private:
137 SoQtWalkViewer( QWidget* parent,
138 const char* name,
139 SbBool buildInsideParent,
141 SoQtViewer::Type type,
142 SbBool buildNow,
143 SbBool sync );
144
145 private:
146
147 SoGuiWalkViewer* getGuiWalkViewer() const;
148
149 private:
150 // redefine these
151 virtual SbString getDefaultWidgetName() const;
152 virtual SbString getDefaultTitle() const;
153 virtual SbString getDefaultIconTitle() const;
154
155 // redefine those routines to do viewer specific stuff
156 virtual void processEvent( QEvent* anyevent );
157 virtual void actualRedraw();
158 virtual void rightWheelMotion( float newVal );
159 virtual void mouseWheelMotion( float newVal );
160 virtual void dollyCamera( float dist );
161
162 // redefine this to add the extra thumbwheel on the left side
163 virtual QWidget* buildLeftTrim( QWidget* parent );
164
165 // add viewer preference stuff
166 virtual void createPrefSheet();
167
168 // Define this to bring the viewer help card
169 virtual void openViewerHelpCard();
170
171 virtual void updateCursor();
172
173private:
174
175 SoGuiWalkViewer* m_guiWalkViewer;
176 // viewer state variables
177 QCursor tiltCursor;
178
179 // extra decoration vars
180 int heightWheelVal;
181
182 void updateViewerMode( unsigned int state );
183 void switchMode( int newMode );
184
185 // this is called by both constructors
186 void constructorCommon( SbBool buildNow );
187
188protected Q_SLOTS:
189#ifndef HIDDEN_FROM_DOC
190 void extraWheelDrag( int value );
191 void extraWheelOther(void);
192#endif //HIDDEN_FROM_DOC
193};
194
195#endif /* _SO_QT_WALK_VIEWER_ */
196
#define TRUE
Possible value of SbBool.
Definition SbBase.h:77
Class for smart character strings.
Definition SbString.h:202
Abstract base class for camera nodes.
Definition SoCamera.h:188
Sensor class that can be attached to Open Inventor fields.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Base viewer clas...
BuildFlag
Build flags.
@ BUILD_ALL
Build everything by default.
Type
Editor types.
Definition SoQtViewer.h:186
@ BROWSER
Camera views scene, but is not added to scene.
Definition SoQtViewer.h:190
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Viewer component...
~SoQtWalkViewer()
Destructor.
virtual void setViewing(SbBool onOrOff)
Sets whether the viewer is turned on or off.
virtual void setCursorEnabled(SbBool onOrOff)
Sets whether the viewer is allowed to change the cursor over the renderArea window.
SoQtWalkViewer(QWidget *parent=NULL, const char *name=NULL, SbBool buildInsideParent=TRUE, SoQtFullViewer::BuildFlag flag=SoQtFullViewer::BUILD_ALL, SoQtViewer::Type type=SoQtViewer::BROWSER)
Constructor which specifies the viewer type.
virtual void setCamera(SoCamera *cam)
Sets the edited camera.
virtual void setCameraType(SoType type)
Sets the camera type that will be created by the viewer if no cameras are found in the scene graph (s...
float getViewerSpeed() const
Get viewer speed multiplier.
virtual void setSeekMode(SbBool onOrOff)
Set the viewer into/out of seek mode (default OFF).
void setViewerSpeed(float speed)
Set viewer speed multiplier (default is 1).
Stores runtime type information.
Definition SoType.h:98
int SbBool
Boolean type.
Definition SbBase.h:87