Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoQtViewer.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 : Alain Dumesny (MMM yyyy)
22**=======================================================================*/
23
24
25#ifndef _SO_QT_VIEWER_
26#define _SO_QT_VIEWER_
27
28#include <Inventor/Qt/OivQtCompat.h>
29#include <Inventor/Qt/SoQtRenderArea.h>
30
31#include <QPixmap>
32
33#include <Inventor/SoType.h>
34#include <Inventor/misc/SoCallbackList.h>
35#include <Inventor/SbElapsedTime.h>
36#include <Inventor/events/SoKeyboardEvent.h>
37#include <Inventor/Gui/viewers/SoGuiViewer.h>
38
39#include <Inventor/components/stereo/SoStereoViewer.h>
40
41// classes
42class SoNode;
44class SoGroup;
45class SoRotation;
46class SoCamera;
47class SoDrawStyle;
48class SoLightModel;
49class SoFieldSensor;
50//class SoQtClipboard;
51class SoQtViewer;
53class SbPList;
54class SoSeparator;
55class SoSwitch;
56class SoComplexity;
57class SoPackedColor;
59class SoSFTime;
60class SoQtInputFocus;
61class SoAlarmSensor;
62class SoNodeSensor;
64class SoStereoViewer;
65class SoBaseStereo;
66class ScRayPickAction;
67
73typedef void SoQtViewerCB( void* userData, SoQtViewer* viewer );
74
80typedef void SoQtViewerCameraTypeChangeCB( void* userData, SoCamera* camera, SoQtViewer* viewer );
81
87typedef void SoQtViewerFPSCB( float fps, void* userData, SoQtViewer* viewer );
88
94typedef void SoQtViewerDecimationPercentageCB( float percentage, void* userData, SoQtViewer* viewer );
95
97//
98// Class: SoQtViewer
99//
100// The Viewer component is the abstract base class for all viewers.
101// It is subclassed from renderArea, adding viewing semantics to Inventor
102// rendering.
103//
105
177{
178
179 Q_OBJECT
180
181 public:
182
193 enum Type
194 {
202 EDITOR
203 };
204
205
254
267
284
305
325
334 virtual void setSceneGraph( SoNode* newScene );
335
340
341#ifndef HIDDEN_FROM_DOC
342 void saveSceneGraph( const char* fileName ) ;
343#endif //HIDDEN_FROM_DOC
344
350 virtual void setCamera( SoCamera* cam );
351
355 SoCamera* getCamera() { return m_guiViewer->getCamera(); }
356
365 virtual void setCameraType( SoType type );
366
371 SoType getCameraType() { return m_guiViewer->getCameraType(); }
372
379 { m_guiViewer->setPreserveCameraHeightAngle( flag ); }
380
386 virtual SbBool isCameraHeightAnglePreserved() const { return m_guiViewer->isCameraHeightAnglePreserved(); }
387
392 virtual void enableSeekWithOrtho( SbBool flag ) { m_guiViewer->enableSeekWithOrtho( flag ); }
393
398 virtual SbBool isSeekWithOrthoEnabled() const { return m_guiViewer->isSeekWithOrthoEnabled(); }
399
418 virtual void viewAll();
419
423 virtual void saveHomePosition();
424
428 virtual void resetToHomePosition();
429
435 void* userdata );
436
443 virtual void setHeadlight( SbBool onOrOff );
444
448 SbBool isHeadlight() { return m_guiViewer->isHeadlight(); }
449
453 SoDirectionalLight* getHeadlight() { return m_guiViewer->getHeadlight(); }
454
504 SoQtViewer::DrawStyle style );
509
515
520 { return (SoQtViewer::BufferType)m_guiViewer->getBufferingType(); }
521
534 virtual void setViewing( SbBool onOrOff );
535
539 SbBool isViewing() const { return m_guiViewer->isViewing(); }
540
551 virtual void setCursorEnabled( SbBool onOrOff );
552
557 SbBool isCursorEnabled() const { return m_guiViewer->isCursorEnabled(); }
558
569 void setAutoClipping( SbBool onOrOff );
570
574 SbBool isAutoClipping() const { return m_guiViewer->isAutoClipping(); }
575
583 virtual void setStereoViewing( SbBool onOrOff );
584
590
594 void setStereoOffset( float dist );
595
600
608 void setDetailSeek( SbBool onOrOff ) { m_guiViewer->setDetailSeek( onOrOff ); }
609
613 SbBool isDetailSeek() { return m_guiViewer->isDetailSeek(); }
614
627 void setSeekTime( float seconds ) { m_guiViewer->setSeekTime( seconds ); }
628
632 float getSeekTime() { return m_guiViewer->getSeekTime(); }
633
642 void addStartCallback( SoQtViewerCB* f, void* userData = NULL )
643 { m_guiViewer->addStartCallback( (SoGuiViewerCB*)f, userData ); }
644
653 void addFinishCallback( SoQtViewerCB* f, void* userData = NULL )
654 { m_guiViewer->addFinishCallback( (SoGuiViewerCB*)f, userData ); }
655
661 void removeStartCallback( SoQtViewerCB* f, void* userData = NULL )
662 { m_guiViewer->removeStartCallback( (SoGuiViewerCB*)f, userData ); }
663
669 void removeFinishCallback( SoQtViewerCB* f, void* userData = NULL )
670 { m_guiViewer->removeFinishCallback( (SoGuiViewerCB*)f, userData ); }
671
678 virtual void recomputeSceneSize();
679
680 // --- Large Model Viewing additions:
681
688
693 { return (SoQtViewer::DecimationStrategy)m_guiViewer->getDecimationStrategy(); }
694
702 void setGoalNumberOfTriangles( int32_t goal );
703
707 int32_t getGoalNumberOfTriangles() { return m_guiViewer->getGoalNumberOfTriangles(); }
708
716 void setGoalFramesPerSecond( float goal );
717
721 float getGoalFramesPerSecond() { return m_guiViewer->getGoalFramesPerSecond(); }
722
730 void setFixedPercentage( float percent );
731
735 float getFixedPercentage() { return m_guiViewer->getFixedPercentage(); }
736
746
751 SbBool isFullRenderingWhenStill() { return m_guiViewer->isFullRenderingWhenStill(); }
752
756 SbBool isStillNow() { return m_guiViewer->isStillNow(); }
757
761 void setFramesPerSecondCallback( SoQtViewerFPSCB* callback, void* userData = NULL );
762
767 void setNumSamples( int numFrames );
772 int getNumSamples() { return m_guiViewer->getNumSamples(); }
773
778
783
784 // Implementing methods from the pure virtual class from SoStereoViewer
785
790
795
802 virtual void actualRendering();
803
808 virtual const SbVec2s& getSize();
809
817 virtual const SbVec2s& getTopLeft() ;
818
826 virtual const SbVec2s& getBottomRight() ;
827
835
840
844 void reverseStereoView( SbBool reverse );
845
850
854 virtual void setStereoAbsoluteAdjustments( SbBool absolute );
855
859 virtual SbBool isStereoAbsoluteAdjustments() const { return m_guiViewer->isStereoAbsoluteAdjustments(); }
860
865 virtual void setStereoBalance( float balance, SbBool nearFrac = false );
866
870 virtual float getStereoBalance();
871
877
882 virtual void setStereoActive( SbBool activate ) ;
883
888
892 void setViewport( short left, short bottom, short width, short height );
893
897 void getViewport( short& left, short& bottom, short& width, short& height );
898
902 SoSeparator* getSceneRoot() { return m_guiViewer->getSceneRoot(); }
903
919
924 { return (SoQtViewer::CursorStyle)m_guiViewer->getCursorStyle(); }
925
935 void setAutoClipTolerance ( float tolerance ) { m_guiViewer->setAutoClipTolerance( tolerance ); }
936
940 float getAutoClipTolerance () const { return m_guiViewer->getAutoClipTolerance(); }
941
966 virtual void setCameraSceneGraph(SoNode *cameraSceneGraph);
967
972
977 void enableMouseWheelDolly(SbBool onOff) { m_guiViewer->enableMouseWheelDolly( onOff ); }
978
987 virtual void setSeekMode( SbBool onOrOff );
988
992 SbBool isSeekMode() { return m_guiViewer->isSeekMode(); }
993
1003 virtual void toggleCameraType();
1004
1014 void setPickRadius( float radius );
1015
1019 float getPickRadius() const;
1020
1021#if 1 SoDEPRECATED
1028 virtual void adjustClippingPlanes();
1029
1030#endif
1037 SbBool getDepthValue(int x, int y, float &depth)
1038 {
1039 return m_guiViewer->getDepthValue(x, y, depth);
1040 }
1041
1042private:
1043
1044 SoGuiViewer* getGuiViewer() const;
1045
1046 virtual ~SoQtViewer();
1047
1048 // redefine this routine to also correctly set the buffering type
1049 // on the viewer.
1050 virtual void setNormalVisual( QSurfaceFormat vi );
1051
1052 SbBool isInteractive() const;
1053
1054 void saveSceneGraph( const SbString& fileName );
1055
1056 // These members are public only for retro compatibility purposes.
1057 // They should not be called directly. Use their accessors instead.
1058 SoCamera* camera;
1059 SbBool createdCursors, viewingFlag;
1060 CursorStyle cursorStyle;
1061 SoSeparator* sceneRoot;
1062 float sceneSize;
1063 SoBaseStereo* stereoViewType;
1064 SbBool m_seekWithOrtho, m_preserveHeightAngle, cursorEnabledFlag, seekDistAsPercentage, computeSeekVariables;
1065 float m_previousHeightAngle, viewerSpeed, seekDistance;
1066 SoQtViewer::Type type;
1067 SoNode* sceneGraph;
1068 SbVec3f seekPoint, seekNormal, oldCamPosition, newCamPosition;
1069 SbRotation oldCamOrientation, newCamOrientation;
1070
1071 void setCurrentDrawStyle(SoQtViewer::DrawStyle style);
1072
1076 virtual void defineDefaultCursor( const QCursor& cursor );
1077
1081 virtual void defineFlyCursor( const QCursor& cursor );
1082
1086 virtual void defineRotationCursor( const QCursor& cursor );
1087
1091 virtual void defineSeekCursor( const QCursor& cursor );
1092
1096 virtual void defineTranslationCursor( const QCursor& cursor );
1097
1101 virtual void defineUpCursor( const QCursor& cursor );
1102
1106 virtual void defineViewingCursor( const QCursor& cursor );
1107
1111 virtual void defineWalkCursor( const QCursor& cursor );
1112
1116 virtual void defineZoomCursor( const QCursor& cursor );
1117
1118 virtual SoGLContext* getViewerContext() { return getNormalSoContext(); }
1119 virtual SoSceneManager* getViewerSceneManager() { return getSceneManager(); }
1120
1121 private:
1122
1123 // Constructor/Destructor
1124 SoQtViewer( QWidget* parent,
1125 const char* name,
1126 SbBool buildInsideParent,
1127 SoQtViewer::Type type,
1128 SbBool buildNow,
1129 SbBool sync = true );
1130
1131 SoQtViewer( QWidget* parent,
1132 const char* name,
1133 SbBool buildInsideParent,
1134 SoQtViewer::Type type,
1135 SbBool buildNow,
1136 SbBool sync,
1137 SoGuiViewer* guiViewer );
1138
1139 // global vars
1140 SbBool altSwitchBack; // flag to return to PICK after an Alt release
1141
1142 // Previously declared in subclasses (before v2.6)
1143 // Note that each subclass viewer uses a subset of these standard
1144 // cursor names. Note that the Fly and Walk viewers used slightly
1145 // different names (that were too generic) for their specific cursors
1146 // (the last two in the list) prior to v2.6.
1147 QCursor normalCursor, dollyCursor, panCursor, rollCursor, seekCursor,
1148 spinCursor, upCursor, flyCursor, walkCursor;
1149
1150 // Load cursor definitions from resource file.
1151 // previously declared in subclasses (before v2.6).
1152 // Subclasses may override, but are not required to do so
1153 // unless they need more or different cursor definitions.
1154 virtual void defineCursors();
1155
1156 // Subclasses should (and do) override this method! (new in v2.6)
1157 // (The setCursorStyle method calls this to force a dynamic change)
1158 virtual void updateCursor() {};
1159
1160 // Subclasses can call this routine to handle a common set of events. A Boolean
1161 // is returned to specify whether the event was handled by the base class.
1162 // Currently handled events and functions are :
1163 // 'Esc' key - toggles viewing on/off
1164 // When viewing OFF - send all events down the scene graph
1165 // When camera == NULL - Discard all viewing events
1166 // 'home' Key - calls resetToHomePosition()
1167 // 's' Key - toggles seek on/off
1168 // Arrow Keys - moves the camera up/down/right/left in the viewing plane
1169 SbBool processCommonEvents( QEvent* xe );
1170
1171 // Invokes the start and finish viewing callbacks. Subclasses NEED to call
1172 // those routines when they start and finish doing interactive viewing
1173 // operations so that correct interactive drawing style and buffering
1174 // types, as well as application callbacks, gets set and called properly.
1175 //
1176 // Those routines simply increment and decrement a counter. When the counter
1177 // changes from 0->1 the start viewing callbacks are called. When the counter
1178 // changes back from 1->0 the finish viewing callbacks are called.
1179 // The counter approach enables different parts of a viewer to call those
1180 // routines withough having to know about each others (which is not
1181 //
1182 void interactiveCountInc();
1183 void interactiveCountDec();
1184 int getInteractiveCount() { return m_guiViewer->getInteractiveCount(); }
1185
1186 //
1187 // This routine is used by subclasses to initiate the seek animation. Given a
1188 // screen mouse location, this routine will return the picked point
1189 // and the normal at that point. It will also schedule the sensor to animate
1190 // if necessary. The routine retuns TRUE if something got picked...
1191 //
1192 // Note: if detailSeek is on, the point and normal correspond to the exact
1193 // 3D location under the cursor.
1194 // if detailSeek if off, the object bbox center and the camera
1195 // orientation are instead returned.
1196 SbBool seekToPoint( const SbVec2s &mouseLocation );
1197
1198 //
1199 // Subclasses CAN redefine this to interpolate camera position/orientation
1200 // while the seek animation is going on (called by animation sensor).
1201 // The parameter t is a [0,1] value corresponding to the animation percentage
1202 // completion. (i.e. a value of 0.25 means that animation is only 1/4 of the way
1203 // through).
1204 //
1205 virtual void interpolateSeekAnimation( float t );
1206 virtual void computeSeekFinalOrientation();
1207
1208 // redefine this routine to adjust the camera clipping planes just
1209 // before doing a redraw. The sensor will be unschedule after the camera
1210 // is changed in the base class to prevent a second redraw from occuring.
1211 virtual void actualRedraw();
1212
1213 // This is called during a paste.
1214 // Subclasses may wish to redefine this in a way that
1215 // keeps their viewing paradigm intact.
1216 virtual void changeCameraValues( SoCamera* newCamera );
1217
1218 //
1219
1220 // Convenience routines which subclasses can use when drawing viewer
1221 // feedback which may be common across multiple viewers. There is for
1222 // example a convenience routine which sets an orthographics projection
1223 // and a method to draw common feedback like the roll anchor (used by
1224 // a couple of viewers).
1225 //
1226 // All drawing routines assume that the window and projection is
1227 // already set by the caller.
1228 //
1229 // set an ortho projection of the glx window size - this also turns
1230 // zbuffering off and lighting off (if necessary).
1231 static void setFeedbackOrthoProjection( const SbVec2s& glxSize );
1232
1233 // restores the zbuffer and lighting state that was changed when
1234 // setFeedbackOrthoProjection() was last called.
1235 static void restoreGLStateAfterFeedback();
1236
1237 // draws a simple 2 colored cross at given position
1238 static void drawViewerCrossFeedback( SbVec2s loc );
1239
1240 // draws the anchor feedback given center of rotation and mouse location
1241 static void drawViewerRollFeedback( SbVec2s center, SbVec2s loc );
1242
1243 virtual void widgetChanged( QWidget* w );
1244
1245 // redefine this for a better default draw style (need to wait for context)
1246 virtual void afterRealizeHook();
1247
1248 // auto clipping routines
1249 virtual void adjustCameraClippingPlanes();
1250
1251 // Override redraw() in order to calculate render time including
1252 // frame buffer switch
1253 virtual void redraw();
1254
1255 // Subclasses may override this function to change way that
1256 // viewer tries to calculate decimation percentage for
1257 // DecimationStrategy FRAMES_PER_SECOND.
1258 // Given goal frames per second, timeTaken in last render,
1259 // and last decimation value used, this function should return
1260 // decimation percentage value to use in next render.
1261 virtual float decimationForFramesPerSecond( float fps,
1262 double timeTaken,
1263 float decimation );
1264
1265 // Subclasses may override this function to change way that
1266 // viewer tries to calculate decimation percentage for
1267 // DecimationStrategy FIXED_NUM_TRIANGLES.
1268 // Given goal number of triangles to reach, this function
1269 // should return decimation percentage value to use.
1270 virtual float decimationForNumTriangles( uint32_t numTris );
1271
1272 // Return a pointer to the QtWidget for stereo
1273 void* getViewer() {return (void*)this;}
1274
1275 protected Q_SLOTS:
1279 void processCommonEnterEvents( unsigned int state );
1280
1281 private:
1282
1283#if !defined(_WIN32) && !defined(__APPLE__)
1284 unsigned int m_zoomBoxPixel;
1285#endif // UNIX
1286
1287 void constructorCommon( SoQtViewer::Type t, SbBool buildNow );
1288 void constructorCommon2( SoQtViewer::Type t, SbBool buildNow );
1289
1290 SoGuiViewer* m_guiViewer; // Implementation class for SoXxViewer
1291
1292 // current state vars
1293 SoQtInputFocus* inputFocus;
1294 SbBool m_firstRealize;
1295
1296 // set the zbuffer on current window to correct state
1297 void setZbufferState();
1298 SbBool isZbufferOff();
1299 void arrowKeyPressed( int rawKey );
1300
1301 // Decimation strategy additions:
1302 static SoGLRenderAction::AbortCode renderAbortCB( void* data );
1303 SoAlarmSensor* stillSensor;
1304 static void alarmCB( void* thisp, SoSensor* ) { ((SoQtViewer*)thisp)->stillSensorCalled(); }
1305 void stillSensorCalled();
1306
1307 // PoViews
1323 static SbBool viewingEventCB( SoQtViewer* viewer, QEvent* anyEvent );
1324
1325 // Seek animation
1326 static void seekAnimationSensorCB( void* p, SoSensor* sensor );
1327
1328 SoNode* m_cameraSceneGraph; //SUPPR
1329
1330 // Used to compute the value returned by getSize method
1331 SbVec2s m_size;
1332};
1333
1334#endif /* _SO_QT_VIEWER_ */
1335
1336
List of generic (void *) pointers.
Definition SbPList.h:77
Class for representing a rotation.
Definition SbRotation.h:126
Class for smart character strings.
Definition SbString.h:202
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.
SoGLContext * getNormalSoContext()
Gets the current context, which is needed as an argument to glXMakeCurrent() (on Xt) or SbGlContextHe...
<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...
Definition SoQtViewer.h:177
virtual void setStereoAbsoluteAdjustments(SbBool absolute)
If TRUE, use stereo absolute adjustments.
SbBool isFullRenderingWhenStill()
Queries if the viewer will render at full resolution when it sits still for a certain period of time.
Definition SoQtViewer.h:751
void setCameraTypeChangeCallback(SoQtViewerCameraTypeChangeCB *callback, void *userdata)
Defines a callback which is called each time the camera type has changed (change from SoPerspectiveCa...
virtual SbBool isSeekWithOrthoEnabled() const
Query whether the seek functionality is enabled for an SoOrthographicCamera.
Definition SoQtViewer.h:398
virtual SbBool isStereoActive()
Returns TRUE if stereo is active.
virtual SbBool isStereoBalanceNearFrac()
Returns TRUE if the stereo balance adjustement is defined as a fraction of the camera near distance.
virtual SbBool isViewerDoubleBuffer()
Returns TRUE if viewer is double buffered.
float getStereoOffset()
Returns the stereo offset.
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.
SbBool isStereoViewReversed()
Returns TRUE if the left and right eye views are reversed.
float getFixedPercentage()
Gets fixed percentage for the viewer to render (0.0 to 1.0)
Definition SoQtViewer.h:735
SbBool isSeekMode()
Returns TRUE if currently in seek mode.
Definition SoQtViewer.h:992
float getCurrentDecimationPercentage()
Returns the Decimation Percentage the viewer used in its last render.
void setFramesPerSecondCallback(SoQtViewerFPSCB *callback, void *userData=NULL)
Registers frames per second callback.
Type
Editor types.
Definition SoQtViewer.h:194
@ EDITOR
Camera is added to user's scene.
Definition SoQtViewer.h:202
@ BROWSER
Camera views scene, but is not added to scene.
Definition SoQtViewer.h:198
SbBool isStillNow()
Returns whether the viewer is currently still.
Definition SoQtViewer.h:756
SoQtViewer::BufferType getBufferingType()
Gets the current buffering type in the main view.
Definition SoQtViewer.h:519
void setFixedPercentage(float percent)
Sets fixed percentage for the viewer to render (0.0 to 1.0) Default is 1.0.
void setPickRadius(float radius)
Sets the pick radius, in pixels, used by the viewer for picking and seeking actions.
virtual void enableSeekWithOrtho(SbBool flag)
If FALSE, the seek functionality is disabled for an SoOrthographicCamera.
Definition SoQtViewer.h:392
void setDecimationPercentageCallback(SoQtViewerDecimationPercentageCB *callback, void *userData=NULL)
Registers decimation percentage callback.
virtual void setCursorStyle(SoQtViewer::CursorStyle style)
Sets the cursor style.
void setDetailSeek(SbBool onOrOff)
When the viewer is in seek mode, left mouse clicks initiate a pick, and the viewer changes its orient...
Definition SoQtViewer.h:608
virtual SbBool isStereoAbsoluteAdjustments() const
Returns TRUE if stereo absolute adjustments are enabled.
Definition SoQtViewer.h:859
float getGoalFramesPerSecond()
Gets goal frames per second for the viewer to try to render.
Definition SoQtViewer.h:721
virtual void setSeekMode(SbBool onOrOff)
Set the viewer into/out of seek mode (default OFF).
virtual void setViewing(SbBool onOrOff)
Sets whether the viewer is turned on or off.
void removeFinishCallback(SoQtViewerCB *f, void *userData=NULL)
Removes finish callback routine from the viewer.
Definition SoQtViewer.h:669
virtual SoDEPRECATED void adjustClippingPlanes()
Along with the manipulation of the camera, SoBaseStereo needs to set the scene appropriately when cha...
void removeStartCallback(SoQtViewerCB *f, void *userData=NULL)
Removes start callback routine from the viewer.
Definition SoQtViewer.h:661
virtual void toggleCameraType()
This routine will toggle the current camera from perspective to orthographic, and from orthographic b...
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 setCameraSceneGraph(SoNode *cameraSceneGraph)
Sets the sub-scene graph to be used for viewAll computation.
virtual const SbVec2s & getBottomRight()
Returns the position of the OpenGL drawing window in absolute screen coordinates (not relative to par...
void setStereoViewType(SoBaseStereo *stereo)
Set an implementation of stereo viewing to use.
void addFinishCallback(SoQtViewerCB *f, void *userData=NULL)
Adds finish callback routines on the viewer.
Definition SoQtViewer.h:653
virtual void setDrawStyle(SoQtViewer::DrawType type, SoQtViewer::DrawStyle style)
Sets the current drawing style in the main view.
void setAutoClipping(SbBool onOrOff)
Sets the auto clipping plane.
void processCommonEnterEvents(unsigned int state)
Process common enter events of the viewer.
DrawType
Draw types.
Definition SoQtViewer.h:257
@ STILL
Applies to static rendering.
Definition SoQtViewer.h:261
@ INTERACTIVE
Applies to rendering while interactive viewing.
Definition SoQtViewer.h:265
SoNode * getCameraSceneGraph()
Gets the sub-scene graph to be viewed.
virtual void actualRendering()
This method is called automatically when the viewer requests that its SoBaseStereo object perform ste...
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 SoNode * getSceneGraph()
Gets the scene graph to render.
void SoQtViewerCameraTypeChangeCB(void *userData, SoCamera *camera, SoQtViewer *viewer)
External camera type change callback functions registered with the viewer should be of this type.
Definition SoQtViewer.h:80
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,...
SoSeparator * getSceneRoot()
Returns the viewer's scene root.
Definition SoQtViewer.h:902
virtual const SbVec2s & getTopLeft()
Returns the position of the OpenGL drawing window in absolute screen coordinates (not relative to par...
CursorStyle
Curors styles.
Definition SoQtViewer.h:311
@ SHADOW
Improved cursors using "shadow".
Definition SoQtViewer.h:323
@ CLASSIC
Standard Open Inventor cursors.
Definition SoQtViewer.h:315
@ XOR
Improved cursors using XOR.
Definition SoQtViewer.h:319
float getSeekTime()
Queries the seek time.
Definition SoQtViewer.h:632
virtual void setStereoViewing(SbBool onOrOff)
Turns stereo viewing on/off on the viewer (default off).
virtual const SbVec2s & getSize()
Returns the size of the OpenGL drawing window in absolute screen coordinates (not relative to parent ...
virtual float getStereoBalance()
Returns the current stereo balance.
virtual SbBool isStereoViewing()
Queries if stereo viewing is on or off on the viewer.
virtual SoCamera * getViewerCamera()
Returns the camera so SoBaseStereo can manipulate it to achieve the stereo effect.
DrawStyle
List of possible drawing styles.
Definition SoQtViewer.h:212
@ VIEW_LOW_COMPLEXITY
Render low complexity and no texture.
Definition SoQtViewer.h:228
@ VIEW_POINT
Point draw style.
Definition SoQtViewer.h:236
@ VIEW_HIDDEN_LINE
Render only the frontmost lines.
Definition SoQtViewer.h:220
@ VIEW_NO_TEXTURE
Render without textures.
Definition SoQtViewer.h:224
@ VIEW_LOW_RES_LINE
Low complexity wireframe + no depth clearing.
Definition SoQtViewer.h:244
@ VIEW_AS_IS
Unchanged.
Definition SoQtViewer.h:216
@ VIEW_LOW_RES_POINT
Low complexity point + no depth clearing.
Definition SoQtViewer.h:248
@ VIEW_SAME_AS_STILL
Forces the INTERACTIVE draw style to match STILL.
Definition SoQtViewer.h:252
@ VIEW_LINE
Wireframe draw style.
Definition SoQtViewer.h:232
@ VIEW_BBOX
Bounding box draw style.
Definition SoQtViewer.h:240
SbBool isAutoClipping() const
Queries if auto clipping is ON.
Definition SoQtViewer.h:574
SbBool isDetailSeek()
Queries whether the viewer is in seek mode.
Definition SoQtViewer.h:613
SoQtViewer::DrawStyle getDrawStyle(SoQtViewer::DrawType type)
Queries the current drawing style in the main view.
SoQtViewer::DecimationStrategy getDecimationStrategy()
Gets strategy to use to decide on decimation value.
Definition SoQtViewer.h:692
BufferType
List of different buffering types.
Definition SoQtViewer.h:270
@ BUFFER_SINGLE
Single buffer.
Definition SoQtViewer.h:274
@ BUFFER_INTERACTIVE
Double buffer while interactive viewing.
Definition SoQtViewer.h:282
@ BUFFER_DOUBLE
Double buffer.
Definition SoQtViewer.h:278
void setNumSamples(int numFrames)
Sets how many frames should be timed before frames per second callback is called, default is 10.
virtual void setSceneGraph(SoNode *newScene)
Sets the scene graph to render.
virtual void setCamera(SoCamera *cam)
Sets the edited camera.
SbBool isViewing() const
Queries whether the viewer is turned on or off.
Definition SoQtViewer.h:539
virtual void setStereoActive(SbBool activate)
If TRUE, stero is activated.
virtual void setPreserveCameraHeightAngle(SbBool flag)
If TRUE, an SoPerspectiveCamera's heightAngle is preserved if the camera is changed to an SoOrthograp...
Definition SoQtViewer.h:378
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 SoQtViewerDecimationPercentageCB(float percentage, void *userData, SoQtViewer *viewer)
External decimation percentage callback functions registered with the viewer should be of this type.
Definition SoQtViewer.h:94
virtual void setBufferingType(SoQtViewer::BufferType type)
Sets the current buffering type in the main view (default SoQtViewer::BUFFER_DOUBLE).
void setStereoOffset(float dist)
Sets the stereo offset.
void SoQtViewerFPSCB(float fps, void *userData, SoQtViewer *viewer)
External FPS callback functions registered with the viewer should be of this type.
Definition SoQtViewer.h:87
SoQtViewer::CursorStyle getCursorStyle()
Returns the cursor style.
Definition SoQtViewer.h:923
virtual void resetToHomePosition()
Restores the camera values.
virtual void saveHomePosition()
Saves the camera values.
SbBool isCursorEnabled() const
Queries whether the viewer is allowed to change the cursor over the renderArea window.
Definition SoQtViewer.h:557
virtual SbBool isCameraHeightAnglePreserved() const
Query whether the SoPerspectiveCamera's heightAngle is preserved if the camera is changed to an SoOrt...
Definition SoQtViewer.h:386
virtual void viewAll()
Changes the camera position to view the entire scene (the camera zoom or orientation isn't changed).
void SoQtViewerCB(void *userData, SoQtViewer *viewer)
External interactive callback functions registered with the viewer should be of this type.
Definition SoQtViewer.h:73
SoBaseStereo * getStereoViewType()
Returns the current stereo implementation.
SoType getCameraType()
Gets the camera type that will be created by the viewer if no cameras are found in the scene graph (s...
Definition SoQtViewer.h:371
void addStartCallback(SoQtViewerCB *f, void *userData=NULL)
Adds start callback routine on the viewer.
Definition SoQtViewer.h:642
DecimationStrategy
List of decimation strategies.
Definition SoQtViewer.h:287
@ FIXED_PERCENTAGE
Use given decimation percentage.
Definition SoQtViewer.h:303
@ FIXED_NUM_TRIANGLES
Try to fix number of triangles drawn.
Definition SoQtViewer.h:295
@ FRAMES_PER_SECOND
Try to fix frames per second.
Definition SoQtViewer.h:299
@ NORMAL
Decimation is not changed.
Definition SoQtViewer.h:291
virtual void setHeadlight(SbBool onOrOff)
Turns the headlight on/off (default on).
SbBool isHeadlight()
Queries if the headlight is on.
Definition SoQtViewer.h:448
void setGoalNumberOfTriangles(int32_t goal)
Sets goal number of triangles for the viewer to try to render.
void setDecimationStrategy(SoQtViewer::DecimationStrategy strategy)
Sets strategy to use to decide on decimation value.
void reverseStereoView(SbBool reverse)
If TRUE, reverse the left and right eye views.
void enableFullRenderingWhenStill(SbBool onOff)
If this flag is set, the viewer will render at full resolution when it sits still for a certain perio...
SoDirectionalLight * getHeadlight()
Returns the headlight node.
Definition SoQtViewer.h:453
void setAutoClipTolerance(float tolerance)
Sets the auto clipping tolerance value.
Definition SoQtViewer.h:935
float getAutoClipTolerance() const
Gets the auto clipping tolerance value.
Definition SoQtViewer.h:940
void setGoalFramesPerSecond(float goal)
Sets goal frames per second for the viewer to try to render.
float getPickRadius() const
Returns the current pick radius for picking and seeking actions.
void enableMouseWheelDolly(SbBool onOff)
Enable/disable moving the camera with the mouse wheel, TRUE by default.
Definition SoQtViewer.h:977
void setSeekTime(float seconds)
Sets the time a seek takes to change to the new camera location.
Definition SoQtViewer.h:627
SoCamera * getCamera()
Gets the edited camera.
Definition SoQtViewer.h:355
virtual void setCursorEnabled(SbBool onOrOff)
Sets whether the viewer is allowed to change the cursor over the renderArea window.
int getNumSamples()
Gets how many frames should be timed before frames per second callback is called.
Definition SoQtViewer.h:772
int32_t getGoalNumberOfTriangles()
Gets goal number of triangles for the viewer to try to render.
Definition SoQtViewer.h:707
virtual void setStereoBalance(float balance, SbBool nearFrac=false)
Sets the stereo balance (the position of the zero parallax plane).
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
Stores runtime type information.
Definition SoType.h:98
int SbBool
Boolean type.
Definition SbBase.h:87