Common algorithms for all viewers. More...
#include <Inventor/Gui/viewers/SoGuiAlgoViewers.h>
Public Types | |
enum | ViewerTypes { EXAMINER , PLANE , FLY , WALK , UNKNOWN } |
Viewer type flags. More... | |
enum | DrawStyle { 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 , VIEW_SAME_AS_STILL } |
List of possible drawing styles. More... | |
enum | DrawType { STILL , INTERACTIVE } |
List of possible drawing types. More... | |
enum | BufferType { BUFFER_SINGLE , BUFFER_DOUBLE , BUFFER_INTERACTIVE } |
List of different buffering types. More... | |
enum | ProjectorsType { SPHERICAL , CYLINDRICAL } |
List of possible projection modes for the virtual trackball. More... | |
enum | ZoomingType { AUTOCENTER , GIVENPOSITION } |
List of possible zooming modes. More... | |
enum | WalkViewerMode { WALK_MODE , PAN_MODE } |
Walk viewer mode flags. More... | |
Public Member Functions | |
virtual SoType | getTypeId () const |
Returns the type identifier for this specific instance. | |
SoGuiAlgoViewers () | |
Constructor. | |
void | setConstrained (SbBool constrained) |
Specifies whether algorithms for constrained viewers should be used. | |
SbBool | isConstrained () const |
Returns TRUE if algorithms for constrained viewers are used. | |
void | setViewerType (ViewerTypes vType) |
Sets the type of viewer used for the algorithms. | |
SoGuiAlgoViewers::ViewerTypes | getViewerType () const |
Returns the current viewer type. | |
void | resetRenderAction () |
This method resets the render action cache. | |
void | setSheetProjectionType (const ProjectorsType &projType) |
Specifies the sheet projection to use for rotations. | |
ProjectorsType | getSheetProjectionType () const |
Returns the sheet projection used for rotations. | |
void | setMouseAngularSpeed (double speedFactor) |
Specifies the factor used to scale the rotation speed while interactively rotating the camera. | |
double | getMouseAngularSpeed () |
Returns the factor used to scale the rotation speed while interactively rotating the camera. | |
void | setZoomingType (const ZoomingType &zoomType) |
Specifies the zooming algorithm to use. | |
ZoomingType | getZoomingType () const |
Returns the zooming algorithm. | |
virtual void | setRotationTargetPosition (const SbVec3f &targetPos) |
Sets the camera target position for rotations. | |
virtual void | resetRotationTargetPosition () |
Reset target position to default rotation around "focal point". | |
virtual bool | getRotationTargetPosition (SbVec3f &targetPos) |
Query the camera target position for rotations. | |
virtual void | getDefaultRotationTargetPosition (SbVec3f &targetPos) |
Gets the default camera target position for rotations. | |
virtual void | setSceneGraph (SoNode *newScene) |
Sets the scene graph to render. | |
virtual SoNode * | getSceneGraph () |
Returns the scene graph to render. | |
void | enableShadows (bool onOrOff) |
Adds an SoShadowGroup after the headlight and enables it if true. | |
virtual void | setCamera (SoCamera *newCamera) |
Sets the edited camera. | |
SoCamera * | getCamera () |
Gets the edited camera. | |
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 (see SoPerspectiveCamera and SoOrthographicCamera). | |
SoType | 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). | |
virtual void | toggleCameraType () |
This routine will toggle the current camera from perspective to orthographic, and from orthographic back to perspective. | |
virtual void | setPreserveCameraHeightAngle (SbBool flag) |
If TRUE, an SoPerspectiveCamera's heightAngle is preserved if the camera is changed to an SoOrthographicCamera and then toggled back to an SoPerspectiveCamera. | |
virtual SbBool | isCameraHeightAnglePreserved () const |
Queries whether the SoPerspectiveCamera's heightAngle is preserved if the camera is changed to an SoOrthographicCamera and then toggled back to an SoPerspectiveCamera. | |
virtual void | viewAll () |
Changes the camera position to view the entire scene (the camera zoom or orientation isn't changed). | |
virtual void | saveHomePosition () |
Saves the camera values. | |
virtual void | resetToHomePosition () |
Restores the camera values. | |
virtual void | setHeadlight (SbBool insertFlag) |
Turns the headlight on/off (default on). | |
SbBool | isHeadlight () |
Returns TRUE if the headlight is on. | |
SoDirectionalLight * | getHeadlight () |
Returns the headlight node. | |
virtual void | setDrawStyle (DrawType type, DrawStyle style) |
Sets the current drawing style in the main view. | |
DrawStyle | getDrawStyle (DrawType type) |
Returns the current drawing style in the main view. | |
virtual void | setBufferingType (BufferType type) |
Sets the current buffering type in the main view (default BUFFER_DOUBLE). | |
BufferType | getBufferingType () |
Returns the current buffering type in the main view. | |
virtual void | setViewing (SbBool flag) |
Sets whether the viewer is turned on or off. | |
SbBool | isViewing () const |
Returns TRUE if the viewer is in viewing mode. | |
virtual void | recomputeSceneSize () |
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. | |
virtual void | setSeekMode (SbBool onOrOff) |
Set the viewer into/out of seek mode (default OFF). | |
SbBool | isSeekMode () |
Returns TRUE if viewer is in seek mode. | |
virtual void | adjustCameraClippingPlanes () |
Auto clipping routine. | |
void | setBoxSelectionMode (SbBool on) |
Sets box selection mode. | |
SbBool | isBoxSelection () const |
Returns TRUE if box selection mode is enabled. | |
void | setBoxDrawingMode (SbBool on) |
Sets box drawing mode. | |
SbBool | isBoxDrawing () const |
Returns TRUE if box drawing mode is enabled. | |
void | doBoxZoom (int x1, int y1, int x2, int y2) |
Zooms to the region delimited by the box. | |
virtual void | rollCamera (const SbVec2s &newLocator) |
Rolls the camera based on cursor motion. | |
virtual void | dollyCamera (const SbVec2s &newLocator) |
Moves the camera on the z axis based on cursor motion. | |
virtual void | dollyCamera (float dist) |
Moves the camera forward by the given amount. | |
virtual void | reverseDollyCamera (const SbVec2s &newLocator) |
Same as dollyCamera but reversed. | |
virtual void | panCamera (const SbVec2f &newLocator) |
Pans the camera based on cursor motion. | |
void | doCameraAnimation () |
Does camera animation for constrained viewers. | |
virtual void | rightWheelStart () |
Initializes right thumb wheel. | |
virtual void | bottomWheelStart () |
Initializes bottom thumb wheel. | |
virtual void | leftWheelStart () |
Initializes left thumb wheel. | |
virtual void | bottomWheelMotion (float newVal) |
Examiner and constrained viewers: Rotates the camera based on bottom wheel motion. | |
virtual void | leftWheelMotion (float newVal) |
Examiner and constrained viewers: Rotates the camera based on left wheel motion. | |
virtual void | rightWheelMotion (float newVal) |
Makes the camera to zoom based on right wheel motion. | |
virtual void | mouseWheelMotion (float newVal) |
Makes the camera to zoom based on mouse wheel motion. | |
void | activatePanning () |
Updates camera position when panning is actived. | |
void | setStartMousePositionLocator (const SbVec2s &mousePosition) |
Sets the mouse start position. | |
SbVec2s | getStartMousePositionLocator () const |
Returns the mouse start position in pixels. | |
void | setCurrentMousePositionLocator (const SbVec2s &mousePosition) |
Sets the current mouse position. | |
SbVec2s | getCurrentMousePositionLocator () const |
Returns the current mouse position in pixels. | |
void | setPreviousMousePositionLocator (const SbVec2s &mousePosition) |
Sets the previous mouse position. | |
SbVec2s | getPreviousMousePositionLocator () const |
Returns the previous mouse position in pixels. | |
void | setCameraPositionLocator (const SbVec3f &camPosition) |
Sets the camera position. | |
SbVec3f | getCameraPositionLocator () const |
Returns the camera position. | |
void | setCameraFocalPlane (const SbPlane &focalPlane) |
Sets the camera focal plane. | |
SbPlane | getCameraFocalPlane () const |
Returns the camera focal position. | |
void | interactiveCountInc () |
Invokes the start viewing callbacks. | |
void | interactiveCountDec () |
Invokes the finish viewing callbacks. | |
void | setPrevAnimTime (SbTime previous) |
Sets the previous animation time. | |
SbTime | getPrevAnimTime () const |
Returns the previous animation time. | |
virtual void | computeSeekFinalOrientation () |
Keeps the same camera rotation when seeking. | |
virtual void | setMPEGRecorder (SoMPEGRenderer *recorder) |
Sets the recorder used for MPEG encoding. | |
virtual SoMPEGRenderer * | getMPEGRecorder () const |
Returns the recorder used for MPEG encoding. | |
void | viewX (bool reverse=false) |
Selects axial view. | |
void | viewY (bool reverse=false) |
Selects frontal view. | |
void | viewZ (bool reverse=false) |
Selects sagittal view. | |
SoNode * | 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. | |
virtual void | spinCamera (const SbVec2f &newLocator) |
Spins the camera based on cursor motion. | |
virtual void | spinConstrainedCamera (const SbVec2f &newLocator, int axisIndex) |
Spin the camera based on cursor motion but constrained to rotation around one axis. | |
void | startSpinAnimation () |
Starts the spin animation. | |
void | stopSpinAnimation () |
Stops the spin animation. | |
virtual void | doSpinAnimation () |
Rotate the camera for spin animation. | |
SbProjector * | getSheetProjector () const |
Returns the sheet projector. | |
SbSphereSheetProjector * | getSphereSheetProjector () const |
Returns the sphere sheet projector and NULL if the current projection is not spherical. | |
void | activateSpinning () |
Set sphere sheet starting point and resets the animation queue. | |
void | rotateCamera (const SbRotation &rot) |
Rotates the camera around focal point by given incremental rotation (Given rotation is concatenated onto the current camera rotation). | |
void | constrainCameraRotation (bool x=false, bool y=false, bool z=false) |
Constrains the camera to spin around the specified axis. | |
void | setPlane (const SbVec3f &newNormal, const SbVec3f &newRight) |
Moves the camera to be aligned with the given plane. | |
void | calculateMaxSpeed () |
Calculates the maximum speed of the animation. | |
void | changeMaxStraightSpeed (SbBool increase) |
Computes the maximum straight speed. | |
void | setMinSpeed (float speed) |
Sets the minimum speed. | |
float | getMinSpeed () const |
Returns the minimum speed. | |
void | setMaxSpeed (float speed) |
Sets the maximum speed. | |
float | getMaxSpeed () const |
Returns the maximum speed. | |
void | setSpeedLimit (float limit) |
Sets the speed limit. | |
float | getSpeedLimit () const |
Returns the speed limit. | |
void | setCurrentSpeed (float speed) |
Sets the current speed. | |
float | getCurrentSpeed () const |
Returns the current speed. | |
void | setMaxStraightSpeed (float speed) |
Sets the maximum straight speed. | |
float | getMaxStraightSpeed () const |
Returns the maximum straight speed. | |
void | setMaxSpeedInc (float increment) |
Sets maximum speed multiplier. | |
float | getMaxSpeedInc () const |
Returns maximum speed multiplier. | |
void | startFlyAnimation () |
Starts the walk animation. | |
void | stopFlyAnimation () |
Stops the walk animation. | |
void | activateFlying () |
Initializes flying animation. | |
void | updateCameraFocalPoint () |
Updates focal distance. | |
void | setWalkViewerAnimMode (WalkViewerMode mode) |
Sets the camera animation for walk viewers regarding the mode. | |
SoGuiAlgoViewers::WalkViewerMode | getWalkViewerAnimMode () const |
Returns the current mode for the walk viewer camera animation. | |
void | startWalkAnimation () |
Starts the walk animation. | |
void | stopWalkAnimation () |
Stops the walk animation. | |
void | rotateCamera () |
Rotates the camera around focal point by given incremental rotation (Given rotation is concatenated onto the current camera rotation). | |
Public Member Functions inherited from SoStereoViewer | |
virtual | ~SoStereoViewer () |
Destructor. | |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Common algorithms for all viewers.
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.
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:
Definition at line 88 of file SoGuiAlgoViewers.h.
List of different buffering types.
Enumerator | |
---|---|
BUFFER_SINGLE | Single buffer. |
BUFFER_DOUBLE | Double buffer. |
BUFFER_INTERACTIVE | Double buffer while interactive viewing. |
Definition at line 180 of file SoGuiAlgoViewers.h.
List of possible drawing styles.
Definition at line 122 of file SoGuiAlgoViewers.h.
List of possible drawing types.
Enumerator | |
---|---|
STILL | Applies to static rendering. |
INTERACTIVE | Applies to rendering while interactive viewing. |
Definition at line 167 of file SoGuiAlgoViewers.h.
List of possible projection modes for the virtual trackball.
Enumerator | |
---|---|
SPHERICAL | Spherical rotation (the classic Open Inventor algorithm).
|
CYLINDRICAL | Cylindrical rotation.
|
Definition at line 199 of file SoGuiAlgoViewers.h.
Viewer type flags.
This specifies what kind of viewer will be used for some algorithms.
Enumerator | |
---|---|
EXAMINER | Algorithms for examiner viewer. |
PLANE | Algorithms for plane viewer. |
FLY | Algorithms for fly viewer. |
WALK | Algorithms for walk viewer. |
UNKNOWN | Unknown: default value. |
Definition at line 97 of file SoGuiAlgoViewers.h.
Walk viewer mode flags.
This specifies what mode will be used for the walk viewer camera animation.
Enumerator | |
---|---|
WALK_MODE | Walking mode (default). |
PAN_MODE | Panning mode. |
Definition at line 978 of file SoGuiAlgoViewers.h.
List of possible zooming modes.
Enumerator | |
---|---|
AUTOCENTER | Around the viewport center. |
GIVENPOSITION | Uses as the zooming center a point provided by the application through the setCurrentMousePositionLocator() method before calling mouseWheelMotion(). |
Definition at line 218 of file SoGuiAlgoViewers.h.
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 |
Auto clipping routine.
Reimplemented from SoGuiViewer.
|
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 |
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 |
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.
void SoGuiAlgoViewers::doCameraAnimation | ( | ) |
Does camera animation for constrained viewers.
|
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 |
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 |
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.
BufferType SoGuiAlgoViewers::getBufferingType | ( | ) |
Returns the current buffering type in the main view.
SoCamera * SoGuiAlgoViewers::getCamera | ( | ) |
Gets the edited camera.
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).
|
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 |
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.
SoDirectionalLight * SoGuiAlgoViewers::getHeadlight | ( | ) |
Returns the headlight node.
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.
|
inline |
Returns the factor used to scale the rotation speed while interactively rotating the camera.
Definition at line 283 of file SoGuiAlgoViewers.h.
|
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 |
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 |
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.
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 |
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.
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.
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 |
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.
SbBool SoGuiAlgoViewers::isHeadlight | ( | ) |
Returns TRUE if the headlight is on.
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.
|
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 |
Initializes left thumb wheel.
Reimplemented from SoGuiFullViewer.
|
virtual |
Makes the camera to zoom based on mouse wheel motion.
Reimplemented from SoGuiConstrainedViewer.
|
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 |
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 |
Reset target position to default rotation around "focal point".
|
virtual |
Restores the camera values.
Reimplemented from SoGuiConstrainedViewer.
|
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 |
Makes the camera to zoom based on right wheel motion.
Reimplemented from SoGuiConstrainedViewer.
|
virtual |
Initializes right thumb wheel.
Reimplemented from SoGuiFullViewer.
|
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 |
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 |
Sets the current buffering type in the main view (default BUFFER_DOUBLE).
|
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 |
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.
|
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.
|
inline |
Specifies the factor used to scale the rotation speed while interactively rotating the camera.
Default is 1.
Definition at line 278 of file SoGuiAlgoViewers.h.
|
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 |
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 |
Sets the camera target position for rotations.
|
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 |
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 |
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 |
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 |
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 |
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 |
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.