Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoQtViewer.h
Go to the documentation of this file.
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-2020 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
30
31#include <QPixmap>
32
33#include <Inventor/SoType.h>
38
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
71typedef void SoQtViewerCB( void* userData, SoQtViewer* viewer );
72
76typedef void SoQtViewerCameraTypeChangeCB( void* userData, SoCamera* camera, SoQtViewer* viewer );
77
81typedef void SoQtViewerFPSCB( float fps, void* userData, SoQtViewer* viewer );
82
86typedef void SoQtViewerDecimationPercentageCB( float percentage, void* userData, SoQtViewer* viewer );
87
89//
90// Class: SoQtViewer
91//
92// The Viewer component is the abstract base class for all viewers.
93// It is subclassed from renderArea, adding viewing semantics to Inventor
94// rendering.
95//
97
169{
170
171 Q_OBJECT
172
173 public:
174
185 enum Type
186 {
194 EDITOR
195 };
196
197
246
259
276
297
317
326 virtual void setSceneGraph( SoNode* newScene );
327
332
333#ifndef HIDDEN_FROM_DOC
334 void saveSceneGraph( const char* fileName ) ;
335#endif //HIDDEN_FROM_DOC
336
342 virtual void setCamera( SoCamera* cam );
343
347 SoCamera* getCamera() { return m_guiViewer->getCamera(); }
348
357 virtual void setCameraType( SoType type );
358
363 SoType getCameraType() { return m_guiViewer->getCameraType(); }
364
371 { m_guiViewer->setPreserveCameraHeightAngle( flag ); }
372
378 virtual SbBool isCameraHeightAnglePreserved() const { return m_guiViewer->isCameraHeightAnglePreserved(); }
379
384 virtual void enableSeekWithOrtho( SbBool flag ) { m_guiViewer->enableSeekWithOrtho( flag ); }
385
390 virtual SbBool isSeekWithOrthoEnabled() const { return m_guiViewer->isSeekWithOrthoEnabled(); }
391
410 virtual void viewAll();
411
415 virtual void saveHomePosition();
416
420 virtual void resetToHomePosition();
421
427 void* userdata );
428
435 virtual void setHeadlight( SbBool onOrOff );
436
440 SbBool isHeadlight() { return m_guiViewer->isHeadlight(); }
441
445 SoDirectionalLight* getHeadlight() { return m_guiViewer->getHeadlight(); }
446
496 SoQtViewer::DrawStyle style );
501
507
512 { return (SoQtViewer::BufferType)m_guiViewer->getBufferingType(); }
513
526 virtual void setViewing( SbBool onOrOff );
527
531 SbBool isViewing() const { return m_guiViewer->isViewing(); }
532
543 virtual void setCursorEnabled( SbBool onOrOff );
544
549 SbBool isCursorEnabled() const { return m_guiViewer->isCursorEnabled(); }
550
561 void setAutoClipping( SbBool onOrOff );
562
566 SbBool isAutoClipping() const { return m_guiViewer->isAutoClipping(); }
567
575 virtual void setStereoViewing( SbBool onOrOff );
576
582
586 void setStereoOffset( float dist );
587
592
600 void setDetailSeek( SbBool onOrOff ) { m_guiViewer->setDetailSeek( onOrOff ); }
601
605 SbBool isDetailSeek() { return m_guiViewer->isDetailSeek(); }
606
619 void setSeekTime( float seconds ) { m_guiViewer->setSeekTime( seconds ); }
620
624 float getSeekTime() { return m_guiViewer->getSeekTime(); }
625
634 void addStartCallback( SoQtViewerCB* f, void* userData = NULL )
635 { m_guiViewer->addStartCallback( (SoGuiViewerCB*)f, userData ); }
636
645 void addFinishCallback( SoQtViewerCB* f, void* userData = NULL )
646 { m_guiViewer->addFinishCallback( (SoGuiViewerCB*)f, userData ); }
647
653 void removeStartCallback( SoQtViewerCB* f, void* userData = NULL )
654 { m_guiViewer->removeStartCallback( (SoGuiViewerCB*)f, userData ); }
655
661 void removeFinishCallback( SoQtViewerCB* f, void* userData = NULL )
662 { m_guiViewer->removeFinishCallback( (SoGuiViewerCB*)f, userData ); }
663
670 virtual void recomputeSceneSize();
671
672 // --- Large Model Viewing additions:
673
680
685 { return (SoQtViewer::DecimationStrategy)m_guiViewer->getDecimationStrategy(); }
686
694 void setGoalNumberOfTriangles( int32_t goal );
695
699 int32_t getGoalNumberOfTriangles() { return m_guiViewer->getGoalNumberOfTriangles(); }
700
708 void setGoalFramesPerSecond( float goal );
709
713 float getGoalFramesPerSecond() { return m_guiViewer->getGoalFramesPerSecond(); }
714
722 void setFixedPercentage( float percent );
723
727 float getFixedPercentage() { return m_guiViewer->getFixedPercentage(); }
728
738
743 SbBool isFullRenderingWhenStill() { return m_guiViewer->isFullRenderingWhenStill(); }
744
748 SbBool isStillNow() { return m_guiViewer->isStillNow(); }
749
753 void setFramesPerSecondCallback( SoQtViewerFPSCB* callback, void* userData = NULL );
754
759 void setNumSamples( int numFrames );
764 int getNumSamples() { return m_guiViewer->getNumSamples(); }
765
770
775
776 // Implementing methods from the pure virtual class from SoStereoViewer
777
782
787
794 virtual void actualRendering();
795
800 virtual const SbVec2s& getSize();
801
809 virtual const SbVec2s& getTopLeft() ;
810
818 virtual const SbVec2s& getBottomRight() ;
819
827
832
836 void reverseStereoView( SbBool reverse );
837
842
846 virtual void setStereoAbsoluteAdjustments( SbBool absolute );
847
851 virtual SbBool isStereoAbsoluteAdjustments() const { return m_guiViewer->isStereoAbsoluteAdjustments(); }
852
857 virtual void setStereoBalance( float balance, SbBool nearFrac = false );
858
862 virtual float getStereoBalance();
863
869
874 virtual void setStereoActive( SbBool activate ) ;
875
880
884 void setViewport( short left, short bottom, short width, short height );
885
889 void getViewport( short& left, short& bottom, short& width, short& height );
890
894 SoSeparator* getSceneRoot() { return m_guiViewer->getSceneRoot(); }
895
911
916 { return (SoQtViewer::CursorStyle)m_guiViewer->getCursorStyle(); }
917
927 void setAutoClipTolerance ( float tolerance ) { m_guiViewer->setAutoClipTolerance( tolerance ); }
928
932 float getAutoClipTolerance () const { return m_guiViewer->getAutoClipTolerance(); }
933
958 virtual void setCameraSceneGraph(SoNode *cameraSceneGraph);
959
964
969 void enableMouseWheelDolly(SbBool onOff) { m_guiViewer->enableMouseWheelDolly( onOff ); }
970
979 virtual void setSeekMode( SbBool onOrOff );
980
984 SbBool isSeekMode() { return m_guiViewer->isSeekMode(); }
985
995 virtual void toggleCameraType();
996
1006 void setPickRadius( float radius );
1007
1011 float getPickRadius() const;
1012
1013#if 1 SoDEPRECATED
1020 virtual void adjustClippingPlanes();
1021
1022#endif
1029 SbBool getDepthValue(int x, int y, float &depth)
1030 {
1031 return m_guiViewer->getDepthValue(x, y, depth);
1032 }
1033
1034private:
1035
1036 SoGuiViewer* getGuiViewer() const;
1037
1038 virtual ~SoQtViewer();
1039
1040 // redefine this routine to also correctly set the buffering type
1041 // on the viewer.
1042 virtual void setNormalVisual( QSurfaceFormat vi );
1043
1044 SbBool isInteractive() const;
1045
1046 void saveSceneGraph( const SbString& fileName );
1047
1048 // These members are public only for retro compatibility purposes.
1049 // They should not be called directly. Use their accessors instead.
1050 SoCamera* camera;
1051 SbBool createdCursors, viewingFlag;
1052 CursorStyle cursorStyle;
1053 SoSeparator* sceneRoot;
1054 float sceneSize;
1055 SoBaseStereo* stereoViewType;
1056 SbBool m_seekWithOrtho, m_preserveHeightAngle, cursorEnabledFlag, seekDistAsPercentage, computeSeekVariables;
1057 float m_previousHeightAngle, viewerSpeed, seekDistance;
1058 SoQtViewer::Type type;
1059 SoNode* sceneGraph;
1060 SbVec3f seekPoint, seekNormal, oldCamPosition, newCamPosition;
1061 SbRotation oldCamOrientation, newCamOrientation;
1062
1063 void setCurrentDrawStyle(SoQtViewer::DrawStyle style);
1064
1068 virtual void defineDefaultCursor( const QCursor& cursor );
1069
1073 virtual void defineFlyCursor( const QCursor& cursor );
1074
1078 virtual void defineRotationCursor( const QCursor& cursor );
1079
1083 virtual void defineSeekCursor( const QCursor& cursor );
1084
1088 virtual void defineTranslationCursor( const QCursor& cursor );
1089
1093 virtual void defineUpCursor( const QCursor& cursor );
1094
1098 virtual void defineViewingCursor( const QCursor& cursor );
1099
1103 virtual void defineWalkCursor( const QCursor& cursor );
1104
1108 virtual void defineZoomCursor( const QCursor& cursor );
1109
1110 virtual SoGLContext* getViewerContext() { return getNormalSoContext(); }
1111 virtual SoSceneManager* getViewerSceneManager() { return getSceneManager(); }
1112
1113 private:
1114
1115 // Constructor/Destructor
1116 SoQtViewer( QWidget* parent,
1117 const char* name,
1118 SbBool buildInsideParent,
1119 SoQtViewer::Type type,
1120 SbBool buildNow,
1121 SbBool sync = true );
1122
1123 SoQtViewer( QWidget* parent,
1124 const char* name,
1125 SbBool buildInsideParent,
1126 SoQtViewer::Type type,
1127 SbBool buildNow,
1128 SbBool sync,
1129 SoGuiViewer* guiViewer );
1130
1131 // global vars
1132 SbBool altSwitchBack; // flag to return to PICK after an Alt release
1133
1134 // Previously declared in subclasses (before v2.6)
1135 // Note that each subclass viewer uses a subset of these standard
1136 // cursor names. Note that the Fly and Walk viewers used slightly
1137 // different names (that were too generic) for their specific cursors
1138 // (the last two in the list) prior to v2.6.
1139 QCursor normalCursor, dollyCursor, panCursor, rollCursor, seekCursor,
1140 spinCursor, upCursor, flyCursor, walkCursor;
1141
1142 // Load cursor definitions from resource file.
1143 // previously declared in subclasses (before v2.6).
1144 // Subclasses may override, but are not required to do so
1145 // unless they need more or different cursor definitions.
1146 virtual void defineCursors();
1147
1148 // Subclasses should (and do) override this method! (new in v2.6)
1149 // (The setCursorStyle method calls this to force a dynamic change)
1150 virtual void updateCursor() {};
1151
1152 // Subclasses can call this routine to handle a common set of events. A Boolean
1153 // is returned to specify whether the event was handled by the base class.
1154 // Currently handled events and functions are :
1155 // 'Esc' key - toggles viewing on/off
1156 // When viewing OFF - send all events down the scene graph
1157 // When camera == NULL - Discard all viewing events
1158 // 'home' Key - calls resetToHomePosition()
1159 // 's' Key - toggles seek on/off
1160 // Arrow Keys - moves the camera up/down/right/left in the viewing plane
1161 SbBool processCommonEvents( QEvent* xe );
1162
1163 // Invokes the start and finish viewing callbacks. Subclasses NEED to call
1164 // those routines when they start and finish doing interactive viewing
1165 // operations so that correct interactive drawing style and buffering
1166 // types, as well as application callbacks, gets set and called properly.
1167 //
1168 // Those routines simply increment and decrement a counter. When the counter
1169 // changes from 0->1 the start viewing callbacks are called. When the counter
1170 // changes back from 1->0 the finish viewing callbacks are called.
1171 // The counter approach enables different parts of a viewer to call those
1172 // routines withough having to know about each others (which is not
1173 //
1174 void interactiveCountInc();
1175 void interactiveCountDec();
1176 int getInteractiveCount() { return m_guiViewer->getInteractiveCount(); }
1177
1178 //
1179 // This routine is used by subclasses to initiate the seek animation. Given a
1180 // screen mouse location, this routine will return the picked point
1181 // and the normal at that point. It will also schedule the sensor to animate
1182 // if necessary. The routine retuns TRUE if something got picked...
1183 //
1184 // Note: if detailSeek is on, the point and normal correspond to the exact
1185 // 3D location under the cursor.
1186 // if detailSeek if off, the object bbox center and the camera
1187 // orientation are instead returned.
1188 SbBool seekToPoint( const SbVec2s &mouseLocation );
1189
1190 //
1191 // Subclasses CAN redefine this to interpolate camera position/orientation
1192 // while the seek animation is going on (called by animation sensor).
1193 // The parameter t is a [0,1] value corresponding to the animation percentage
1194 // completion. (i.e. a value of 0.25 means that animation is only 1/4 of the way
1195 // through).
1196 //
1197 virtual void interpolateSeekAnimation( float t );
1198 virtual void computeSeekFinalOrientation();
1199
1200 // redefine this routine to adjust the camera clipping planes just
1201 // before doing a redraw. The sensor will be unschedule after the camera
1202 // is changed in the base class to prevent a second redraw from occuring.
1203 virtual void actualRedraw();
1204
1205 // This is called during a paste.
1206 // Subclasses may wish to redefine this in a way that
1207 // keeps their viewing paradigm intact.
1208 virtual void changeCameraValues( SoCamera* newCamera );
1209
1210 //
1211
1212 // Convenience routines which subclasses can use when drawing viewer
1213 // feedback which may be common across multiple viewers. There is for
1214 // example a convenience routine which sets an orthographics projection
1215 // and a method to draw common feedback like the roll anchor (used by
1216 // a couple of viewers).
1217 //
1218 // All drawing routines assume that the window and projection is
1219 // already set by the caller.
1220 //
1221 // set an ortho projection of the glx window size - this also turns
1222 // zbuffering off and lighting off (if necessary).
1223 static void setFeedbackOrthoProjection( const SbVec2s& glxSize );
1224
1225 // restores the zbuffer and lighting state that was changed when
1226 // setFeedbackOrthoProjection() was last called.
1227 static void restoreGLStateAfterFeedback();
1228
1229 // draws a simple 2 colored cross at given position
1230 static void drawViewerCrossFeedback( SbVec2s loc );
1231
1232 // draws the anchor feedback given center of rotation and mouse location
1233 static void drawViewerRollFeedback( SbVec2s center, SbVec2s loc );
1234
1235 virtual void widgetChanged( QWidget* w );
1236
1237 // redefine this for a better default draw style (need to wait for context)
1238 virtual void afterRealizeHook();
1239
1240 // auto clipping routines
1241 virtual void adjustCameraClippingPlanes();
1242
1243 // Override redraw() in order to calculate render time including
1244 // frame buffer switch
1245 virtual void redraw();
1246
1247 // Subclasses may override this function to change way that
1248 // viewer tries to calculate decimation percentage for
1249 // DecimationStrategy FRAMES_PER_SECOND.
1250 // Given goal frames per second, timeTaken in last render,
1251 // and last decimation value used, this function should return
1252 // decimation percentage value to use in next render.
1253 virtual float decimationForFramesPerSecond( float fps,
1254 double timeTaken,
1255 float decimation );
1256
1257 // Subclasses may override this function to change way that
1258 // viewer tries to calculate decimation percentage for
1259 // DecimationStrategy FIXED_NUM_TRIANGLES.
1260 // Given goal number of triangles to reach, this function
1261 // should return decimation percentage value to use.
1262 virtual float decimationForNumTriangles( uint32_t numTris );
1263
1264 // Return a pointer to the QtWidget for stereo
1265 void* getViewer() {return (void*)this;}
1266
1267 protected Q_SLOTS:
1271 void processCommonEnterEvents( unsigned int state );
1272
1273 private:
1274
1275#if !defined(_WIN32) && !defined(__APPLE__)
1276 unsigned int m_zoomBoxPixel;
1277#endif // UNIX
1278
1279 void constructorCommon( SoQtViewer::Type t, SbBool buildNow );
1280 void constructorCommon2( SoQtViewer::Type t, SbBool buildNow );
1281
1282 SoGuiViewer* m_guiViewer; // Implementation class for SoXxViewer
1283
1284 // current state vars
1285 SoQtInputFocus* inputFocus;
1286 SbBool m_firstRealize;
1287
1288 // set the zbuffer on current window to correct state
1289 void setZbufferState();
1290 SbBool isZbufferOff();
1291 void arrowKeyPressed( int rawKey );
1292
1293 // Decimation strategy additions:
1294 static SoGLRenderAction::AbortCode renderAbortCB( void* data );
1295 SoAlarmSensor* stillSensor;
1296 static void alarmCB( void* thisp, SoSensor* ) { ((SoQtViewer*)thisp)->stillSensorCalled(); }
1297 void stillSensorCalled();
1298
1299 // PoViews
1315 static SbBool viewingEventCB( SoQtViewer* viewer, QEvent* anyEvent );
1316
1317 // Seek animation
1318 static void seekAnimationSensorCB( void* p, SoSensor* sensor );
1319
1320 SoNode* m_cameraSceneGraph; //SUPPR
1321
1322 // Used to compute the value returned by getSize method
1323 SbVec2s m_size;
1324};
1325
1326#endif /* _SO_QT_VIEWER_ */
1327
1328
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:76
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:86
void SoQtViewerFPSCB(float fps, void *userData, SoQtViewer *viewer)
External FPS callback functions registered with the viewer should be of this type.
Definition SoQtViewer.h:81
void SoQtViewerCB(void *userData, SoQtViewer *viewer)
External interactive callback functions registered with the viewer should be of this type.
Definition SoQtViewer.h:71
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:169
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:743
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:390
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:727
SbBool isSeekMode()
Returns TRUE if currently in seek mode.
Definition SoQtViewer.h:984
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:186
@ EDITOR
Camera is added to user's scene.
Definition SoQtViewer.h:194
@ BROWSER
Camera views scene, but is not added to scene.
Definition SoQtViewer.h:190
SbBool isStillNow()
Returns whether the viewer is currently still.
Definition SoQtViewer.h:748
SoQtViewer::BufferType getBufferingType()
Gets the current buffering type in the main view.
Definition SoQtViewer.h:511
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:384
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:600
virtual SbBool isStereoAbsoluteAdjustments() const
Returns TRUE if stereo absolute adjustments are enabled.
Definition SoQtViewer.h:851
float getGoalFramesPerSecond()
Gets goal frames per second for the viewer to try to render.
Definition SoQtViewer.h:713
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:661
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:653
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:645
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:249
@ STILL
Applies to static rendering.
Definition SoQtViewer.h:253
@ INTERACTIVE
Applies to rendering while interactive viewing.
Definition SoQtViewer.h:257
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.
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:894
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:303
@ SHADOW
Improved cursors using "shadow".
Definition SoQtViewer.h:315
@ CLASSIC
Standard Open Inventor cursors.
Definition SoQtViewer.h:307
@ XOR
Improved cursors using XOR.
Definition SoQtViewer.h:311
float getSeekTime()
Queries the seek time.
Definition SoQtViewer.h:624
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:204
@ VIEW_LOW_COMPLEXITY
Render low complexity and no texture.
Definition SoQtViewer.h:220
@ VIEW_POINT
Point draw style.
Definition SoQtViewer.h:228
@ VIEW_HIDDEN_LINE
Render only the frontmost lines.
Definition SoQtViewer.h:212
@ VIEW_NO_TEXTURE
Render without textures.
Definition SoQtViewer.h:216
@ VIEW_LOW_RES_LINE
Low complexity wireframe + no depth clearing.
Definition SoQtViewer.h:236
@ VIEW_AS_IS
Unchanged.
Definition SoQtViewer.h:208
@ VIEW_LOW_RES_POINT
Low complexity point + no depth clearing.
Definition SoQtViewer.h:240
@ VIEW_SAME_AS_STILL
Forces the INTERACTIVE draw style to match STILL.
Definition SoQtViewer.h:244
@ VIEW_LINE
Wireframe draw style.
Definition SoQtViewer.h:224
@ VIEW_BBOX
Bounding box draw style.
Definition SoQtViewer.h:232
SbBool isAutoClipping() const
Queries if auto clipping is ON.
Definition SoQtViewer.h:566
SbBool isDetailSeek()
Queries whether the viewer is in seek mode.
Definition SoQtViewer.h:605
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:684
BufferType
List of different buffering types.
Definition SoQtViewer.h:262
@ BUFFER_SINGLE
Single buffer.
Definition SoQtViewer.h:266
@ BUFFER_INTERACTIVE
Double buffer while interactive viewing.
Definition SoQtViewer.h:274
@ BUFFER_DOUBLE
Double buffer.
Definition SoQtViewer.h:270
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:531
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:370
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...
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.
SoQtViewer::CursorStyle getCursorStyle()
Returns the cursor style.
Definition SoQtViewer.h:915
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:549
virtual SbBool isCameraHeightAnglePreserved() const
Query whether the SoPerspectiveCamera's heightAngle is preserved if the camera is changed to an SoOrt...
Definition SoQtViewer.h:378
virtual void viewAll()
Changes the camera position to view the entire scene (the camera zoom or orientation isn't changed).
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:363
void addStartCallback(SoQtViewerCB *f, void *userData=NULL)
Adds start callback routine on the viewer.
Definition SoQtViewer.h:634
DecimationStrategy
List of decimation strategies.
Definition SoQtViewer.h:279
@ FIXED_PERCENTAGE
Use given decimation percentage.
Definition SoQtViewer.h:295
@ FIXED_NUM_TRIANGLES
Try to fix number of triangles drawn.
Definition SoQtViewer.h:287
@ FRAMES_PER_SECOND
Try to fix frames per second.
Definition SoQtViewer.h:291
@ NORMAL
Decimation is not changed.
Definition SoQtViewer.h:283
virtual void setHeadlight(SbBool onOrOff)
Turns the headlight on/off (default on).
SbBool isHeadlight()
Queries if the headlight is on.
Definition SoQtViewer.h:440
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:445
void setAutoClipTolerance(float tolerance)
Sets the auto clipping tolerance value.
Definition SoQtViewer.h:927
float getAutoClipTolerance() const
Gets the auto clipping tolerance value.
Definition SoQtViewer.h:932
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:969
void setSeekTime(float seconds)
Sets the time a seek takes to change to the new camera location.
Definition SoQtViewer.h:619
SoCamera * getCamera()
Gets the edited camera.
Definition SoQtViewer.h:347
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:764
int32_t getGoalNumberOfTriangles()
Gets goal number of triangles for the viewer to try to render.
Definition SoQtViewer.h:699
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: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
int SbBool
Boolean type.
Definition SbBase.h:87