Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoWinWalkViewer.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-2020 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_WALK_VIEWER_
27#define _SO_WIN_WALK_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/SoGuiWalkViewer.h>
36
37class SoFieldSensor;
38
95{
96 public:
97
106 SoWinWalkViewer( SoWidget parent = NULL,
107 const char* name = NULL,
108 SbBool buildInsideParent = TRUE,
115
116 //
117 // redefine these to add Walk viewer functionality
118 //
119 virtual void setViewing( SbBool onOrOff );
120 virtual void setCamera( SoCamera* cam );
121 virtual void setCursorEnabled( SbBool onOrOff );
122
123 // This is redefined to prevent the camera type from being changed
124 virtual void setCameraType( SoType type );
125
129 void setViewerSpeed( float speed ) { m_guiWalkViewer->setViewerSpeed( speed ); }
130
134 float getViewerSpeed() const { return m_guiWalkViewer->getViewerSpeed(); }
135
136 virtual void setSeekMode( SbBool onOrOff );
137
138 private:
139
140 SoGuiWalkViewer* getGuiWalkViewer() const;
141
142 private:
143
144 // This constructor takes a boolean whether to build the widget now.
145 // Subclasses can pass FALSE, then call SoWinWalkViewer::buildWidget()
146 // when they are ready for it to be built.
147 SoEXTENDER SoWinWalkViewer( SoWidget parent,
148 const char* name,
149 SbBool buildInsideParent,
151 SoWinViewer::Type type,
152 SbBool buildNow );
153
154 // redefine these
155 virtual SbString getDefaultWidgetName() const;
156 virtual SbString getDefaultTitle() const;
157 virtual SbString getDefaultIconTitle() const;
158
159 // redefine those routines to do viewer specific stuff
160 virtual void processEvent( XAnyEvent* anyevent );
161 virtual void actualRedraw();
162 virtual void rightWheelMotion( float newVal );
163 virtual void mouseWheelMotion( float newVal );
164 virtual void dollyCamera( float dist );
165
166 // redefine this to add the extra thumbwheel on the left side
167 virtual SoWidget buildLeftTrim( SoWidget parent );
168
169 // add viewer preference stuff
170 virtual void createPrefSheet();
171
172 // Define this to bring the viewer help card
173 virtual void openViewerHelpCard();
174
175 virtual void updateCursor();
176
177 private:
178 SoGuiWalkViewer* m_guiWalkViewer;
179
180 // viewer state variables
181 Cursor tiltCursor;
182
183 // extra decoration vars
184 int heightWheelVal;
185
186 static void heightWheelCB( SoWinWalkViewer* p, XtPointer* d );
187
188 void updateViewerMode( unsigned int state );
189 void switchMode( int newMode );
190
191 // this is called by both constructors
192 void constructorCommon( SbBool buildNow );
193
194 // Utility function called from processEvent
195 void processPopupItem( int item );
196};
197
198#include <Inventor/Win/SoWinEndStrict.h>
199
200#endif /* _SO_WIN_WALK_VIEWER_ */
201
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...
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.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Viewer component...
SoWinWalkViewer(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.
~SoWinWalkViewer()
Destructor.
void setViewerSpeed(float speed)
Set viewer speed multiplier (default is 1).
virtual void setCursorEnabled(SbBool onOrOff)
Sets whether the viewer is allowed to change the cursor over the renderArea window.
virtual void setViewing(SbBool onOrOff)
Sets whether the viewer is turned on or off.
float getViewerSpeed() const
Get viewer 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...
virtual void setCamera(SoCamera *cam)
Sets the camera that will be controlled by the viewer.
virtual void setSeekMode(SbBool onOrOff)
Externally set the viewer into/out off seek mode (default OFF).
int SbBool
Boolean type.
Definition SbBase.h:87
void * XtPointer
Definition SoQtDef.h:122