Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SoXtViewer.h
Go to the documentation of this file.
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-2023 BY FEI S.A.S, ***
42 *** BORDEAUX, FRANCE ***
43 *** ALL RIGHTS RESERVED ***
44**=======================================================================*/
45/*=======================================================================
46** Modified by : VSG (MMM YYYY)
47**=======================================================================*/
48
49
50
51#ifdef SOQT
53#elif defined _WIN32
55#else
56
57#ifndef _SO_XT_VIEWER_
58#define _SO_XT_VIEWER_
59
60#include <Inventor/SoType.h>
67
68// classes
69class SoNode;
71class SoGroup;
72class SoRotation;
73class SoCamera;
74class SoDrawStyle;
75class SoLightModel;
76class SoFieldSensor;
77class SoXtClipboard;
78class SoXtViewer;
80class SbPList;
81class SoSeparator;
82class SoSwitch;
83class SoComplexity;
84class SoPackedColor;
86class SoSFTime;
87class SoXtInputFocus;
88class SoAlarmSensor;
89class SoNodeSensor;
91class SoStereoViewer;
92class SoBaseStereo;
93class ScRayPickAction;
94
95// callback function prototypes
96typedef void SoXtViewerCB( void* userData, SoXtViewer* viewer );
97typedef void SoXtViewerCameraTypeChangeCB( void* userData, SoCamera* camera, SoXtViewer* viewer );
98
99// Large Model Viewing notification callbacks for
100// frames per second and decimation percentage:
101typedef void SoXtViewerFPSCB( float fps, void* userData, SoXtViewer* viewer );
102typedef void SoXtViewerDecimationPercentageCB( float percentage, void* userData, SoXtViewer* viewer );
103
105//
106// Class: SoXtViewer
107//
108// The Viewer component is the abstract base class for all viewers.
109// It is subclassed from renderArea, adding viewing semantics to Inventor
110// rendering.
111//
113
185{
186 public:
197 enum Type
198 {
206 EDITOR
207 };
208
258
271
288
309
330
331
340 virtual void setSceneGraph(SoNode *newScene);
341
346
352 virtual void setCamera( SoCamera* cam );
353
357 SoCamera* getCamera() { return m_guiViewer->getCamera(); }
358
367 virtual void setCameraType( SoType type );
368
373 SoType getCameraType() { return m_guiViewer->getCameraType(); }
374
381 { m_guiViewer->setPreserveCameraHeightAngle( flag ); }
382
388 virtual SbBool isCameraHeightAnglePreserved() const { return m_guiViewer->isCameraHeightAnglePreserved(); }
389
394 virtual void enableSeekWithOrtho( SbBool flag ) { m_guiViewer->enableSeekWithOrtho( flag ); }
395
400 virtual SbBool isSeekWithOrthoEnabled() const { return m_guiViewer->isSeekWithOrthoEnabled(); }
401
420 virtual void viewAll();
421
425 virtual void saveHomePosition();
426
430 virtual void resetToHomePosition();
431
437
444 virtual void setHeadlight( SbBool onOrOff );
445
449 SbBool isHeadlight() { return m_guiViewer->isHeadlight(); }
450
454 SoDirectionalLight* getHeadlight() { return m_guiViewer->getHeadlight(); }
455
504 virtual void setDrawStyle( SoXtViewer::DrawType type, SoXtViewer::DrawStyle style );
505
509 SoXtViewer::DrawStyle getDrawStyle( SoXtViewer::DrawType type );
510
515 virtual void setBufferingType( SoXtViewer::BufferType type) ;
516
521 { return (SoXtViewer::BufferType)m_guiViewer->getBufferingType(); }
522
535 virtual void setViewing( SbBool onOrOff );
536
540 SbBool isViewing() const { return m_guiViewer->isViewing(); };
541
552 virtual void setCursorEnabled( SbBool onOrOff );
553
558 SbBool isCursorEnabled() const { return m_guiViewer->isCursorEnabled(); }
559
570 void setAutoClipping( SbBool onOrOff );
571
575 SbBool isAutoClipping() const { return m_guiViewer->isAutoClipping(); }
576
584 virtual void setStereoViewing( SbBool onOrOff );
585
591
595 void setStereoOffset( float dist );
596
601
609 void setDetailSeek( SbBool onOrOff ) { m_guiViewer->setDetailSeek( onOrOff ); };
610
614 SbBool isDetailSeek() { return m_guiViewer->isDetailSeek(); }
615
628 void setSeekTime( float seconds ) { m_guiViewer->setSeekTime( seconds ); }
629
633 float getSeekTime() { return m_guiViewer->getSeekTime(); }
634
643 void addStartCallback( SoXtViewerCB* f, void* userData = NULL )
644 { m_guiViewer->addStartCallback( (SoGuiViewerCB*)f, userData ); }
645
654 void addFinishCallback( SoXtViewerCB* f, void* userData = NULL )
655 { m_guiViewer->addFinishCallback( (SoGuiViewerCB*)f, userData ); }
656
662 void removeStartCallback( SoXtViewerCB* f, void* userData = NULL )
663 { m_guiViewer->removeStartCallback( (SoGuiViewerCB*)f, userData ); }
664
670 void removeFinishCallback( SoXtViewerCB* f, void* userData = NULL )
671 { m_guiViewer->removeFinishCallback( (SoGuiViewerCB*)f, userData ); }
672
678 void copyView( Time eventTime );
679
685 void pasteView( Time eventTime );
686
693 virtual void recomputeSceneSize();
694
695 // --- Large Model Viewing additions:
696
702 void setDecimationStrategy( SoXtViewer::DecimationStrategy strategy );
703
708 { return (SoXtViewer::DecimationStrategy)m_guiViewer->getDecimationStrategy(); }
709
717 void setGoalNumberOfTriangles( int32_t goal );
718
722 int32_t getGoalNumberOfTriangles() { return m_guiViewer->getGoalNumberOfTriangles(); };
723
731 void setGoalFramesPerSecond( float goal );
732
736 float getGoalFramesPerSecond() { return m_guiViewer->getGoalFramesPerSecond(); };
737
745 void setFixedPercentage( float percent );
746
750 float getFixedPercentage() { return m_guiViewer->getFixedPercentage(); };
751
761
766 SbBool isFullRenderingWhenStill() { return m_guiViewer->isFullRenderingWhenStill(); };
767
771 SbBool isStillNow() { return m_guiViewer->isStillNow(); };
772
776 void setFramesPerSecondCallback( SoXtViewerFPSCB* callback, void* userData = NULL );
777
782 void setNumSamples( int numFrames );
787 int getNumSamples() { return m_guiViewer->getNumSamples(); }
788
793
798
799 // Implementing methods from the pure virtual class from SoStereoViewer
800
803 virtual void actualRendering();
804 virtual const SbVec2s& getSize();
805 virtual const SbVec2s& getTopLeft() ;
806 virtual const SbVec2s& getBottomRight() ;
809 void reverseStereoView( SbBool reverse );
811 virtual void setStereoAbsoluteAdjustments( SbBool absolute );
812 virtual SbBool isStereoAbsoluteAdjustments() const { return m_guiViewer->isStereoAbsoluteAdjustments(); }
813 virtual void setStereoBalance( float balance, SbBool nearFrac );
814 virtual float getStereoBalance();
816 virtual void setStereoActive( SbBool activate );
818 void setViewport( short left, short bottom, short width, short height );
819 void getViewport( short &left, short &bottom, short &width, short &height );
820
821
836 virtual void setCursorStyle( SoXtViewer::CursorStyle style );
837
842 { return (SoXtViewer::CursorStyle)m_guiViewer->getCursorStyle(); }
843
844
845 SoSeparator* getSceneRoot() { return m_guiViewer->getSceneRoot(); }
846
856 void setAutoClipTolerance ( float tolerance ) { m_guiViewer->setAutoClipTolerance( tolerance ); };
857
861 float getAutoClipTolerance () const { return m_guiViewer->getAutoClipTolerance(); };
862
887 virtual void setCameraSceneGraph( SoNode* cameraSceneGraph );
888
893
903 virtual void toggleCameraType();
904
912 virtual void setSeekMode( SbBool onOrOff );
913
923 void setPickRadius( float radius );
924
928 float getPickRadius() const;
929
930#if 1 SoDEPRECATED
933 virtual void adjustClippingPlanes();
934
935#endif
942 SbBool getDepthValue(int x, int y, float &depth)
943 {
944 return m_guiViewer->getDepthValue(x, y, depth);
945 }
946
947 private:
948 virtual ~SoXtViewer();
949
950 // redefine this routine to also correctly set the buffering type
951 // on the viewer.
952 virtual void setNormalVisual( XVisualInfo* v );
953
954#ifndef HIDDEN_FROM_DOC
955 void saveSceneGraph( const char* fileName ) ;
956#endif //HIDDEN_FROM_DOC
957
958 SbBool isInteractive() const;
959
960 SoGuiViewer* getGuiViewer() const;
961
962 // These members are public only for retro compatibility purposes.
963 // They should not be called directly. Use their accessors instead.
964 SoCamera* camera;
965 SbBool createdCursors, viewingFlag;
966 CursorStyle cursorStyle;
967 SoSeparator* sceneRoot;
968 float sceneSize;
969 SoBaseStereo* stereoViewType;
970 SbBool m_seekWithOrtho, m_preserveHeightAngle, cursorEnabledFlag, seekDistAsPercentage, computeSeekVariables;
971 float m_previousHeightAngle, viewerSpeed, seekDistance;
972 SoXtViewer::Type type;
973 SoNode* sceneGraph;
974 SbVec3f seekPoint, seekNormal, oldCamPosition, newCamPosition;
975 SbRotation oldCamOrientation, newCamOrientation;
976
977 virtual SoGLContext* getViewerContext() { return getNormalSoContext(); }
978 virtual SoSceneManager* getViewerSceneManager() { return getSceneManager(); }
979
980 private:
981
982 // Constructor/Destructor
983 SoXtViewer( SoWidget parent,
984 const char* name,
985 SbBool buildInsideParent,
986 SoXtViewer::Type type,
987 SbBool buildNow,
988 SbBool sync = TRUE );
989
990 SoXtViewer( SoWidget parent,
991 const char* name,
992 SbBool buildInsideParent,
993 SoXtViewer::Type type,
994 SbBool buildNow,
995 SbBool sync,
996 SoGuiViewer* guiViewer );
997
998
999 // Subclasses should (and do) override this method! (new in v2.6)
1000 // (The setCursorStyle method calls this to force a dynamic change)
1001 virtual void updateCursor() {};
1002
1003 // global vars
1004 SbBool altSwitchBack; // flag to return to PICK after an Alt release
1005
1006 // Subclasses can call this routine to handle a common set of events. A Boolean
1007 // is returned to specify whether the event was handled by the base class.
1008 // Currently handled events and functions are :
1009 // 'Esc' key - toggles viewing on/off
1010 // When viewing OFF - send all events down the scene graph
1011 // When camera == NULL - Discard all viewing events
1012 // 'home' Key - calls resetToHomePosition()
1013 // 's' Key - toggles seek on/off
1014 // Arrow Keys - moves the camera up/down/right/left in the viewing plane
1015 SbBool processCommonEvents( XAnyEvent* xe );
1016
1017 // Invokes the start and finish viewing callbacks. Subclasses NEED to call
1018 // those routines when they start and finish doing interactive viewing
1019 // operations so that correct interactive drawing style and buffering
1020 // types, as well as application callbacks, gets set and called properly.
1021 //
1022 // Those routines simply increment and decrement a counter. When the counter
1023 // changes from 0->1 the start viewing callbacks are called. When the counter
1024 // changes back from 1->0 the finish viewing callbacks are called.
1025 // The counter approach enables different parts of a viewer to call those
1026 // routines withough having to know about each others (which is not
1027 //
1028 void interactiveCountInc();
1029 void interactiveCountDec();
1030 int getInteractiveCount() { return m_guiViewer->getInteractiveCount(); }
1031
1032 //
1033 // This routine is used by subclasses to initiate the seek animation. Given a
1034 // screen mouse location, this routine will return the picked point
1035 // and the normal at that point. It will also schedule the sensor to animate
1036 // if necessary. The routine retuns TRUE if something got picked...
1037 //
1038 // Note: if detailSeek is on, the point and normal correspond to the exact
1039 // 3D location under the cursor.
1040 // if detailSeek if off, the object bbox center and the camera
1041 // orientation are instead returned.
1042 SbBool seekToPoint( const SbVec2s& mouseLocation );
1043
1044 //
1045 // Subclasses CAN redefine this to interpolate camera position/orientation
1046 // while the seek animation is going on (called by animation sensor).
1047 // The parameter t is a [0,1] value corresponding to the animation percentage
1048 // completion. (i.e. a value of 0.25 means that animation is only 1/4 of the way
1049 // through).
1050 //
1051 virtual void interpolateSeekAnimation( float t );
1052 virtual void computeSeekFinalOrientation();
1053
1054 SbBool isSeekMode() { return m_guiViewer->isSeekMode(); }
1055
1056 // redefine this routine to adjust the camera clipping planes just
1057 // before doing a redraw. The sensor will be unschedule after the camera
1058 // is changed in the base class to prevent a second redraw from occuring.
1059 virtual void actualRedraw();
1060
1061 // This is called during a paste.
1062 // Subclasses may wish to redefine this in a way that
1063 // keeps their viewing paradigm intact.
1064 virtual void changeCameraValues( SoCamera* newCamera );
1065
1066 //
1067 // Convenience routines which subclasses can use when drawing viewer
1068 // feedback which may be common across multiple viewers. There is for
1069 // example a convenience routine which sets an orthographics projection
1070 // and a method to draw common feedback like the roll anchor (used by
1071 // a couple of viewers).
1072 //
1073 // All drawing routines assume that the window and projection is
1074 // already set by the caller.
1075 //
1076 // set an ortho projection of the glx window size - this also turns
1077 // zbuffering off and lighting off (if necessary).
1078 static void setFeedbackOrthoProjection( const SbVec2s& glxSize );
1079
1080 // restores the zbuffer and lighting state that was changed when
1081 // setFeedbackOrthoProjection() was last called.
1082 static void restoreGLStateAfterFeedback();
1083
1084 // draws a simple 2 colored cross at given position
1085 static void drawViewerCrossFeedback( SbVec2s loc );
1086
1087 // draws the anchor feedback given center of rotation and mouse location
1088 static void drawViewerRollFeedback( SbVec2s center, SbVec2s loc );
1089
1090 // redefine this for a better default draw style (need to wait for context)
1091 virtual void afterRealizeHook();
1092
1093 virtual void widgetChanged( SoWidget );
1094
1095 // auto clipping vars and routines
1096 SbBool autoClipFlag;
1097 float minimumNearPlane; // minimum near plane as percentage of far
1098 SoGetBoundingBoxAction* autoClipBboxAction;
1099 virtual void adjustCameraClippingPlanes();
1100
1101 // Override redraw() in order to calculate render time including
1102 // frame buffer switch
1103 virtual void redraw();
1104
1105 // Subclasses may override this function to change way that
1106 // viewer tries to calculate decimation percentage for
1107 // DecimationStrategy FRAMES_PER_SECOND.
1108 // Given goal frames per second, timeTaken in last render,
1109 // and last decimation value used, this function should return
1110 // decimation percentage value to use in next render.
1111 virtual float decimationForFramesPerSecond( float fps, double timeTaken, float decimation );
1112
1113 // Subclasses may override this function to change way that
1114 // viewer tries to calculate decimation percentage for
1115 // DecimationStrategy FIXED_NUM_TRIANGLES.
1116 // Given goal number of triangles to reach, this function
1117 // should return decimation percentage value to use.
1118 virtual float decimationForNumTriangles( uint32_t numTris );
1119
1120 // Return a pointer to the XtWidget for stereo
1121 void* getViewer() { return (void*)this; }
1122
1123private:
1124 void constructorCommon( SoXtViewer::Type t, SbBool buildNow );
1125
1126 void constructorCommon2( SoXtViewer::Type t, SbBool buildNow );
1127
1128 SoGuiViewer* m_guiViewer; // Implementation class for SoXxViewer
1129
1130 SbBool m_firstRealize;
1131
1132 // current state vars
1133 SoXtInputFocus* inputFocus;
1134
1135 // draw style vars
1136 void setCurrentDrawStyle( SoXtViewer::DrawStyle style );
1137
1138 // copy and paste support
1139 SoXtClipboard* clipboard;
1140 static void pasteDoneCB( void* userData, SoPathList* pathList );
1141
1142 // set the zbuffer on current window to correct state
1143 void setZbufferState();
1144 SbBool isZbufferOff();
1145 void arrowKeyPressed( KeySym key );
1146
1147 // Decimation strategy additions:
1148 static SoGLRenderAction::AbortCode renderAbortCB( void* data );
1149 SoAlarmSensor* stillSensor;
1150 static void alarmCB( void* thisp, SoSensor* )
1151 { ((SoXtViewer*)thisp)->stillSensorCalled(); }
1152
1153 // PoViews
1169 static SbBool viewingEventCB( SoXtViewer* viewer, XAnyEvent* anyEvent );
1170
1171 void stillSensorCalled();
1172
1173 // Seek animation
1174 static void seekAnimationSensorCB( void* p, SoSensor* sensor );
1175};
1176
1177#endif /* _SO_XT_VIEWER_ */
1178
1179#endif
1180
1181
#define TRUE
Possible value of SbBool.
Definition SbBase.h:77
SbBool isInteractive()
#define SoWidget
Definition SoQtDef.h:40
#define KeySym
Definition SoWinDef.h:57
#define XVisualInfo
Definition SoWinDef.h:141
#define XAnyEvent
Definition SoWinDef.h:100
#define Time
Definition SoWinDef.h:93
#define SoXtViewerDecimationPercentageCB
Definition SoXt2SoQt.h:165
#define SoXtViewerCB
Definition SoXt2SoQt.h:162
#define SoXtViewer
Definition SoXt2SoQt.h:161
#define SoXtViewerCameraTypeChangeCB
Definition SoXt2SoQt.h:163
#define SoXtViewerFPSCB
Definition SoXt2SoQt.h:164
void SoXtViewerDecimationPercentageCB(float percentage, void *userData, SoXtViewer *viewer)
Definition SoXtViewer.h:102
void SoXtViewerCB(void *userData, SoXtViewer *viewer)
Definition SoXtViewer.h:96
void SoXtViewerFPSCB(float fps, void *userData, SoXtViewer *viewer)
Definition SoXtViewer.h:101
void SoXtViewerCameraTypeChangeCB(void *userData, SoCamera *camera, SoXtViewer *viewer)
Definition SoXtViewer.h:97
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.
<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...
AbortCode
Possible return codes from a render abort callback.
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
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:97
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:167
Stores runtime type information.
Definition SoType.h:98
Supports copy/paste for Open Inventor using the Xt clipboard.
Reports input focus change events.
Component for rendering Open Inventor scene graphs.
SoSceneManager * getSceneManager() const
Gets the normal scene manager.
Viewer component lowest base class.
Definition SoXtViewer.h:185
void copyView(Time eventTime)
Copies the view.
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,...
Definition SoXtViewer.h:942
void addStartCallback(SoXtViewerCB *f, void *userData=NULL)
Adds start callback routine on the viewer.
Definition SoXtViewer.h:643
void setAutoClipTolerance(float tolerance)
Sets the auto clipping tolerance value.
Definition SoXtViewer.h:856
float getFixedPercentage()
Gets fixed percentage for the viewer to render (0.0 to 1.0)
Definition SoXtViewer.h:750
SbBool isHeadlight()
Queries if the headlight is on.
Definition SoXtViewer.h:449
virtual void setHeadlight(SbBool onOrOff)
Turns the headlight on/off (default on).
void setDecimationPercentageCallback(SoXtViewerDecimationPercentageCB *callback, void *userData=NULL)
Registers decimation percentage callback.
SbBool isViewing() const
Queries whether the viewer is turned on or off.
Definition SoXtViewer.h:540
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.
void setSeekTime(float seconds)
Sets the time a seek takes to change to the new camera location.
Definition SoXtViewer.h:628
virtual void setCameraSceneGraph(SoNode *cameraSceneGraph)
Sets the sub-scene graph to be used for viewAll computation.
BufferType
list of different buffering types
Definition SoXtViewer.h:274
@ BUFFER_DOUBLE
Double buffer.
Definition SoXtViewer.h:282
@ BUFFER_SINGLE
Single buffer.
Definition SoXtViewer.h:278
@ BUFFER_INTERACTIVE
Double buffer while interactive viewing.
Definition SoXtViewer.h:286
virtual SbBool isSeekWithOrthoEnabled() const
Query whether the seek functionality is enabled for an SoOrthographicCamera.
Definition SoXtViewer.h:400
virtual SbBool isStereoActive()
Queries stereo activation.
Type
An EDITOR viewer will create a camera under the user supplied scene graph (specified in setSceneGraph...
Definition SoXtViewer.h:198
@ BROWSER
Camera views scene, but is not added to scene.
Definition SoXtViewer.h:202
@ EDITOR
Camera is added to user's scene.
Definition SoXtViewer.h:206
float getAutoClipTolerance() const
Gets the auto clipping tolerance value.
Definition SoXtViewer.h:861
virtual SbBool isStereoViewing()
Queries if stereo viewing is on or off on the viewer.
SoNode * getCameraSceneGraph()
Gets the sub-scene graph to be viewed.
void enableFullRenderingWhenStill(SbBool onOff)
If this flag is set, the viewer will render at full resolution when it sits still for a certain perio...
virtual void saveHomePosition()
Saves the camera values.
SbBool isStillNow()
Returns whether the viewer is currently still.
Definition SoXtViewer.h:771
void setGoalNumberOfTriangles(int32_t goal)
Sets goal number of triangles for the viewer to try to render.
virtual SoNode * getSceneGraph()
Gets the scene graph to render.
void setStereoViewType(SoBaseStereo *stereo)
If stereoViewType is NULL, the stereo is inactivated (see setStereoActive).
float getPickRadius() const
Returns the current pick radius for picking and seeking actions.
virtual void recomputeSceneSize()
This can be used to let the viewer know that the scene graph has changed so that the viewer can recom...
int getNumSamples()
Gets how many frames should be timed before frames per second callback is called.
Definition SoXtViewer.h:787
void setDecimationStrategy(SoXtViewer::DecimationStrategy strategy)
Sets strategy to use to decide on decimation value.
float getSeekTime()
Queries the seek time.
Definition SoXtViewer.h:633
virtual void actualRendering()
This method is called automatically when the viewer requests that its SoBaseStereo object perform ste...
virtual void setCursorEnabled(SbBool onOrOff)
Sets whether the viewer is allowed to change the cursor over the renderArea window.
void getViewport(short &left, short &bottom, short &width, short &height)
Returns viewport region with origin (lower-left corner) and size, given as pixel coordinates.
void setAutoClipping(SbBool onOrOff)
Sets the auto clipping plane.
SoXtViewer::DrawStyle getDrawStyle(SoXtViewer::DrawType type)
Queries the current drawing style in the main view.
SoSeparator * getSceneRoot()
Definition SoXtViewer.h:845
virtual SoDEPRECATED void adjustClippingPlanes()
void addFinishCallback(SoXtViewerCB *f, void *userData=NULL)
Adds finish callback routines on the viewer.
Definition SoXtViewer.h:654
virtual void setSceneGraph(SoNode *newScene)
Sets the scene graph to render.
virtual void setStereoAbsoluteAdjustments(SbBool absolute)
Specifies if stereo adjustments are absolute.
void reverseStereoView(SbBool reverse)
Sets reversal of the left and right views.
virtual void setCursorStyle(SoXtViewer::CursorStyle style)
Sets the cursor style.
virtual void setSeekMode(SbBool onOrOff)
Externally set the viewer into/out off seek mode (default OFF).
virtual float getStereoBalance()
Queries the stereo balance (the position of the zero parallax plane).
void setGoalFramesPerSecond(float goal)
Sets goal frames per second for the viewer to try to render.
float getStereoOffset()
Returns the stereo offset.
SoDirectionalLight * getHeadlight()
Returns the headlight node.
Definition SoXtViewer.h:454
virtual void toggleCameraType()
This routine will toggle the current camera from perspective to orthographic, and from orthographic b...
virtual const SbVec2s & getTopLeft()
Returns the position of the OpenGL drawing window in absolute screen coordinates (not relative to par...
void setFixedPercentage(float percent)
Sets fixed percentage for the viewer to render (0.0 to 1.0) Default is 1.0.
DecimationStrategy
list of decimation strategies
Definition SoXtViewer.h:291
@ FIXED_NUM_TRIANGLES
Try to fix number of triangles drawn.
Definition SoXtViewer.h:299
@ FIXED_PERCENTAGE
Use given decimation percentage.
Definition SoXtViewer.h:307
@ NORMAL
Decimation is not changed.
Definition SoXtViewer.h:295
@ FRAMES_PER_SECOND
Try to fix frames per second.
Definition SoXtViewer.h:303
void setPickRadius(float radius)
Sets the pick radius, in pixels, used by the viewer for picking and seeking actions.
void pasteView(Time eventTime)
Pastes the view.
void setFramesPerSecondCallback(SoXtViewerFPSCB *callback, void *userData=NULL)
Registers frames per second callback.
virtual SbBool isStereoBalanceNearFrac()
Returns TRUE when the stereo balance adjustement is defined as a fraction of the camera near distance...
float getGoalFramesPerSecond()
Gets goal frames per second for the viewer to try to render.
Definition SoXtViewer.h:736
virtual const SbVec2s & getBottomRight()
Returns the position of the OpenGL drawing window in absolute screen coordinates (not relative to par...
virtual void setViewing(SbBool onOrOff)
Sets whether the viewer is turned on or off.
SoCamera * getCamera()
Gets the edited camera.
Definition SoXtViewer.h:357
virtual SbBool isCameraHeightAnglePreserved() const
Query whether the SoPerspectiveCamera's heightAngle is preserved if the camera is changed to an SoOrt...
Definition SoXtViewer.h:388
virtual SbBool isStereoAbsoluteAdjustments() const
Queries if the stereo adjustments are absolute.
Definition SoXtViewer.h:812
void setDetailSeek(SbBool onOrOff)
When the viewer is in seek mode, left mouse clicks initiate a pick, and the viewer changes its orient...
Definition SoXtViewer.h:609
virtual void setStereoBalance(float balance, SbBool nearFrac)
Sets the stereo balance (the position of the zero parallax plane) and specifies whether the balance v...
SbBool isFullRenderingWhenStill()
Queries if the viewer will render at full resolution when it sits still for a certain period of time.
Definition SoXtViewer.h:766
virtual void setStereoActive(SbBool activate)
Sets stereo activation.
virtual void resetToHomePosition()
Restores the camera values.
SoType getCameraType()
Gets the camera type that will be created by the viewer if no cameras are found in the scene graph (s...
Definition SoXtViewer.h:373
SoXtViewer::CursorStyle getCursorStyle()
Returns the cursor style.
Definition SoXtViewer.h:841
SoBaseStereo * getStereoViewType()
Returns the stereo view type.
virtual void setStereoViewing(SbBool onOrOff)
Turns stereo viewing on/off on the viewer (default off).
float getCurrentDecimationPercentage()
Returns the Decimation Percentage the viewer used in its last render.
SoXtViewer::BufferType getBufferingType()
Gets the current buffering type in the main view.
Definition SoXtViewer.h:520
SoXtViewer::DecimationStrategy getDecimationStrategy()
Gets strategy to use to decide on decimation value.
Definition SoXtViewer.h:707
virtual void setPreserveCameraHeightAngle(SbBool flag)
If TRUE, an SoPerspectiveCamera's heightAngle is preserved if the camera is changed to an SoOrthograp...
Definition SoXtViewer.h:380
virtual SbBool isViewerDoubleBuffer()
Queries if viewer is double buffered.
virtual SoCamera * getViewerCamera()
Returning the camera allows the SoBaseStereo to manipulate it to achieve the stereo effect.
virtual void viewAll()
Changes the camera position to view the entire scene (the camera zoom or orientation isn't changed).
void setNumSamples(int numFrames)
Sets how many frames should be timed before frames per second callback is called, default is 10.
virtual const SbVec2s & getSize()
Returns the size of the OpenGL drawing window in absolute screen coordinates (not relative to parent ...
SbBool isDetailSeek()
Queries whether the viewer is in seek mode.
Definition SoXtViewer.h:614
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 setCameraTypeChangeCallback(SoXtViewerCameraTypeChangeCB *callback, void *userdata)
Defines a callback which is called each time the camera type has changed (change from SoPerspectiveCa...
SbBool isCursorEnabled() const
Queries whether the viewer is allowed to change the cursor over the renderArea window.
Definition SoXtViewer.h:558
void removeStartCallback(SoXtViewerCB *f, void *userData=NULL)
Removes start callback routine from the viewer.
Definition SoXtViewer.h:662
void setStereoOffset(float dist)
Sets the stereo offset.
CursorStyle
Classic cursors are all white and tend to disappear over white geometry or white background.
Definition SoXtViewer.h:316
@ SHADOW
Improved cursors using "shadow".
Definition SoXtViewer.h:328
@ CLASSIC
Standard Open Inventor cursors.
Definition SoXtViewer.h:320
@ XOR
Improved cursors using XOR.
Definition SoXtViewer.h:324
SbBool isAutoClipping() const
Queries if auto clipping is ON.
Definition SoXtViewer.h:575
virtual void enableSeekWithOrtho(SbBool flag)
If FALSE, the seek functionality is disabled for an SoOrthographicCamera.
Definition SoXtViewer.h:394
DrawType
DrawType.
Definition SoXtViewer.h:261
@ INTERACTIVE
Applies to rendering while interactive viewing.
Definition SoXtViewer.h:269
@ STILL
Applies to static rendering.
Definition SoXtViewer.h:265
virtual void setCamera(SoCamera *cam)
Sets the edited camera.
int32_t getGoalNumberOfTriangles()
Gets goal number of triangles for the viewer to try to render.
Definition SoXtViewer.h:722
void removeFinishCallback(SoXtViewerCB *f, void *userData=NULL)
Removes finish callback routine from the viewer.
Definition SoXtViewer.h:670
DrawStyle
list of possible drawing styles
Definition SoXtViewer.h:216
@ VIEW_LOW_RES_POINT
Low complexity point + no depth clearing.
Definition SoXtViewer.h:252
@ VIEW_LOW_RES_LINE
Low complexity wireframe + no depth clearing.
Definition SoXtViewer.h:248
@ VIEW_BBOX
Bounding box draw style.
Definition SoXtViewer.h:244
@ VIEW_POINT
Point draw style.
Definition SoXtViewer.h:240
@ VIEW_HIDDEN_LINE
Render only the frontmost lines.
Definition SoXtViewer.h:224
@ VIEW_LINE
Wireframe draw style.
Definition SoXtViewer.h:236
@ VIEW_SAME_AS_STILL
Forces the INTERACTIVE draw style to match STILL.
Definition SoXtViewer.h:256
@ VIEW_NO_TEXTURE
Render without textures.
Definition SoXtViewer.h:228
@ VIEW_LOW_COMPLEXITY
Render low complexity and no texture.
Definition SoXtViewer.h:232
@ VIEW_AS_IS
Unchanged.
Definition SoXtViewer.h:220
SbBool isStereoViewReversed()
Queries reversal of the left and right views.
virtual void setBufferingType(SoXtViewer::BufferType type)
Sets the current buffering type in the main view (default SoXtViewer::BUFFER_DOUBLE).
virtual void setDrawStyle(SoXtViewer::DrawType type, SoXtViewer::DrawStyle style)
Sets the current drawing style in the main view.
int SbBool
Boolean type.
Definition SbBase.h:87