Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoGuiExaminerViewer.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-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : T.MEHAMLI (Jun 2007)
22**=======================================================================*/
23
24#ifndef SO_GUI_EXAMINER_VIEWER
25#define SO_GUI_EXAMINER_VIEWER
26
28//
29// Class: SoGuiViewer
30//
31// SoXXExaminerViewer implementation class
32//
33//
35
36#include <Inventor/Gui/viewers/SoGuiAlgoViewers.h>
37
38// classes used
40class SoSeparator;
41class SoSwitch;
42class SoTranslation;
43class SoScale;
44
45class SbTime;
46
47
49{
50#ifndef HIDDEN_FROM_DOC
51 SO_FIELDCONTAINER_HEADER( SoGuiExaminerViewer );
52#endif
53
54private:
55
56 //Macros
57#define KEY_PRESS_CHECK_VALID_MACRO \
58 if ( m_mode != IDLE_MODE && m_mode != SPIN_MODE && \
59 m_mode != TRANS_MODE && m_mode != DOLLY_MODE ) \
60 break;
61
62// size of the rotation buffer, which is used to animate the spinning ball.
63#define ROT_BUFF_SIZE 3
64
68 enum ViewingMode
69 {
73 VIEWING_MODE_SPIN,
74
83 VIEWING_MODE_SPIN_CONSTRAINED,
84
88 VIEWING_MODE_PAN,
89
94 VIEWING_MODE_ZOOM
95 };
96
97 enum ViewerModes
98 {
99 PICK_MODE, // Alt key can take us out of viewing mode
100 VIEW_MODE, // Equivalent to old IDLE_MODE
101 SPIN_MODE = VIEW_MODE,
102 SPIN_MODE_ACTIVE, // Equivalent to old SPIN_MODE
103 SPINX_MODE_ACTIVE, // Rotation on X axis.
104 SPINY_MODE_ACTIVE, // Rotation on Y axis.
105 SPINZ_MODE_ACTIVE, // Rotation on Z axis.
106 PAN_MODE, // Just Ctrl key pressed (similar to old ROLL_MODE)
107 PAN_MODE_ACTIVE, // Equivalent to old TRANS_MODE
108 DOLLY_MODE, //
109 DOLLY_MODE_ACTIVE, // Equivalent to old DOLLY_MODE
110 SEEK_MODE,
111 SPINX_VIEWER_MODE_ACTIVE, // Rotation on X viewer axis.
112 SPINY_VIEWER_MODE_ACTIVE, // Rotation on Y viewer axis.
113 SPINZ_VIEWER_MODE_ACTIVE, // Rotation on Z viewer axis.
114 REVERSE_DOLLY_MODE_ACTIVE, // A reversed DOLLY MODE
115 ROLL_MODE,
116 ROLL_MODE_ACTIVE, // Rotation centered around an anchor.
117 EMPTY_MODE = -1
118 };
119
120 // list of custom push buttons
121 enum
122 {
123 CAM_PUSH = 0,
124 PUSH_NUM
125 };
126
127 // Defines the spining type
128 enum ViewingSpinType
129 {
130 VIEWING_SPIN_FREE,
131 VIEWING_SPIN_X_OR_Y, // Means that the spin is either on the X or on the Y axis
132 VIEWING_SPIN_X,
133 VIEWING_SPIN_Y,
134 VIEWING_SPIN_Z
135 };
136
141
147 void setViewingMode( ViewingMode viewingMode );
148
152 ViewingMode getViewingMode() const;
153
158 void setFeedbackVisibility( SbBool insertFlag );
159
160 void setFeedbackFlag( SbBool flag );
161
165 SbBool isFeedbackVisible() const;
166
170 void setFeedbackSize( int newSize );
171
175 int getFeedbackSize() const;
176
184 void setAnimationEnabled( SbBool flag );
185
189 SbBool isAnimationEnabled();
190
191 void setAnimatingFlag( SbBool flag );
192
196 SbBool isAnimating();
197
198 //Accessor for the member m_feedbackSwitch
199 SoSwitch* getFeedbackSwitch() const;
200
201 // ----------------------- Extension usage -----------------------------------
202
203 // redefine those routines to do viewer specific stuff
204 virtual void actualRedraw();
205
206 virtual void setCursorEnabled( SbBool onOrOff );
207 virtual void setSeekMode( SbBool onOrOff );
208
209private:
210
214 virtual ~SoGuiExaminerViewer();
215
216// ----------------------- Private usage -------------------------------------
217private:
218
219 void createFeedbackNodes();
220
221 // Viewer state variables
222 ViewingMode m_viewingMode;
223 int m_viewerMode;
224
225 // point of rotation feedback vars
226 SbBool m_feedbackFlag;
227 SoSeparator* m_feedbackRoot;
228 SoSwitch* m_feedbackSwitch;
229 SoTranslation* m_feedbackTransNode;
230 SoScale* m_feedbackScaleNode;
231 float m_feedbackSize;
232 static char* m_geometryBuffer;
233
234 // variables used for spinning animation
235 SbBool m_animationEnabled, m_animatingFlag;
236};
237
238#endif // SO_GUI_EXAMINER_VIEWER
239
240
Sphere-sheet projector.
Class for representation of a time.
Definition SbTime.h:91
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Common algorithm...
Node representing a 3D geometric scaling.
Definition SoScale.h:96
Group node that saves and restores traversal state.
Group node that traverses one chosen child.
Definition SoSwitch.h:179
Node representing a 3D translation.
int SbBool
Boolean type.
Definition SbBase.h:87