Open Inventor Release 2024.1.1
 
Loading...
Searching...
No Matches
SoWinFlyViewer.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 : VSG (MMM YYYY)
22**=======================================================================*/
23
24
25
26#ifndef _SO_WIN_FLY_VIEWER_
27#define _SO_WIN_FLY_VIEWER_
28
29#include <Inventor/Win/SoWinBeginStrict.h>
30
31#include <Inventor/Win/viewers/SoWinConstrainedViewer.h>
32#include <Inventor/SbLinear.h>
33#include <Inventor/SbTime.h>
34
35#include <Inventor/Gui/viewers/SoGuiFlyViewer.h>
36class SoFieldSensor;
37
91{
92 public:
93
102 SoWinFlyViewer( SoWidget parent = NULL,
103 const char* name = NULL,
104 SbBool buildInsideParent = TRUE,
111
112 //
113 // redefine these to add fly viewer functionality
114 //
115 virtual void setViewing( SbBool onOrOff );
116 virtual void resetToHomePosition();
117 virtual void setCamera( SoCamera* cam );
118 virtual void setCursorEnabled( SbBool onOrOff );
119 virtual void setSeekMode( SbBool onOrOff );
120
121 // This is redefined to prevent the camera type from being changed
122 virtual void setCameraType( SoType type );
123
124 // set/get minimum speed in word coodinate / second
125 // default value is 0, meaning the minimum speed is computed according to scene graph extent
126 void setMinSpeed( float speed );
127 float getMinSpeed();
128
129 // set/get speed multiplier. default value is 1.5
130 void setSpeedMultiplier( float speedInc );
132
133 private:
134
135 SoGuiFlyViewer* getGuiFlyViewer() const;
136
137 private:
138
139 // This constructor takes a boolean whether to build the widget now.
140 // Subclasses can pass FALSE, then call SoWinFlyViewer::buildWidget()
141 // when they are ready for it to be built.
142 SoEXTENDER SoWinFlyViewer( SoWidget parent,
143 const char* name,
144 SbBool buildInsideParent,
146 SoWinViewer::Type type,
147 SbBool buildNow,
148 SbBool sync = TRUE );
149
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( XAnyEvent* anyevent );
157 virtual void actualRedraw();
158 virtual void rightWheelMotion( float newVal);
159 virtual void mouseWheelMotion( float newVal );
160
161 // add viewer preference stuff
162 virtual void createPrefSheet();
163
164 // Define this to bring the viewer help card
165 virtual void openViewerHelpCard();
166
167 private:
168
169 SoGuiFlyViewer* m_guiFlyViewer;
170
171 // viewer state variables
172 SbRotation camStartOrientation;
173
174 void switchMode( int newMode );
175 void changeMaxStraightSpeed( SbBool increase );
176
177 // this is called by both constructors
178 void constructorCommon( SbBool buildNow );
179
180 // Utility function called from processEvent
181 void processPopupItem( int item );
182};
183
184#include <Inventor/Win/SoWinEndStrict.h>
185
186#endif /* _SO_WIN_FLY_VIEWER_ */
187
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.
Stores runtime type information.
Definition SoType.h:98
<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 setSeekMode(SbBool onOrOff)
Externally set the viewer into/out off seek mode (default OFF).
void setSpeedMultiplier(float speedInc)
virtual void setViewing(SbBool onOrOff)
Sets whether the viewer is turned on or off.
~SoWinFlyViewer()
Destructor.
virtual void resetToHomePosition()
Restores the camera values.
float getSpeedMultiplier()
virtual void setCamera(SoCamera *cam)
Sets the camera that will be controlled by the viewer.
float getMinSpeed()
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...
virtual void setCursorEnabled(SbBool onOrOff)
Sets whether the viewer is allowed to change the cursor over the renderArea window.
void setMinSpeed(float speed)
SoWinFlyViewer(SoWidget parent=NULL, const char *name=NULL, SbBool buildInsideParent=TRUE, SoWinFullViewer::BuildFlag flag=SoWinFullViewer::BUILD_ALL, SoWinViewer::Type type=SoWinViewer::BROWSER)
Constructor which specifies the viewer type.
BuildFlag
This specifies what should be build by default in the constructor.
@ BUILD_ALL
Build everything by default.
Type
An EDITOR viewer will create a camera under the user supplied scene graph (specified in setSceneGraph...
@ BROWSER
Camera views scene, but is not added to scene.
int SbBool
Boolean type.
Definition SbBase.h:87