Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoXtPlaneViewer.h
1/*=======================================================================
2 * Copyright 1991-1996, Silicon Graphics, Inc.
3 * ALL RIGHTS RESERVED
4 *
5 * UNPUBLISHED -- Rights reserved under the copyright laws of the United
6 * States. Use of a copyright notice is precautionary only and does not
7 * imply publication or disclosure.
8 *
9 * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
10 * Use, duplication or disclosure by the Government is subject to restrictions
11 * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
12 * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
13 * in similar or successor clauses in the FAR, or the DOD or NASA FAR
14 * Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
15 * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
16 *
17 * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
18 * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
19 * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
20 * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
21 * GRAPHICS, INC.
22**=======================================================================*/
23/*=======================================================================
24** Author : Alain Dumesny (MMM yyyy)
25**=======================================================================*/
26/*=======================================================================
27 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
28 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
29 *** ***
30 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
31 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
32 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
33 *** ***
34 *** RESTRICTED RIGHTS LEGEND ***
35 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
36 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
37 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
38 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
39 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
40 *** ***
41 *** COPYRIGHT (C) 1996-2020 BY FEI S.A.S, ***
42 *** BORDEAUX, FRANCE ***
43 *** ALL RIGHTS RESERVED ***
44**=======================================================================*/
45/*=======================================================================
46** Modified by : VSG (MMM YYYY)
47**=======================================================================*/
48
49
50#ifdef SOQT
51# include <Inventor/Qt/viewers/SoQtPlaneViewer.h>
52#elif defined _WIN32
53# include <Inventor/Win/viewers/SoWinPlaneViewer.h>
54#else // _WIN32
55
56#ifndef _SO_XT_PLANE_VIEWER_
57#define _SO_XT_PLANE_VIEWER_
58
59#include <Inventor/Xt/viewers/SoXtFullViewer.h>
60#include <Inventor/SbLinear.h>
61
62#include <Inventor/Gui/viewers/SoGuiPlaneViewer.h>
63
64class SoXtBitmapButton;
65
66
68//
69// Class: SoXtPlaneViewer
70//
71// Plane Viewer - allows the user to move the camera in a plane, zoom in
72// and out, as well as rotate the viewing plane.
73//
74// Keys used by this viewer:
75// -------------------------
76//
77// Left Mouse: Dolly in and out (gets closer to and further away from the
78// object).
79//
80// Middle Mouse:
81// Ctrl + Left Mouse: Translate up, down, left and right.
82//
83// Ctrl + Middle Mouse: Used for roll action (rotates around the viewer
84// forward direction).
85//
86// <s> + click: Alternative to the Seek button. Press (but do not hold down)
87// the <s> key, then click on a target object.
88//
89// Right Mouse: Open the popup menu.
90//
92
169{
170 public:
175 SoXtPlaneViewer( SoWidget parent = NULL,
176 const char* name = NULL,
177 SbBool buildInsideParent = TRUE,
178 SoXtFullViewer::BuildFlag flag = SoXtFullViewer::BUILD_ALL,
179 SoXtViewer::Type type = SoXtViewer::BROWSER );
184
188 void setPlane( const SbVec3f& newNormal, const SbVec3f& newRight );
189
190 // redefine these to add Plane viewer functionality
191 virtual void setViewing( SbBool onOrOff );
192 virtual void setCamera( SoCamera* cam );
193 virtual void setCursorEnabled( SbBool onOrOff );
194 virtual void setSeekMode( SbBool onOrOff );
195
196 private:
197 SoGuiPlaneViewer* getGuiPlaneViewer() const;
198
199 // This constructor takes a boolean whether to build the widget now.
200 // Subclasses can pass FALSE, then call SoXtPlaneViewer::buildWidget()
201 // when they are ready for it to be built.
202 private:
203 SoXtPlaneViewer( SoWidget parent,
204 const char* name,
205 SbBool buildInsideParent,
206 SoXtFullViewer::BuildFlag flag,
207 SoXtViewer::Type type,
208 SbBool buildNow,
209 SbBool sync = TRUE );
210 private:
211
212 SoWidget buildWidget( SoWidget parent );
213
214 // redefine these
215 virtual SbString getDefaultWidgetName() const;
216 virtual SbString getDefaultTitle() const;
217 virtual SbString getDefaultIconTitle() const;
218
219 // redefine those routines to do viewer specific stuff
220 virtual void processEvent( XAnyEvent* anyevent );
221 virtual void actualRedraw();
222
223 // Define those thumb wheels to translate in the viewer plane
224 virtual void bottomWheelMotion( float newVal );
225 virtual void leftWheelMotion( float newVal );
226 virtual void rightWheelMotion( float newVal );
227
228 // add viewer preference stuff
229 virtual void createPrefSheet();
230
231 // add some viewer buttons
232 virtual void createViewerButtons( SoWidget parent );
233
234 // Define this to bring the viewer help card
235 virtual void openViewerHelpCard();
236
237 // Redefine this to keep the same camera rotation when seeking
238 virtual void computeSeekFinalOrientation();
239
240 virtual void updateCursor();
241
242 private:
243 // viewer state variables
244 Cursor transCursor, dollyCursor, seekCursor;
245
246 // push button vars and callbacks
247 SoXtBitmapButton* buttonList[10];
248 static void pushButtonCB( SoWidget w, int id, void* data );
249
250 void updateViewerMode( unsigned int state );
251 void switchMode( int newMode );
252 void defineCursors();
253
254 // this is called by both constructors
255 void constructorCommon( SbBool buildNow );
256
257 SoGuiPlaneViewer* m_guiPlaneViewer; // Implementation class for SoXxPlaneViewer
258};
259
260#endif /* _SO_XT_PLANE_VIEWER_ */
261
262#endif // _WIN32
263
264
Class for smart character strings.
Definition SbString.h:202
3D vector class.
Definition SbVec.h:932
Abstract base class for camera nodes.
Definition SoCamera.h:188
Base viewer class which adds a decoration around the rendering area.
Viewer component which moves the camera in a plane.
void setPlane(const SbVec3f &newNormal, const SbVec3f &newRight)
Moves the camera to be aligned with the given plane.
virtual void setViewing(SbBool onOrOff)
Sets whether the viewer is turned on or off.
SoXtPlaneViewer(SoWidget parent=NULL, const char *name=NULL, SbBool buildInsideParent=TRUE, SoXtFullViewer::BuildFlag flag=SoXtFullViewer::BUILD_ALL, SoXtViewer::Type type=SoXtViewer::BROWSER)
Constructor which specifies the viewer type.
~SoXtPlaneViewer()
Destructor.
virtual void setCamera(SoCamera *cam)
Sets the edited camera.
virtual void setCursorEnabled(SbBool onOrOff)
Sets whether the viewer is allowed to change the cursor over the renderArea window.
virtual void setSeekMode(SbBool onOrOff)
Externally set the viewer into/out off seek mode (default OFF).
int SbBool
Boolean type.
Definition SbBase.h:87