Common algorithms for all viewers. More...
#include <Inventor/Gui/viewers/SoGuiAlgoViewers.h>
This class provides common viewer algorithms in order to more easily create a viewer class from scratch. The algorithms provided deal with animations, camera management, etc. This class regroups algorithms from all the viewer types (examiner, plane, fly and walk).
There are two ways to use this class:
1) Passed as an argument to the RenderArea.
SoGuiAlgoViewers* pAlgo = new SoGuiAlgoViewers(); SoXXRenderArea( parent, name, buildInsideParent, getMouseInput, getKeyboardInput, pAlgo );
2) Use your own GL widget and call the necessary functions for the interactions and the rendering.
See the demo QtViewer for more information.
There are two projection modes for the "virtual trackball" that translates mouse motion into camera rotation:
The viewer can use two zooming modes:
List of different buffering types.
BUFFER_SINGLE |
Single buffer. |
BUFFER_DOUBLE |
Double buffer. |
BUFFER_INTERACTIVE |
Double buffer while interactive viewing. |
Reimplemented from SoGuiViewer.
List of possible drawing styles.
Reimplemented from SoGuiViewer.
List of possible drawing types.
STILL |
Applies to static rendering. |
INTERACTIVE |
Applies to rendering while interactive viewing. |
Reimplemented from SoGuiViewer.
List of possible projection modes for the virtual trackball.
SPHERICAL |
Spherical rotation (the classic Open Inventor algorithm).
|
CYLINDRICAL |
Cylindrical rotation.
|
List of possible zooming modes.
AUTOCENTER |
Around the viewport center. |
GIVENPOSITION |
Uses as the zooming center a point provided by the application through the setCurrentMousePositionLocator() method before calling mouseWheelMotion(). |
SoGuiAlgoViewers::SoGuiAlgoViewers | ( | ) |
Constructor.
void SoGuiAlgoViewers::activateFlying | ( | ) |
Initializes flying animation.
void SoGuiAlgoViewers::activatePanning | ( | ) |
Updates camera position when panning is actived.
For Examiner and Plane viewers only.
void SoGuiAlgoViewers::activateSpinning | ( | ) |
Set sphere sheet starting point and resets the animation queue.
virtual void SoGuiAlgoViewers::adjustCameraClippingPlanes | ( | ) | [virtual] |
Auto clipping routine.
Reimplemented from SoGuiViewer.
virtual void SoGuiAlgoViewers::bottomWheelMotion | ( | float | newVal | ) | [virtual] |
Examiner and constrained viewers: Rotates the camera based on bottom wheel motion.
Plane viewer: Translates the camera based on bottom wheel motion.
Reimplemented from SoGuiConstrainedViewer.
virtual void SoGuiAlgoViewers::bottomWheelStart | ( | ) | [virtual] |
Initializes bottom thumb wheel.
Reimplemented from SoGuiFullViewer.
void SoGuiAlgoViewers::calculateMaxSpeed | ( | ) |
Calculates the maximum speed of the animation.
void SoGuiAlgoViewers::changeMaxStraightSpeed | ( | SbBool | increase | ) |
Computes the maximum straight speed.
virtual void SoGuiAlgoViewers::computeSeekFinalOrientation | ( | ) | [virtual] |
Keeps the same camera rotation when seeking.
Reimplemented from SoGuiConstrainedViewer.
void SoGuiAlgoViewers::constrainCameraRotation | ( | bool | x = false , |
|
bool | y = false , |
|||
bool | z = false | |||
) |
Constrains the camera to spin around the specified axis.
For instance giving true, true, false will prevent the camera from rotating around the Z axis. Default is free rotation.
x | If false, rotation around x axis is allowed. | |
y | If false, rotation around y axis is allowed. | |
z | If false, rotation around z axis is allowed. |
void SoGuiAlgoViewers::doBoxZoom | ( | int | x1, | |
int | y1, | |||
int | x2, | |||
int | y2 | |||
) |
Zooms to the region delimited by the box.
(x1, y1) is the top left corner and (x2, y2) is the bottom right corner of the box in pixel coordinates.
Reimplemented from SoGuiViewer.
void SoGuiAlgoViewers::doCameraAnimation | ( | ) |
Does camera animation for constrained viewers.
virtual void SoGuiAlgoViewers::dollyCamera | ( | float | dist | ) | [virtual] |
Moves the camera forward by the given amount.
Only for Walk and Fly viewers.
dist | Distance the camera will be moved. |
Reimplemented from SoGuiConstrainedViewer.
virtual void SoGuiAlgoViewers::dollyCamera | ( | const SbVec2s & | newLocator | ) | [virtual] |
Moves the camera on the z axis based on cursor motion.
Only for Examiner and Plane viewers.
newLocator | The new cursor position in pixels. The coordinates must be defined with x in the range [0,window width] and y in the range [0,window height] with min y at the bottom and min x on the left. |
virtual void SoGuiAlgoViewers::doSpinAnimation | ( | ) | [virtual] |
Rotate the camera for spin animation.
void SoGuiAlgoViewers::enableShadows | ( | bool | onOrOff | ) |
Adds an SoShadowGroup after the headlight and enables it if true.
The shadow group's method field is set to VARIANCE_SHADOW_MAP.
Reimplemented from SoGuiViewer.
BufferType SoGuiAlgoViewers::getBufferingType | ( | ) |
Returns the current buffering type in the main view.
Reimplemented from SoGuiViewer.
SoCamera* SoGuiAlgoViewers::getCamera | ( | ) |
Gets the edited camera.
Reimplemented from SoGuiViewer.
SbPlane SoGuiAlgoViewers::getCameraFocalPlane | ( | ) | const |
Returns the camera focal position.
SbVec3f SoGuiAlgoViewers::getCameraPositionLocator | ( | ) | const |
Returns the camera position.
SoType SoGuiAlgoViewers::getCameraType | ( | ) |
Gets the camera type that will be created by the viewer if no cameras are found in the scene graph (see SoPerspectiveCamera and SoOrthographicCamera).
Reimplemented from SoGuiViewer.
static SoType SoGuiAlgoViewers::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
SbVec2s SoGuiAlgoViewers::getCurrentMousePositionLocator | ( | ) | const |
Returns the current mouse position in pixels.
float SoGuiAlgoViewers::getCurrentSpeed | ( | ) | const |
Returns the current speed.
virtual void SoGuiAlgoViewers::getDefaultRotationTargetPosition | ( | SbVec3f & | targetPos | ) | [virtual] |
Gets the default camera target position for rotations.
A camera must have been defined so that a rotation target is implicitly defined
Returns the current drawing style in the main view.
SoDEPRECATED SbBool SoGuiAlgoViewers::getFullSceneAntialiasing | ( | float & | quality, | |
int & | filterMask | |||
) | const |
Returns TRUE if FSAA is currently enabled.
Also returns the current quality value.
Reimplemented from SoGuiGLWidget.
SoDEPRECATED int SoGuiAlgoViewers::getFullSceneAntialiasingMaxSamples | ( | ) | const |
Returns the maximum number of samples for full-scene antialiasing (FSAA).
Reimplemented from SoGuiGLWidget.
SoDirectionalLight* SoGuiAlgoViewers::getHeadlight | ( | ) |
Returns the headlight node.
Reimplemented from SoGuiViewer.
float SoGuiAlgoViewers::getMaxSpeed | ( | ) | const |
Returns the maximum speed.
float SoGuiAlgoViewers::getMaxSpeedInc | ( | ) | const |
Returns maximum speed multiplier.
float SoGuiAlgoViewers::getMaxStraightSpeed | ( | ) | const |
Returns the maximum straight speed.
float SoGuiAlgoViewers::getMinSpeed | ( | ) | const |
Returns the minimum speed.
double SoGuiAlgoViewers::getMouseAngularSpeed | ( | ) | [inline] |
Returns the factor used to scale the rotation speed while interactively rotating the camera.
virtual SoMPEGRenderer* SoGuiAlgoViewers::getMPEGRecorder | ( | ) | const [virtual] |
Returns the recorder used for MPEG encoding.
Reimplemented from SoGuiRenderArea.
SbTime SoGuiAlgoViewers::getPrevAnimTime | ( | ) | const |
Returns the previous animation time.
SbVec2s SoGuiAlgoViewers::getPreviousMousePositionLocator | ( | ) | const |
Returns the previous mouse position in pixels.
virtual bool SoGuiAlgoViewers::getRotationTargetPosition | ( | SbVec3f & | targetPos | ) | [virtual] |
Query the camera target position for rotations.
Returns true if a targetPos has been set explicitly by the application or if a camera has been defined so that a rotation target is implicitly defined.
virtual SoNode* SoGuiAlgoViewers::getSceneGraph | ( | ) | [virtual] |
Returns the scene graph to render.
Reimplemented from SoGuiViewer.
SoNode* SoGuiAlgoViewers::getSceneRoot | ( | ) |
Returns the scene root of the viewer (drawstyle, camera and headlight + user scene graph) or the user scene graph if there's no scene root.
Reimplemented from SoGuiViewer.
ProjectorsType SoGuiAlgoViewers::getSheetProjectionType | ( | ) | const |
Returns the sheet projection used for rotations.
SbProjector* SoGuiAlgoViewers::getSheetProjector | ( | ) | const |
Returns the sheet projector.
The sheet projector is used to translate mouse motion into camera motion. The returned object will be one of the specific subclasses of SbProjector, for example SbSphereSheetProjector (default "virtual trackball" motion) or SbCylinderSheetProjector. See setSheetProjectionType().
float SoGuiAlgoViewers::getSpeedLimit | ( | ) | const |
Returns the speed limit.
SbSphereSheetProjector* SoGuiAlgoViewers::getSphereSheetProjector | ( | ) | const |
Returns the sphere sheet projector and NULL if the current projection is not spherical.
SbVec2s SoGuiAlgoViewers::getStartMousePositionLocator | ( | ) | const |
Returns the mouse start position in pixels.
virtual SoType SoGuiAlgoViewers::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
SoGuiAlgoViewers::ViewerTypes SoGuiAlgoViewers::getViewerType | ( | ) | const |
Returns the current viewer type.
SoGuiAlgoViewers::WalkViewerMode SoGuiAlgoViewers::getWalkViewerAnimMode | ( | ) | const |
Returns the current mode for the walk viewer camera animation.
ZoomingType SoGuiAlgoViewers::getZoomingType | ( | ) | const |
Returns the zooming algorithm.
If GIVENCENTER is used then setCurrentMousePositionLocator() must be called before any mouseWheelMotion() call.
void SoGuiAlgoViewers::interactiveCountDec | ( | ) |
Invokes the finish viewing callbacks.
This must be called to finish doing interactive viewing operations.
Reimplemented from SoGuiViewer.
void SoGuiAlgoViewers::interactiveCountInc | ( | ) |
Invokes the start viewing callbacks.
This must be called to start doing interactive viewing operations so that correct interactive drawing style and buffering types, as well as application callbacks, gets set and called properly.
Reimplemented from SoGuiViewer.
SbBool SoGuiAlgoViewers::isBoxDrawing | ( | ) | const |
Returns TRUE if box drawing mode is enabled.
SbBool SoGuiAlgoViewers::isBoxSelection | ( | ) | const |
Returns TRUE if box selection mode is enabled.
virtual SbBool SoGuiAlgoViewers::isCameraHeightAnglePreserved | ( | ) | const [virtual] |
Queries whether the SoPerspectiveCamera's heightAngle is preserved if the camera is changed to an SoOrthographicCamera and then toggled back to an SoPerspectiveCamera.
Reimplemented from SoGuiViewer.
SbBool SoGuiAlgoViewers::isConstrained | ( | ) | const |
Returns TRUE if algorithms for constrained viewers are used.
SoDEPRECATED SbBool SoGuiAlgoViewers::isFullSceneAntialiasingAvailable | ( | ) |
Returns TRUE if FSAA is supported by current pixel format.
Reimplemented from SoGuiGLWidget.
SoDEPRECATED SbBool SoGuiAlgoViewers::isFullSceneAntialiasingEnabled | ( | ) | const |
Returns TRUE, if full-scene antialiasing (FSAA) is enabled.
Reimplemented from SoGuiGLWidget.
SoDEPRECATED SbBool SoGuiAlgoViewers::isFullSceneAntialiasingHQAvailable | ( | ) |
Returns TRUE if high quality full-scene antialiasing (FSAA) is available.
This feature requires the GL_MULTISAMPLE_FILTER_HINT_NV extension.
Reimplemented from SoGuiGLWidget.
SoDEPRECATED SbBool SoGuiAlgoViewers::isFullSceneAntialiasingHQEnabled | ( | ) | const |
Returns TRUE if the high quality mode for full-scene antialiasing (FSAA) is enabled.
Reimplemented from SoGuiGLWidget.
SbBool SoGuiAlgoViewers::isHeadlight | ( | ) |
Returns TRUE if the headlight is on.
Reimplemented from SoGuiViewer.
SbBool SoGuiAlgoViewers::isSeekMode | ( | ) |
Returns TRUE if viewer is in seek mode.
SbBool SoGuiAlgoViewers::isViewing | ( | ) | const |
Returns TRUE if the viewer is in viewing mode.
See setViewing() for details.
Reimplemented from SoGuiViewer.
virtual void SoGuiAlgoViewers::leftWheelMotion | ( | float | newVal | ) | [virtual] |
Examiner and constrained viewers: Rotates the camera based on left wheel motion.
Plane viewer: Translates the camera based on left wheel motion.
Reimplemented from SoGuiConstrainedViewer.
virtual void SoGuiAlgoViewers::leftWheelStart | ( | ) | [virtual] |
Initializes left thumb wheel.
Reimplemented from SoGuiFullViewer.
virtual void SoGuiAlgoViewers::mouseWheelMotion | ( | float | newVal | ) | [virtual] |
Makes the camera to zoom based on mouse wheel motion.
Reimplemented from SoGuiConstrainedViewer.
virtual void SoGuiAlgoViewers::panCamera | ( | const SbVec2f & | newLocator | ) | [virtual] |
Pans the camera based on cursor motion.
Only for Examiner and Plane viewers.
newLocator | The new cursor position in pixels. The coordinates must be defined with x in the range [0,window width] and y in the range [0,window height] with min y at the bottom and min x on the left. |
virtual void SoGuiAlgoViewers::recomputeSceneSize | ( | ) | [virtual] |
This can be used to let the viewer know that the scene graph has changed so that the viewer can recompute things like speed which depend on the scene graph size.
Note: This routine is automatically called whenever setSceneGraph() is called.
Reimplemented from SoGuiConstrainedViewer.
void SoGuiAlgoViewers::resetRenderAction | ( | ) |
This method resets the render action cache.
It is useful to reset cache when the device context used for the rendering is modified (new anti-aliasing mode, pixel format...)
virtual void SoGuiAlgoViewers::resetRotationTargetPosition | ( | ) | [virtual] |
Reset target position to default rotation around "focal point".
virtual void SoGuiAlgoViewers::resetToHomePosition | ( | ) | [virtual] |
Restores the camera values.
Reimplemented from SoGuiConstrainedViewer.
virtual void SoGuiAlgoViewers::reverseDollyCamera | ( | const SbVec2s & | newLocator | ) | [virtual] |
Same as dollyCamera but reversed.
Only for Examiner and Plane viewers.
newLocator | The new cursor position in pixels. The coordinates must be defined with x in the range [0,window width] and y in the range [0,window height] with min y at the bottom and min x on the left. |
virtual void SoGuiAlgoViewers::rightWheelMotion | ( | float | newVal | ) | [virtual] |
Makes the camera to zoom based on right wheel motion.
Reimplemented from SoGuiConstrainedViewer.
virtual void SoGuiAlgoViewers::rightWheelStart | ( | ) | [virtual] |
Initializes right thumb wheel.
Reimplemented from SoGuiFullViewer.
virtual void SoGuiAlgoViewers::rollCamera | ( | const SbVec2s & | newLocator | ) | [virtual] |
Rolls the camera based on cursor motion.
newLocator | The new cursor position in pixels. The coordinates must be defined with x in the range [0,window width] and y in the range [0,window height] with min y at the bottom and min x on the left. |
void SoGuiAlgoViewers::rotateCamera | ( | ) |
Rotates the camera around focal point by given incremental rotation (Given rotation is concatenated onto the current camera rotation).
void SoGuiAlgoViewers::rotateCamera | ( | const SbRotation & | rot | ) |
Rotates the camera around focal point by given incremental rotation (Given rotation is concatenated onto the current camera rotation).
virtual void SoGuiAlgoViewers::saveHomePosition | ( | ) | [virtual] |
Saves the camera values.
Reimplemented from SoGuiConstrainedViewer.
void SoGuiAlgoViewers::setBoxDrawingMode | ( | SbBool | on | ) |
Sets box drawing mode.
void SoGuiAlgoViewers::setBoxSelectionMode | ( | SbBool | on | ) |
Sets box selection mode.
virtual void SoGuiAlgoViewers::setBufferingType | ( | BufferType | type | ) | [virtual] |
Sets the current buffering type in the main view (default BUFFER_DOUBLE).
virtual void SoGuiAlgoViewers::setCamera | ( | SoCamera * | newCamera | ) | [virtual] |
Sets the edited camera.
Setting the camera is only needed if the first camera found in the scene when setting the scene graph isn't the one the user really wants to edit.
Reimplemented from SoGuiConstrainedViewer.
void SoGuiAlgoViewers::setCameraFocalPlane | ( | const SbPlane & | focalPlane | ) |
Sets the camera focal plane.
void SoGuiAlgoViewers::setCameraPositionLocator | ( | const SbVec3f & | camPosition | ) |
Sets the camera position.
virtual void SoGuiAlgoViewers::setCameraType | ( | SoType | type | ) | [virtual] |
Sets the camera type that will be created by the viewer if no cameras are found in the scene graph (see SoPerspectiveCamera and SoOrthographicCamera).
By default an SoPerspectiveCamera will be created if no cameras are found.
Note: The set method will only take effect the next time a scene graph is specified (and if no cameras are found). Moreover with fly or walk viewers orthographic cameras don't make sense and are not supported.
Reimplemented from SoGuiViewer.
void SoGuiAlgoViewers::setConstrained | ( | SbBool | constrained | ) |
Specifies whether algorithms for constrained viewers should be used.
void SoGuiAlgoViewers::setCurrentMousePositionLocator | ( | const SbVec2s & | mousePosition | ) |
Sets the current mouse position.
mousePosition | The new mouse position in pixels. The coordinates must be defined with x in the range [0,window width] and y in the range [0,window height] with min y at the bottom and min x on the left. |
void SoGuiAlgoViewers::setCurrentSpeed | ( | float | speed | ) |
Sets the current speed.
Sets the current drawing style in the main view.
The user can specify the INTERACTIVE draw style (draw style used when the scene changes) independently from the STILL style. Default is VIEW_AS_IS draw style for STILL and VIEW_SAME_AS_STILL for INTERACTIVE.
The default value can be set using the environment variables OIV_STILL_DRAW_STYLE and OIV_INTERACTIVE_DRAW_STYLE. Valid values are VIEW_AS_IS, VIEW_HIDDEN_LINE, VIEW_NO_TEXTURE, VIEW_LOW_COMPLEXITY, VIEW_LINE, VIEW_POINT, VIEW_BBOX, VIEW_LOW_RES_LINE, VIEW_LOW_RES_POINT for OIV_STILL_DRAW_STYLE and the same plus VIEW_SAME_AS_STILL for OIV_INTERACTIVE_DRAW_STYLE.
Possible draw styles are: VIEW_AS_IS - Leaves the objects unchanged.
VIEW_HIDDEN_LINE - Renders the object as wireframe, but only shows the object front faces. This is accomplished using a two-pass rendering. In the first pass, the objects are rendered as FILLED using the background BASE_COLOR (this sets up the wanted z-buffer values). The second pass then renders the objects as LINES, while adjusting the z-buffer range to limit overlapping polygons problems.
VIEW_NO_TEXTURE - Renders the objects without any textures. This is done by setting the override flag on an empty SoTexture2 node.
VIEW_LOW_COMPLEXITY - Renders the objects without any textures and with a low complexity. This is done by setting the override flag on an empty SoTexture2 node, and by setting a low complexity value on an SoComplexity node with override set to TRUE.
VIEW_LINE - Renders the objects as LINES (no texture) with lighting model set to BASE_COLOR.
VIEW_LOW_RES_LINE - Renders the objects as LINES (no texture) using a low complexity, with lighting model set to BASE_COLOR and no depth comparison.
VIEW_POINT - Renders the objects as POINTS (no texture) with lighting model set to BASE_COLOR.
VIEW_LOW_RES_POINT - Renders the objects as POINTS (no texture) using a low complexity, with lighting model set to BASE_COLOR and no depth comparison.
VIEW_BBOX - Renders the objects with complexity BOUNDING_BOX, lighting model set to BASE_COLOR and drawing style LINES (no texture) with no depth comparison.
VIEW_SAME_AS_STILL - This only applies to INTERACTIVE draw type. It enables the interactive draw style mode to match the regular draw style mode without having to set it explicitly.
SoDEPRECATED SbBool SoGuiAlgoViewers::setFullSceneAntialiasing | ( | SbBool | enable, | |
float | quality = -1.f , |
|||
int | filterMask = SoFullSceneAntialiasing::ALL | |||
) |
Enables or disables full-scene antialiasing (FSAA).
Note: Use the SoFullSceneAntialiasing node to control FSAA during render traversal.
enable | Enables or disables FSAA rendering. | |
quality | Specifies quality of the antialiasing rendering. Quality values are in the interval [0..1], where 0 is the lowest quality and 1 is the highest quality. When set to -1.0 (default) the quality value is the default value for the pixel format. The number of samples used in the antialiasing computation depends on your graphics hardware and on your video driver. NVidia graphics hardware can support number of samples * 2 levels of quality (assuming the NV_multisample_filter_hint OpenGL extension is available). | |
filterMask | Specifies the types of shapes that should be antialiased. Default is all shapes. See SoFullSceneAntialiasing for more info. |
Reimplemented from SoGuiGLWidget.
Enables or disables the high quality mode for full-scene antialiasing (FSAA).
This feature requires the GL_MULTISAMPLE_FILTER_HINT_NV extension.
Reimplemented from SoGuiGLWidget.
virtual void SoGuiAlgoViewers::setHeadlight | ( | SbBool | insertFlag | ) | [virtual] |
Turns the headlight on/off (default on).
The default value can be set using the environment variable OIV_USE_HEADLIGHT (0 = FALSE, 1 = TRUE).
Reimplemented from SoGuiViewer.
void SoGuiAlgoViewers::setMaxSpeed | ( | float | speed | ) |
Sets the maximum speed.
void SoGuiAlgoViewers::setMaxSpeedInc | ( | float | increment | ) |
Sets maximum speed multiplier.
void SoGuiAlgoViewers::setMaxStraightSpeed | ( | float | speed | ) |
Sets the maximum straight speed.
void SoGuiAlgoViewers::setMinSpeed | ( | float | speed | ) |
Sets the minimum speed.
void SoGuiAlgoViewers::setMouseAngularSpeed | ( | double | speedFactor | ) | [inline] |
Specifies the factor used to scale the rotation speed while interactively rotating the camera.
Default is 1.
virtual void SoGuiAlgoViewers::setMPEGRecorder | ( | SoMPEGRenderer * | recorder | ) | [virtual] |
Sets the recorder used for MPEG encoding.
recorder | the recorder to be used. |
Note: The destruction of the recorder is handled by SoGuiAlgoViewers.
Reimplemented from SoGuiRenderArea.
Moves the camera to be aligned with the given plane.
For instance: setPlane( SbVec3f(1, 0, 0), SbVec3f(0, 0, -1) ) will align the camera with the X plane.
virtual void SoGuiAlgoViewers::setPreserveCameraHeightAngle | ( | SbBool | flag | ) | [virtual] |
If TRUE, an SoPerspectiveCamera's heightAngle is preserved if the camera is changed to an SoOrthographicCamera and then toggled back to an SoPerspectiveCamera.
Default is FALSE.
Reimplemented from SoGuiViewer.
void SoGuiAlgoViewers::setPrevAnimTime | ( | SbTime | previous | ) |
Sets the previous animation time.
void SoGuiAlgoViewers::setPreviousMousePositionLocator | ( | const SbVec2s & | mousePosition | ) |
Sets the previous mouse position.
mousePosition | The new mouse position in pixels. The coordinates must be defined with x in the range [0,window width] and y in the range [0,window height] with min y at the bottom and min x on the left. |
virtual void SoGuiAlgoViewers::setRotationTargetPosition | ( | const SbVec3f & | targetPos | ) | [virtual] |
Sets the camera target position for rotations.
virtual void SoGuiAlgoViewers::setSceneGraph | ( | SoNode * | newScene | ) | [virtual] |
Sets the scene graph to render.
Whenever a new scene is supplied the first camera encountered will be by default used as the edited camera, else a new camera will be created. If the scene graph does not contain any light nodes, the viewer inserts a headlight (directional light which is made to follow the camera) immediately after the camera. See the main description of this class for further details.
Reimplemented from SoGuiViewer.
virtual void SoGuiAlgoViewers::setSeekMode | ( | SbBool | onOrOff | ) | [virtual] |
Set the viewer into/out of seek mode (default OFF).
Actual seeking will not happen until the viewer decides to, for example, on a mouse click.
Note: Setting the viewer out of seek mode while the camera is being animated will stop the animation at the current location.
Reimplemented from SoGuiViewer.
void SoGuiAlgoViewers::setSheetProjectionType | ( | const ProjectorsType & | projType | ) |
Specifies the sheet projection to use for rotations.
Use enum ProjectorsType. Default is SPHERICAL.
void SoGuiAlgoViewers::setSpeedLimit | ( | float | limit | ) |
Sets the speed limit.
void SoGuiAlgoViewers::setStartMousePositionLocator | ( | const SbVec2s & | mousePosition | ) |
Sets the mouse start position.
mousePosition | The new mouse position in pixels. The coordinates must be defined with x in the range [0,window width] and y in the range [0,window height] with min y at the bottom and min x on the left. |
void SoGuiAlgoViewers::setViewerType | ( | ViewerTypes | vType | ) |
Sets the type of viewer used for the algorithms.
virtual void SoGuiAlgoViewers::setViewing | ( | SbBool | flag | ) | [virtual] |
Sets whether the viewer is turned on or off.
When turned on (commonly called viewing mode), events are consumed by the viewer. When viewing is off (commonly called selection mode), events are processed by the viewer's render area. This means events will be sent down to the scene graph for processing (i.e. picking can occur). Note that if the application has registered an event callback, it will be invoked on every message, whether viewing is turned on or not. However, the return value of this callback (which specifies whether the callback handled the event or not) is ignored when viewing is on. That is, the viewer will process the event even if the callback already did. This is to ensure that the viewing paradigm is not broken (default viewing is on).
Reimplemented from SoGuiViewer.
void SoGuiAlgoViewers::setWalkViewerAnimMode | ( | WalkViewerMode | mode | ) |
Sets the camera animation for walk viewers regarding the mode.
void SoGuiAlgoViewers::setZoomingType | ( | const ZoomingType & | zoomType | ) |
Specifies the zooming algorithm to use.
Use enum ZoomingType. Default is AUTOCENTER.
virtual void SoGuiAlgoViewers::spinCamera | ( | const SbVec2f & | newLocator | ) | [virtual] |
Spins the camera based on cursor motion.
newLocator | The new cursor position in pixels. The coordinates must be defined with x in the range [0,window width] and y in the range [0,window height] with min y at the bottom and min x on the left. |
virtual void SoGuiAlgoViewers::spinConstrainedCamera | ( | const SbVec2f & | newLocator, | |
int | axisIndex | |||
) | [virtual] |
Spin the camera based on cursor motion but constrained to rotation around one axis.
newLocator | The new cursor position in pixels. The coordinates must be defined with x in the range [0,window width] and y in the range [0,window height] with min y at the bottom and min x on the left. | |
axisIndex | the axis index:
|
void SoGuiAlgoViewers::startFlyAnimation | ( | ) |
Starts the walk animation.
void SoGuiAlgoViewers::startSpinAnimation | ( | ) |
Starts the spin animation.
void SoGuiAlgoViewers::startWalkAnimation | ( | ) |
Starts the walk animation.
void SoGuiAlgoViewers::stopFlyAnimation | ( | ) |
Stops the walk animation.
void SoGuiAlgoViewers::stopSpinAnimation | ( | ) |
Stops the spin animation.
void SoGuiAlgoViewers::stopWalkAnimation | ( | ) |
Stops the walk animation.
virtual void SoGuiAlgoViewers::toggleCameraType | ( | ) | [virtual] |
This routine will toggle the current camera from perspective to orthographic, and from orthographic back to perspective.
Note: It is not actually possible to "toggle" the type of a camera. In fact the current camera will be replaced by a new camera of the appropriate type. Of course the current camera node will be destroyed in the process unless it has been ref'd elsewhere.
Reimplemented from SoGuiViewer.
void SoGuiAlgoViewers::updateCameraFocalPoint | ( | ) |
Updates focal distance.
virtual void SoGuiAlgoViewers::viewAll | ( | ) | [virtual] |
Changes the camera position to view the entire scene (the camera zoom or orientation isn't changed).
Reimplemented from SoGuiViewer.
void SoGuiAlgoViewers::viewX | ( | bool | reverse = false |
) |
Selects axial view.
void SoGuiAlgoViewers::viewY | ( | bool | reverse = false |
) |
Selects frontal view.
void SoGuiAlgoViewers::viewZ | ( | bool | reverse = false |
) |
Selects sagittal view.