Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoWinViewer.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-2024 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23
24
25#ifndef _SO_WIN_VIEWER_
26#define _SO_WIN_VIEWER_
27
28#include <Inventor/Win/SoWinBeginStrict.h>
29
30#include <Inventor/SoType.h>
31#include <Inventor/Win/SoWinRenderArea.h>
32#include <Inventor/misc/SoCallbackList.h>
33#include <Inventor/SbElapsedTime.h>
34#include <Inventor/events/SoKeyboardEvent.h>
35#include <Inventor/Gui/viewers/SoGuiViewer.h>
36
37#include <Inventor/components/stereo/SoStereoViewer.h>
38
39// classes
40class SoFieldSensor;
41class SoNode;
43class SoGroup;
44class SoRotation;
45class SoCamera;
46class SoDrawStyle;
47class SoLightModel;
48class SoTimerSensor;
49class SoWinClipboard;
50class SoWinViewer;
52class SbPList;
53class SoSeparator;
54class SoSwitch;
55class SoComplexity;
56class SoPackedColor;
58class SoBaseColor;
59class SoSFTime;
60class SoAlarmSensor;
61class SoNodeSensor;
63class SoStereoViewer;
64class SoBaseStereo;
65
66class SoType;
67class SbEventWrapperList;
68
69class ScRayPickAction;
70
71// callback function prototypes
77typedef void SoWinViewerCB( void* userData, SoWinViewer* viewer );
83typedef void SoWinViewerCameraTypeChangeCB( void* userData, SoCamera* camera, SoWinViewer* viewer );
84
92typedef void SoWinViewerFPSCB( float fps, void* userData, SoWinViewer* viewer );
98typedef void SoWinViewerDecimationPercentageCB( float percentage, void* userData, SoWinViewer* viewer );
99
101//
102// Class: SoWinViewer
103//
104// The Viewer component is the abstract base class for all viewers.
105// It is subclassed from renderArea, adding viewing semantics to Inventor
106// rendering.
107//
109
181
182 public:
183
194 enum Type
195 {
203 EDITOR
204 };
205
213 {
254 };
267
268
285
286
307
328
337 virtual void setSceneGraph( SoNode* newScene );
338
343
344#ifndef HIDDEN_FROM_DOC
345 void saveSceneGraph( const char* fileName ) ;
346#endif //HIDDEN_FROM_DOC
347
353 virtual void setCamera(SoCamera *cam);
354
361 SoCamera* getCamera() { return m_guiViewer->getCamera(); }
362
371 virtual void setCameraType(SoType type);
372
377 SoType getCameraType() { return m_guiViewer->getCameraType(); }
378
385 { m_guiViewer->setPreserveCameraHeightAngle( flag ); }
386
393 { return m_guiViewer->isCameraHeightAnglePreserved(); }
394
399 virtual void enableSeekWithOrtho( SbBool flag ) { m_guiViewer->enableSeekWithOrtho( flag ); }
400
405 virtual SbBool isSeekWithOrthoEnabled() const { return m_guiViewer->isSeekWithOrthoEnabled(); }
406
425 virtual void viewAll();
426
430 virtual void saveHomePosition();
431
435 virtual void resetToHomePosition();
436
442
449 void setHeadlight( SbBool onOrOff );
450
454 SbBool isHeadlight() { return m_guiViewer->isHeadlight(); }
455
459 SoDirectionalLight* getHeadlight() { return m_guiViewer->getHeadlight(); }
460
510
515
521
526 { return (SoWinViewer::BufferType)m_guiViewer->getBufferingType(); }
527
540 virtual void setViewing( SbBool onOrOff );
541
545 SbBool isViewing() const { return m_guiViewer->isViewing(); }
546
555 virtual void setSeekMode(SbBool onOrOff);
556
561 SbBool isSeekMode() { return m_guiViewer->isSeekMode(); }
562
574 virtual void setCursorEnabled( SbBool onOrOff );
575
581 SbBool isCursorEnabled() const { return m_guiViewer->isCursorEnabled(); }
582
592 void setAutoClipping( SbBool onOrOff );
593
597 SbBool isAutoClipping() const { return m_guiViewer->isAutoClipping(); }
598
624 virtual void setStereoViewing( SbBool onOrOff );
625
631
635 void setStereoOffset( float dist );
636
641
649 void setDetailSeek( SbBool onOrOff ) { m_guiViewer->setDetailSeek( onOrOff ); }
650
654 SbBool isDetailSeek() { return m_guiViewer->isDetailSeek(); }
655
668 void setSeekTime( float seconds ) { m_guiViewer->setSeekTime( seconds ); }
669
673 float getSeekTime() { return m_guiViewer->getSeekTime(); }
674
684 void addStartCallback( SoWinViewerCB* f, void* userData = NULL )
685 { m_guiViewer->addStartCallback( (SoGuiViewerCB*)f, userData ); }
686
696 void addFinishCallback( SoWinViewerCB* f, void* userData = NULL )
697 { m_guiViewer->addFinishCallback( (SoGuiViewerCB*)f, userData ); }
698
705 void removeStartCallback( SoWinViewerCB* f, void* userData = NULL )
706 { m_guiViewer->removeStartCallback( (SoGuiViewerCB*)f, userData ); }
707
714 void removeFinishCallback( SoWinViewerCB *f, void* userData = NULL )
715 { m_guiViewer->removeFinishCallback( (SoGuiViewerCB*)f, userData ); }
716
722 void copyView( Time eventTime );
723
729 void pasteView( Time eventTime );
730
731 // redefine this routine to also correctly set the buffering type
732 // on the viewer.
733 virtual void setNormalVisual( XVisualInfo* i );
734
741 virtual void recomputeSceneSize();
742
743 // --- Large Model Viewing additions:
744
751
756 { return (SoWinViewer::DecimationStrategy)m_guiViewer->getDecimationStrategy(); }
757
765 void setGoalNumberOfTriangles(int32_t goal);
766
770 int32_t getGoalNumberOfTriangles() { return m_guiViewer->getGoalNumberOfTriangles(); }
771
779 void setGoalFramesPerSecond( float goal );
780
784 float getGoalFramesPerSecond() { return m_guiViewer->getGoalFramesPerSecond(); }
785
793 void setFixedPercentage( float percent );
794
798 float getFixedPercentage() { return m_guiViewer->getFixedPercentage(); }
799
809
814 SbBool isFullRenderingWhenStill() { return m_guiViewer->isFullRenderingWhenStill(); }
815
819 SbBool isStillNow() { return m_guiViewer->isStillNow(); }
820
824 void setFramesPerSecondCallback( SoWinViewerFPSCB* callback, void* userData = NULL );
825
830 void setNumSamples( int numFrames );
831
836 int getNumSamples() { return m_guiViewer->getNumSamples(); }
837
842 void* userData = NULL );
843
848
853 void enableMouseWheelDolly( SbBool onOff ) { m_guiViewer->enableMouseWheelDolly( onOff ); }
854
855
865 void setPickRadius( float radius );
866
870 float getPickRadius() const;
871
872public:
873
878
883
890 virtual void actualRendering();
891
896 virtual const SbVec2s& getSize();
897
905 virtual const SbVec2s& getTopLeft() ;
906
914 virtual const SbVec2s& getBottomRight() ;
915
923
928
932 void reverseStereoView( SbBool reverse );
933
938
942 virtual void setStereoAbsoluteAdjustments( SbBool absolute );
943
947 virtual SbBool isStereoAbsoluteAdjustments() const { return m_guiViewer->isStereoAbsoluteAdjustments(); }
948
953 virtual void setStereoBalance( float balance, SbBool nearFrac = false );
954
958 virtual float getStereoBalance();
959
965
970 virtual void setStereoActive( SbBool activate ) ;
971
976
980 void setViewport( short left, short bottom, short width, short height ) ;
981
985 void getViewport( short& left, short& bottom, short& width, short& height ) ;
986
1002
1007 { return (SoWinViewer::CursorStyle)m_guiViewer->getCursorStyle(); }
1008
1018 void setAutoClipTolerance ( float tolerance ) { m_guiViewer->setAutoClipTolerance( tolerance ); }
1019
1023 float getAutoClipTolerance () const { return m_guiViewer->getAutoClipTolerance(); }
1024
1049 virtual void setCameraSceneGraph( SoNode* cameraSceneGraph );
1050
1055
1065 virtual void toggleCameraType();
1066
1067#if 1 SoDEPRECATED
1074 virtual void adjustClippingPlanes();
1075
1076#endif
1084 SbBool getDepthValue(int x, int y, float &depth)
1085 {
1086 return m_guiViewer->getDepthValue(x, y, depth);
1087 }
1088
1089 private:
1090
1091 virtual ~SoWinViewer();
1092
1097 float getAntoClipTolerance() const { return m_guiViewer->getAutoClipTolerance(); }
1098
1099 SoSeparator* getSceneRoot() { return m_guiViewer->getSceneRoot(); }
1100
1101 virtual SbBool isInteractive() const;
1102
1103 SoGuiViewer* getGuiViewer() const;
1104
1105 // These members are public only for retro compatibility purposes.
1106 // They should not be called directly. Use their accessors instead.
1107 SoCamera* camera;
1108 SbBool createdCursors, viewingFlag;
1109 CursorStyle cursorStyle;
1110 SoSeparator* sceneRoot;
1111 float sceneSize;
1112 SoBaseStereo* stereoViewType;
1113 SbBool m_seekWithOrtho, m_preserveHeightAngle, cursorEnabledFlag, seekDistAsPercentage, computeSeekVariables;
1114 float m_previousHeightAngle, viewerSpeed, seekDistance;
1115 SoWinViewer::Type type;
1116 SoNode* sceneGraph;
1117 SbVec3f seekPoint, seekNormal, oldCamPosition, newCamPosition;
1118 SbRotation oldCamOrientation, newCamOrientation;
1119
1120 virtual SoGLContext* getViewerContext() { return getNormalSoContext(); }
1121 virtual SoSceneManager* getViewerSceneManager() { return getSceneManager(); }
1122
1123 private:
1124
1125 virtual void adjustCameraClippingPlanes();
1126
1127 // list of new Binding
1128 SbEventWrapperList* m_eventWrapperList;
1129
1130 void windowsKeyArrayConvert();
1131 SoKeyboardEvent::Key* m_windowsKeyArray;
1132
1134 SoKeyboardEvent::Key keyCodeToEnum(WPARAM param);
1135
1136 // Constructor/Destructor
1137 SoWinViewer( SoWidget parent,
1138 const char* name,
1139 SbBool buildInsideParent,
1140 SoWinViewer::Type type, // Removed class qualifier from enum --mmh 1/12/95
1141 SbBool buildNow,
1142 SbBool sync );
1143
1144 SoWinViewer( SoWidget parent,
1145 const char* name,
1146 SbBool buildInsideParent,
1147 SoWinViewer::Type type,
1148 SbBool buildNow,
1149 SbBool sync,
1150 SoGuiViewer* guiViewer );
1151
1152 // global vars new in v2.1
1153 SbBool altSwitchBack; // flag to return to PICK after an Alt release
1154
1155 // Previously declared in subclasses (before v2.6)
1156 // Note that each subclass viewer uses a subset of these standard
1157 // cursor names. Note that the Fly and Walk viewers used slightly
1158 // different names (that were too generic) for their specific cursors
1159 // (the last two in the list) prior to v2.6.
1160 HCURSOR normalCursor, // std arrow
1161 dollyCursor, panCursor, rollCursor, seekCursor,
1162 spinCursor, upCursor, flyCursor, walkCursor,
1163 pickCursor, manipCursor; // => For constrained viewer.
1164
1165 // Load cursor definitions from resource file.
1166 // previously declared in subclasses (before v2.6).
1167 // Subclasses may override, but are not required to do so
1168 // unless they need more or different cursor definitions.
1169 virtual void defineCursors();
1170
1171 // Subclasses should (and do) override this method! (new in v2.6)
1172 // (The setCursorStyle method calls this to force a dynamic change)
1173 virtual void updateCursor() {};
1174
1175 // Subclasses can call this routine to handle a common set of events. A Boolean
1176 // is returned to specify whether the event was handled by the base class.
1177 // Currently handled events and functions are :
1178 // 'Esc' key - toggles viewing on/off
1179 // When viewing OFF - send all events down the scene graph
1180 // When camera == NULL - Discard all viewing events
1181 // 'home' Key - calls resetToHomePosition()
1182 // 's' Key - toggles seek on/off
1183 // Arrow Keys - moves the camera up/down/right/left in the viewing plane
1184 SbBool processCommonEvents(XAnyEvent *xe);
1185
1186 // Invokes the start and finish viewing callbacks. Subclasses NEED to call
1187 // those routines when they start and finish doing interactive viewing
1188 // operations so that correct interactive drawing style and buffering
1189 // types, as well as application callbacks, gets set and called properly.
1190 //
1191 // Those routines simply increment and decrement a counter. When the counter
1192 // changes from 0->1 the start viewing callbacks are called. When the counter
1193 // changes back from 1->0 the finish viewing callbacks are called.
1194 // The counter approach enables different parts of a viewer to call those
1195 // routines withough having to know about each others (which is not
1196 //
1197 void interactiveCountInc();
1198 void interactiveCountDec();
1199 int getInteractiveCount() { return m_guiViewer->getInteractiveCount(); }
1200
1201 //
1202 // This routine is used by subclasses to initiate the seek animation. Given a
1203 // screen mouse location, this routine will return the picked point
1204 // and the normal at that point. It will also schedule the sensor to animate
1205 // if necessary. The routine retuns TRUE if something got picked...
1206 //
1207 // Note: if detailSeek is on, the point and normal correspond to the exact
1208 // 3D location under the cursor.
1209 // if detailSeek if off, the object bbox center and the camera
1210 // orientation are instead returned.
1211 SbBool seekToPoint(const SbVec2s &mouseLocation);
1212
1213 //
1214 // Subclasses CAN redefine this to interpolate camera position/orientation
1215 // while the seek animation is going on (called by animation sensor).
1216 // The parameter t is a [0,1] value corresponding to the animation percentage
1217 // completion. (i.e. a value of 0.25 means that animation is only 1/4 of the way
1218 // through).
1219 //
1220 virtual void interpolateSeekAnimation(float t);
1221 virtual void computeSeekFinalOrientation();
1222
1223 // redefine this routine to adjust the camera clipping planes just
1224 // before doing a redraw. The sensor will be unschedule after the camera
1225 // is changed in the base class to prevent a second redraw from occuring.
1226 virtual void actualRedraw();
1227
1228 // This is called during a paste.
1229 // Subclasses may wish to redefine this in a way that
1230 // keeps their viewing paradigm intact.
1231 virtual void changeCameraValues( SoCamera* newCamera );
1232
1233 //
1234 // Convenience routines which subclasses can use when drawing viewer
1235 // feedback which may be common across multiple viewers. There is for
1236 // example a convenience routine which sets an orthographics projection
1237 // and a method to draw common feedback like the roll anchor (used by
1238 // a couple of viewers).
1239 //
1240 // All drawing routines assume that the window and projection is
1241 // already set by the caller.
1242 //
1243 // set an ortho projection of the glx window size - this also turns
1244 // zbuffering off and lighting off (if necessary).
1245 static void setFeedbackOrthoProjection( const SbVec2s& glxSize );
1246 // restores the zbuffer and lighting state that was changed when
1247 // setFeedbackOrthoProjection() was last called.
1248 static void restoreGLStateAfterFeedback();
1249 // draws a simple 2 colored cross at given position
1250 static void drawViewerCrossFeedback( SbVec2s loc );
1251 // draws the anchor feedback given center of rotation and mouse location
1252 static void drawViewerRollFeedback( SbVec2s center, SbVec2s loc );
1253
1254 //
1255 // set the right zbuffer state (based on the current draw style) whenever
1256 // the window changes.
1257 //
1258 // HACK: redefines this routine from SoWinRenderArea to also check to make
1259 // sure that SoWinViewer::setBufferingType() is updated if users call
1260 // SoWinGLWidget::setDoubleBuffer() instead.
1261 //
1262 virtual void widgetChanged( SoWidget );
1263
1264 // redefine this for a better default draw style (need to wait for context)
1265 virtual void afterRealizeHook();
1266
1267 // Override redraw() in order to calculate render time including
1268 // frame buffer switch
1269 virtual void redraw();
1270
1271 // Subclasses may override this function to change way that
1272 // viewer tries to calculate decimation percentage for
1273 // DecimationStrategy FRAMES_PER_SECOND.
1274 // Given goal frames per second, timeTaken in last render,
1275 // and last decimation value used, this function should return
1276 // decimation percentage value to use in next render.
1277 virtual float decimationForFramesPerSecond( float fps, double timeTaken, float decimation );
1278
1279 // Subclasses may override this function to change way that
1280 // viewer tries to calculate decimation percentage for
1281 // DecimationStrategy FIXED_NUM_TRIANGLES.
1282 // Given goal number of triangles to reach, this function
1283 // should return decimation percentage value to use.
1284 virtual float decimationForNumTriangles(uint32_t numTris);
1285
1286 void setCurrentDrawStyle(SoWinViewer::DrawStyle style);
1287
1288 private:
1289
1290 void constructorCommon( SoWinViewer::Type t, SbBool buildNow );
1291 void constructorCommon2( SoWinViewer::Type t, SbBool buildNow );
1292
1293 SoGuiViewer* m_guiViewer; // Implementation class for SoXxViewer
1294
1295 SbBool m_firstRealize;
1296
1297 // copy and paste support
1298 SoWinClipboard* clipboard;
1299 static void pasteDoneCB( void* userData, SoPathList* pathList );
1300
1301 // headlight variables
1302 SoFieldSensor* headlightSensor; // attached to camera
1303 static void headlightSensorCB( void* v, SoSensor* s );
1304
1305 // Attach/detach headlightSensor.
1306 static void visibilityChangeCB( void* pt, SbBool visible );
1307
1308 // set the zbuffer on current window to correct state
1309 void setZbufferState();
1310 SbBool isZbufferOff();
1311 void arrowKeyPressed( KeySym key );
1312
1313 // Decimation strategy additions:
1314 SoAlarmSensor* stillSensor;
1315 static void alarmCB( void* thisp, SoSensor* s );
1316 void stillSensorCalled();
1317
1318 // Seek animation
1319 static void seekAnimationSensorCB( void* p, SoSensor* sensor );
1320
1321 // PoViews
1337 static SbBool viewingEventCB( SoWinViewer* viewer, XAnyEvent* anyEvent );
1338
1339private:
1340 void* getViewer() { return (void*)this; }
1341 };
1342
1343inline void
1344SoWinViewer::alarmCB( void* thisp, SoSensor* )
1345{
1346 ((SoWinViewer*)thisp)->stillSensorCalled();
1347}
1348
1349#include <Inventor/Win/SoWinEndStrict.h>
1350
1351#endif /* _SO_WIN_VIEWER_ */
1352
1353
1354
1355
List of generic (void *) pointers.
Definition SbPList.h:77
Class for representing a rotation.
Definition SbRotation.h:126
2D vector class.
Definition SbVec.h:700
3D vector class.
Definition SbVec.h:932
Triggers a delegate once sometime in the future.
Node that defines an object's base color.
Definition SoBaseColor.h:91
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Class for stereo...
Abstract base class for camera nodes.
Definition SoCamera.h:188
Shape complexity node.
Node representing a directional light source.
Node that defines the style to use when rendering.
Sensor class that can be attached to Open Inventor fields.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> OpenGL context m...
Computes bounding box of a scene.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Counts number of...
Base class for all group nodes.
Definition SoGroup.h:122
Key
The keyboard keys.
Node that defines the lighting model to use when rendering.
Node that specifies how multiple materials are bound to shapes.
Abstract base class for all database nodes.
Definition SoNode.h:145
Sensor class that can be attached to Open Inventor nodes.
Node that defines base colors using packed representation.
Maintains a list of pointers to paths.
Definition SoPathList.h:81
Node representing a 3D rotation about an arbitrary axis.
Definition SoRotation.h:98
Field containing an SbTime.
Definition SoSFTime.h:82
Manages scene graph rendering and event handling.
Abstract base class for Open Inventor sensors.
Definition SoSensor.h:100
Group node that saves and restores traversal state.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Pure virtual cla...
Group node that traverses one chosen child.
Definition SoSwitch.h:179
Sensor that triggers repeatedly at regular intervals.
Stores runtime type information.
Definition SoType.h:98
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Supports copy/pa...
virtual SoGLContext * getNormalSoContext()
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Component for re...
SoSceneManager * getSceneManager() const
Gets the normal scene manager.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Viewer component...
virtual const SbVec2s & getTopLeft()
Returns the position of the OpenGL drawing window in absolute screen coordinates (not relative to par...
virtual void setCursorStyle(SoWinViewer::CursorStyle style)
Sets the cursor style.
void SoWinViewerCB(void *userData, SoWinViewer *viewer)
Definition SoWinViewer.h:77
void SoWinViewerCameraTypeChangeCB(void *userData, SoCamera *camera, SoWinViewer *viewer)
Definition SoWinViewer.h:83
virtual void recomputeSceneSize()
This can be used to let the viewer know that the scene graph has changed so that the viewer can recom...
virtual SbBool isStereoBalanceNearFrac()
Returns TRUE if the stereo balance adjustement is defined as a fraction of the camera near distance.
SoWinViewer::BufferType getBufferingType()
Gets the current buffering type in the main view.
SoNode * getCameraSceneGraph()
Gets the sub-scene graph to be viewed.
virtual SbBool isStereoViewing()
Queries if stereo viewing is on or off on the viewer.
virtual SbBool isViewerDoubleBuffer()
Returns TRUE if viewer is double buffered.
SoBaseStereo * getStereoViewType()
Returns the current stereo implementation.
SoWinViewer::DrawStyle getDrawStyle(SoWinViewer::DrawType type)
Queries the current drawing style in the main view.
virtual const SbVec2s & getSize()
Returns the size of the OpenGL drawing window in absolute screen coordinates (not relative to parent ...
virtual void saveHomePosition()
Saves the camera values.
virtual void setNormalVisual(XVisualInfo *i)
Specifies the exact pixel format descriptor for the normal window.
SoType getCameraType()
Gets the camera type that will be created by the viewer if no cameras are found in the scene graph (s...
DecimationStrategy
list of decimation strategies
@ FIXED_NUM_TRIANGLES
Try to fix number of triangles drawn.
@ FIXED_PERCENTAGE
Use given decimation percentage.
@ NORMAL
Decimation is not changed.
@ FRAMES_PER_SECOND
Try to fix frames per second.
virtual SbBool isStereoAbsoluteAdjustments() const
Returns TRUE if stereo absolute adjustments are enabled.
virtual void setPreserveCameraHeightAngle(SbBool flag)
If TRUE, an SoPerspectiveCamera's heightAngle is preserved if the camera is changed to an SoOrthograp...
SoCamera * getCamera()
Gets the camera controlled by the viewer.
void SoWinViewerDecimationPercentageCB(float percentage, void *userData, SoWinViewer *viewer)
Definition SoWinViewer.h:98
SbBool isFullRenderingWhenStill()
Queries if the viewer will render at full resolution when it sits still for a certain period of time.
void removeStartCallback(SoWinViewerCB *f, void *userData=NULL)
Removes start callback routine from the viewer.
SbBool isCursorEnabled() const
Queries whether the viewer is allowed to change the cursor over the renderArea window.
virtual const SbVec2s & getBottomRight()
Returns the position of the OpenGL drawing window in absolute screen coordinates (not relative to par...
float getSeekTime()
Queries the seek time.
virtual void toggleCameraType()
This routine will toggle the current camera from perspective to orthographic, and from orthographic b...
SbBool isSeekMode()
Queries whether the seek mode is active.
virtual void setSceneGraph(SoNode *newScene)
Sets the scene graph to render.
SbBool isStillNow()
Returns whether the viewer is currently still.
void reverseStereoView(SbBool reverse)
If TRUE, reverse the left and right eye views.
void addFinishCallback(SoWinViewerCB *f, void *userData=NULL)
Adds finish callback routine on the viewer.
void enableFullRenderingWhenStill(SbBool onOff)
If this flag is set, the viewer will render at full resolution when it sits still for a certain perio...
void setDecimationStrategy(SoWinViewer::DecimationStrategy strategy)
Sets strategy to use to decide on decimation value.
void removeFinishCallback(SoWinViewerCB *f, void *userData=NULL)
Removes finish callback routine from the viewer.
int getNumSamples()
Gets how many frames should be timed before frames per second callback is called.
virtual void viewAll()
Changes the camera position to view the entire scene (the camera zoom or orientation isn't changed).
float getCurrentDecimationPercentage()
Returns the Decimation Percentage the viewer used in its last render.
void setGoalNumberOfTriangles(int32_t goal)
Sets goal number of triangles for the viewer to try to render.
CursorStyle
Classic cursors are all white and tend to disappear over white geometry or white background.
@ XOR
Improved cursors using XOR.
@ SHADOW
Improved cursors using "shadow".
@ CLASSIC
Standard Open Inventor cursors.
void setFixedPercentage(float percent)
Sets fixed percentage for the viewer to render (0.0 to 1.0) Default is 1.0.
DrawStyle
list of possible drawing styles
@ VIEW_BBOX
Bounding box draw style.
@ VIEW_HIDDEN_LINE
Render only the frontmost lines.
@ VIEW_NO_TEXTURE
Render without textures.
@ VIEW_LOW_COMPLEXITY
Render low complexity and no texture.
@ VIEW_LOW_RES_LINE
Low complexity wireframe + no depth clearing.
@ VIEW_SAME_AS_STILL
Forces the INTERACTIVE draw style to match STILL.
@ VIEW_POINT
Point draw style.
@ VIEW_AS_IS
Unchanged.
@ VIEW_LINE
Wireframe draw style.
@ VIEW_LOW_RES_POINT
Low complexity point + no depth clearing.
SoWinViewer::DecimationStrategy getDecimationStrategy()
Gets strategy to use to decide on decimation value.
float getAutoClipTolerance() const
Returns the auto clipping tolerance value.
void copyView(Time eventTime)
Copies the view.
void setAutoClipping(SbBool onOrOff)
Sets the auto clipping plane.
BufferType
list of different buffering types
@ BUFFER_DOUBLE
Double buffer.
@ BUFFER_SINGLE
Single buffer.
@ BUFFER_INTERACTIVE
Double buffer while interactive viewing.
virtual SoNode * getSceneGraph()
Gets the scene graph to be rendered in this component's window.
SbBool isAutoClipping() const
Queries if auto clipping is ON.
virtual void setStereoAbsoluteAdjustments(SbBool absolute)
If TRUE, use stereo absolute adjustments.
void pasteView(Time eventTime)
Pastes the view.
virtual void actualRendering()
This method is called automatically when the viewer requests that its SoBaseStereo object perform ste...
virtual void setStereoActive(SbBool activate)
If TRUE, stero is activated.
virtual void resetToHomePosition()
Restores the camera values.
virtual SbBool isCameraHeightAnglePreserved() const
Query whether the SoPerspectiveCamera's heightAngle is preserved if the camera is changed to an SoOrt...
void setPickRadius(float radius)
Sets the pick radius, in pixels, used by the viewer for picking and seeking actions.
float getStereoOffset()
Returns the stereo offset.
SbBool isHeadlight()
Queries if the headlight is on.
void setHeadlight(SbBool onOrOff)
Turns the headlight on/off (default on).
virtual void setViewing(SbBool onOrOff)
Sets whether the viewer is turned on or off.
virtual SoDEPRECATED void adjustClippingPlanes()
Along with the manipulation of the camera, SoBaseStereo needs to set the scene appropriately when cha...
SoDirectionalLight * getHeadlight()
Returns the headlight node.
void setCameraTypeChangeCallback(SoWinViewerCameraTypeChangeCB *callback, void *userdata)
Defines a callback which is called each time the camera type has changed (change from SoPerspectiveCa...
void setBufferingType(SoWinViewer::BufferType type)
Sets the current buffering type in the main view (default SoWinViewer::BUFFER_DOUBLE).
SbBool isDetailSeek()
Queries whether detail seek is on.
virtual void setCameraSceneGraph(SoNode *cameraSceneGraph)
Sets the sub-scene graph to be used for viewAll computation.
float getGoalFramesPerSecond()
Gets goal frames per second for the viewer to try to render.
int32_t getGoalNumberOfTriangles()
Gets goal number of triangles for the viewer to try to render.
void setSeekTime(float seconds)
Sets the time a seek takes to change to the new camera location.
SbBool getDepthValue(int x, int y, float &depth)
Returns the depth value, scaled between 0.0 and 1.0, from the depth buffer at window coordinates x,...
void setStereoViewType(SoBaseStereo *stereo)
Set an implementation of stereo viewing to use.
void SoWinViewerFPSCB(float fps, void *userData, SoWinViewer *viewer)
Large Model Viewing notification callbacks for frames per second and decimation percentage.
Definition SoWinViewer.h:92
virtual void setStereoBalance(float balance, SbBool nearFrac=false)
Sets the stereo balance (the position of the zero parallax plane).
virtual void setStereoViewing(SbBool onOrOff)
Turns stereo viewing on/off on the viewer (default off).
virtual void setCursorEnabled(SbBool onOrOff)
Sets whether the viewer is allowed to change the cursor over the renderArea window.
void setViewport(short left, short bottom, short width, short height)
Sets viewport region with given origin (lower-left corner) and size, given as pixel coordinates.
Type
An EDITOR viewer will create a camera under the user supplied scene graph (specified in setSceneGraph...
@ EDITOR
Camera is added to user's scene.
@ BROWSER
Camera views scene, but is not added to scene.
void getViewport(short &left, short &bottom, short &width, short &height)
Returns viewport region as origin (lower-left corner) and size, given as pixel coordinates.
virtual void enableSeekWithOrtho(SbBool flag)
If FALSE, the seek functionality is disabled for an SoOrthographicCamera.
void setDetailSeek(SbBool onOrOff)
When the viewer is in seek mode, left mouse clicks initiate a pick, and the viewer changes its orient...
virtual float getStereoBalance()
Returns the current stereo balance.
void enableMouseWheelDolly(SbBool onOff)
Enable/disable moving the camera with the mouse wheel, TRUE by default.
virtual SoCamera * getViewerCamera()
Returns the camera so SoBaseStereo can manipulate it to achieve the stereo effect.
float getPickRadius() const
Returns the current pick radius for picking and seeking actions.
DrawType
DrawType.
@ STILL
Applies to static rendering.
@ INTERACTIVE
Applies to rendering while interactive viewing.
void setDecimationPercentageCallback(SoWinViewerDecimationPercentageCB *callback, void *userData=NULL)
Registers decimation percentage callback.
void setGoalFramesPerSecond(float goal)
Sets goal frames per second for the viewer to try to render.
void setStereoOffset(float dist)
Sets the stereo offset.
virtual void setSeekMode(SbBool onOrOff)
Externally set the viewer into/out off seek mode (default OFF).
virtual SbBool isSeekWithOrthoEnabled() const
Query whether the seek functionality is enabled for an SoOrthographicCamera.
virtual void setCamera(SoCamera *cam)
Sets the camera that will be controlled by the viewer.
SbBool isStereoViewReversed()
Returns TRUE if the left and right eye views are reversed.
SoWinViewer::CursorStyle getCursorStyle()
Returns the cursor style.
void setDrawStyle(SoWinViewer::DrawType type, SoWinViewer::DrawStyle style)
Sets the current drawing style in the main view.
void addStartCallback(SoWinViewerCB *f, void *userData=NULL)
Adds start callback routine on the viewer.
void setNumSamples(int numFrames)
Sets how many frames should be timed before frames per second callback is called,...
float getFixedPercentage()
Gets fixed percentage for the viewer to render (0.0 to 1.0)
SbBool isViewing() const
Queries whether the viewer is turned on or off.
virtual SbBool isStereoActive()
Returns TRUE if stereo is active.
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 setFramesPerSecondCallback(SoWinViewerFPSCB *callback, void *userData=NULL)
Registers frames per second callback.
void setAutoClipTolerance(float tolerance)
Sets the auto clipping tolerance value.
int SbBool
Boolean type.
Definition SbBase.h:87