28#include <Inventor/Qt/OivQtCompat.h>
29#include <Inventor/Qt/SoQtRenderArea.h>
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>
39#include <Inventor/components/stereo/SoStereoViewer.h>
341#ifndef HIDDEN_FROM_DOC
342 void saveSceneGraph(
const char* fileName ) ;
379 { m_guiViewer->setPreserveCameraHeightAngle( flag ); }
627 void setSeekTime(
float seconds ) { m_guiViewer->setSeekTime( seconds ); }
643 { m_guiViewer->addStartCallback( (SoGuiViewerCB*)f, userData ); }
654 { m_guiViewer->addFinishCallback( (SoGuiViewerCB*)f, userData ); }
662 { m_guiViewer->removeStartCallback( (SoGuiViewerCB*)f, userData ); }
670 { m_guiViewer->removeFinishCallback( (SoGuiViewerCB*)f, userData ); }
892 void setViewport(
short left,
short bottom,
short width,
short height );
897 void getViewport(
short& left,
short& bottom,
short& width,
short& height );
1039 return m_guiViewer->getDepthValue(x, y, depth);
1050 virtual void setNormalVisual( QSurfaceFormat vi );
1052 SbBool isInteractive()
const;
1054 void saveSceneGraph(
const SbString& fileName );
1059 SbBool createdCursors, viewingFlag;
1064 SbBool m_seekWithOrtho, m_preserveHeightAngle, cursorEnabledFlag, seekDistAsPercentage, computeSeekVariables;
1065 float m_previousHeightAngle, viewerSpeed, seekDistance;
1068 SbVec3f seekPoint, seekNormal, oldCamPosition, newCamPosition;
1069 SbRotation oldCamOrientation, newCamOrientation;
1076 virtual void defineDefaultCursor(
const QCursor& cursor );
1081 virtual void defineFlyCursor(
const QCursor& cursor );
1086 virtual void defineRotationCursor(
const QCursor& cursor );
1091 virtual void defineSeekCursor(
const QCursor& cursor );
1096 virtual void defineTranslationCursor(
const QCursor& cursor );
1101 virtual void defineUpCursor(
const QCursor& cursor );
1106 virtual void defineViewingCursor(
const QCursor& cursor );
1111 virtual void defineWalkCursor(
const QCursor& cursor );
1116 virtual void defineZoomCursor(
const QCursor& cursor );
1126 SbBool buildInsideParent,
1133 SbBool buildInsideParent,
1147 QCursor normalCursor, dollyCursor, panCursor, rollCursor, seekCursor,
1148 spinCursor, upCursor, flyCursor, walkCursor;
1154 virtual void defineCursors();
1158 virtual void updateCursor() {};
1169 SbBool processCommonEvents( QEvent* xe );
1182 void interactiveCountInc();
1183 void interactiveCountDec();
1184 int getInteractiveCount() {
return m_guiViewer->getInteractiveCount(); }
1205 virtual void interpolateSeekAnimation(
float t );
1206 virtual void computeSeekFinalOrientation();
1211 virtual void actualRedraw();
1216 virtual void changeCameraValues(
SoCamera* newCamera );
1231 static void setFeedbackOrthoProjection(
const SbVec2s& glxSize );
1235 static void restoreGLStateAfterFeedback();
1238 static void drawViewerCrossFeedback(
SbVec2s loc );
1241 static void drawViewerRollFeedback(
SbVec2s center,
SbVec2s loc );
1243 virtual void widgetChanged( QWidget* w );
1246 virtual void afterRealizeHook();
1249 virtual void adjustCameraClippingPlanes();
1253 virtual void redraw();
1261 virtual float decimationForFramesPerSecond(
float fps,
1270 virtual float decimationForNumTriangles( uint32_t numTris );
1273 void* getViewer() {
return (
void*)
this;}
1283#if !defined(_WIN32) && !defined(__APPLE__)
1284 unsigned int m_zoomBoxPixel;
1293 SoQtInputFocus* inputFocus;
1297 void setZbufferState();
1299 void arrowKeyPressed(
int rawKey );
1304 static void alarmCB(
void* thisp,
SoSensor* ) { ((
SoQtViewer*)thisp)->stillSensorCalled(); }
1305 void stillSensorCalled();
1326 static void seekAnimationSensorCB(
void* p,
SoSensor* sensor );
1328 SoNode* m_cameraSceneGraph;
List of generic (void *) pointers.
Class for representing a rotation.
Class for smart character strings.
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.
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.
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.
Sensor class that can be attached to Open Inventor nodes.
Node that defines base colors using packed representation.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Component for re...
SoSceneManager * getSceneManager() const
Gets the normal scene manager.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Viewer component...
virtual 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.
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.
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)
SbBool isSeekMode()
Returns TRUE if currently in seek mode.
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.
@ EDITOR
Camera is added to user's scene.
@ BROWSER
Camera views scene, but is not added to scene.
SbBool isStillNow()
Returns whether the viewer is currently still.
SoQtViewer::BufferType getBufferingType()
Gets the current buffering type in the main view.
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.
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...
virtual SbBool isStereoAbsoluteAdjustments() const
Returns TRUE if stereo absolute adjustments are enabled.
float getGoalFramesPerSecond()
Gets goal frames per second for the viewer to try to render.
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.
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.
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.
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.
@ STILL
Applies to static rendering.
@ INTERACTIVE
Applies to rendering while interactive viewing.
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.
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.
virtual const SbVec2s & getTopLeft()
Returns the position of the OpenGL drawing window in absolute screen coordinates (not relative to par...
CursorStyle
Curors styles.
@ SHADOW
Improved cursors using "shadow".
@ CLASSIC
Standard Open Inventor cursors.
@ XOR
Improved cursors using XOR.
float getSeekTime()
Queries the seek time.
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.
@ VIEW_LOW_COMPLEXITY
Render low complexity and no texture.
@ VIEW_POINT
Point draw style.
@ VIEW_HIDDEN_LINE
Render only the frontmost lines.
@ VIEW_NO_TEXTURE
Render without textures.
@ VIEW_LOW_RES_LINE
Low complexity wireframe + no depth clearing.
@ VIEW_LOW_RES_POINT
Low complexity point + no depth clearing.
@ VIEW_SAME_AS_STILL
Forces the INTERACTIVE draw style to match STILL.
@ VIEW_LINE
Wireframe draw style.
@ VIEW_BBOX
Bounding box draw style.
SbBool isAutoClipping() const
Queries if auto clipping is ON.
SbBool isDetailSeek()
Queries whether the viewer is in seek mode.
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.
BufferType
List of different buffering types.
@ BUFFER_SINGLE
Single buffer.
@ BUFFER_INTERACTIVE
Double buffer while interactive viewing.
@ BUFFER_DOUBLE
Double buffer.
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.
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...
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.
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.
SoQtViewer::CursorStyle getCursorStyle()
Returns the cursor style.
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.
virtual SbBool isCameraHeightAnglePreserved() const
Query whether the SoPerspectiveCamera's heightAngle is preserved if the camera is changed to an SoOrt...
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.
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...
void addStartCallback(SoQtViewerCB *f, void *userData=NULL)
Adds start callback routine on the viewer.
DecimationStrategy
List of decimation strategies.
@ FIXED_PERCENTAGE
Use given decimation percentage.
@ FIXED_NUM_TRIANGLES
Try to fix number of triangles drawn.
@ FRAMES_PER_SECOND
Try to fix frames per second.
@ NORMAL
Decimation is not changed.
virtual void setHeadlight(SbBool onOrOff)
Turns the headlight on/off (default on).
SbBool isHeadlight()
Queries if the headlight is on.
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.
void setAutoClipTolerance(float tolerance)
Sets the auto clipping tolerance value.
float getAutoClipTolerance() const
Gets the auto clipping tolerance value.
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.
void setSeekTime(float seconds)
Sets the time a seek takes to change to the new camera location.
SoCamera * getCamera()
Gets the edited camera.
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.
int32_t getGoalNumberOfTriangles()
Gets goal number of triangles for the viewer to try to render.
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.
Field containing an SbTime.
Manages scene graph rendering and event handling.
Abstract base class for Open Inventor sensors.
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.
Stores runtime type information.