Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoQtFlyViewer.h
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-2023 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_FLY_VIEWER_
26#define _SO_QT_FLY_VIEWER_
27#include <Inventor/Qt/OivQtCompat.h>
28#include <Inventor/Qt/viewers/SoQtConstrainedViewer.h>
29#include <Inventor/SbLinear.h>
30#include <Inventor/SbTime.h>
31
32#include <Inventor/Gui/viewers/SoGuiFlyViewer.h>
33
34class SoFieldSensor;
35
89{
90
91 Q_OBJECT
92
93 public:
94
103 SoQtFlyViewer( QWidget* parent = NULL,
104 const char* name = NULL,
105 SbBool buildInsideParent = TRUE,
112
113 // redefine these to add fly viewer functionality
114 virtual void setViewing( SbBool onOrOff );
115 virtual void resetToHomePosition();
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
127 void setMinSpeed( float speed );
128
132 float getMinSpeed();
133
137 void setSpeedMultiplier( float speedInc );
138
143
144 // This constructor takes a boolean whether to build the widget now.
145 // Subclasses can pass FALSE, then call SoQtFlyViewer::buildWidget()
146 // when they are ready for it to be built.
147 private:
148
149 SoQtFlyViewer( QWidget* parent,
150 const char* name,
151 SbBool buildInsideParent,
153 SoQtViewer::Type type,
154 SbBool buildNow,
155 SbBool sync = true );
156
157 private:
158
159 SoGuiFlyViewer* getGuiFlyViewer() const;
160
161private:
162
163 // redefine these
164 virtual SbString getDefaultWidgetName() const;
165 virtual SbString getDefaultTitle() const;
166 virtual SbString getDefaultIconTitle() const;
167
168 // redefine those routines to do viewer specific stuff
169 virtual void processEvent( QEvent* anyevent );
170 virtual void actualRedraw();
171 virtual void rightWheelMotion( float newVal);
172 virtual void mouseWheelMotion( float newVal );
173
174 // add viewer preference stuff
175 virtual void createPrefSheet();
176
177 // Define this to bring the viewer help card
178 virtual void openViewerHelpCard();
179
180private:
181
182 SoGuiFlyViewer* m_guiFlyViewer;
183
184 // viewer state variables
185 SbRotation camStartOrientation;
186
187 void switchMode( int newMode );
188 void changeMaxStraightSpeed( SbBool increase );
189
190 // this is called by both constructors
191 void constructorCommon( SbBool buildNow );
192};
193
194#endif /* _SO_QT_FLY_VIEWER_ */
195
Class for representing a rotation.
Definition SbRotation.h:126
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...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Viewer component...
virtual void setCursorEnabled(SbBool onOrOff)
Sets whether the viewer is allowed to change the cursor over the renderArea window.
virtual void resetToHomePosition()
Restores the camera values.
void setSpeedMultiplier(float speedInc)
Sets the speed multiplier.
~SoQtFlyViewer()
Destructor.
float getSpeedMultiplier()
Returns the speed multiplier.
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...
void setMinSpeed(float speed)
Sets the minimum speed in world coodinate / second.
virtual void setCamera(SoCamera *cam)
Sets the edited camera.
float getMinSpeed()
Returns the minimum speed.
SoQtFlyViewer(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 setViewing(SbBool onOrOff)
Sets whether the viewer is turned on or off.
virtual void setSeekMode(SbBool onOrOff)
Set the viewer into/out of seek mode (default OFF).
BuildFlag
Build flags.
@ BUILD_ALL
Build everything by default.
Type
Editor types.
Definition SoQtViewer.h:194
@ BROWSER
Camera views scene, but is not added to scene.
Definition SoQtViewer.h:198
Stores runtime type information.
Definition SoType.h:98
int SbBool
Boolean type.
Definition SbBase.h:87