SoGuiAlgoViewers Class Reference

VSG extension Common algorithms for all viewers. More...

#include <Inventor/Gui/viewers/SoGuiAlgoViewers.h>

Inheritance diagram for SoGuiAlgoViewers:
SoGuiConstrainedViewer SoGuiFullViewer SoGuiViewer SoGuiRenderArea SoStereoViewer SoGuiGLWidget SoGuiComponent SoGuiExaminerViewer SoGuiFlyViewer SoGuiPlaneViewer SoGuiWalkViewer

List of all members.

Public Types

enum  ViewerTypes {
  EXAMINER,
  PLANE,
  FLY,
  WALK,
  UNKNOWN
}
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
}
enum  DrawType {
  STILL,
  INTERACTIVE
}
enum  BufferType {
  BUFFER_SINGLE,
  BUFFER_DOUBLE,
  BUFFER_INTERACTIVE
}
enum  ProjectorsType {
  SPHERICAL,
  CYLINDRICAL
}
enum  ZoomingType {
  AUTOCENTER,
  GIVENPOSITION
}
enum  WalkViewerMode {
  WALK_MODE,
  PAN_MODE
}

Public Member Functions

virtual SoType getTypeId () const
 SoGuiAlgoViewers ()
void setConstrained (SbBool constrained)
SbBool isConstrained () const
void setViewerType (ViewerTypes vType)
SoGuiAlgoViewers::ViewerTypes getViewerType () const
void resetRenderAction ()
void setSheetProjectionType (const ProjectorsType &projType)
ProjectorsType getSheetProjectionType () const
void setMouseAngularSpeed (double speedFactor)
double getMouseAngularSpeed ()
void setZoomingType (const ZoomingType &zoomType)
ZoomingType getZoomingType () const
virtual void setRotationTargetPosition (const SbVec3f &targetPos)
virtual void resetRotationTargetPosition ()
virtual bool getRotationTargetPosition (SbVec3f &targetPos)
virtual void getDefaultRotationTargetPosition (SbVec3f &targetPos)
virtual void setSceneGraph (SoNode *newScene)
virtual SoNodegetSceneGraph ()
void enableShadows (bool onOrOff)
virtual void setCamera (SoCamera *newCamera)
SoCameragetCamera ()
virtual void setCameraType (SoType type)
SoType getCameraType ()
virtual void toggleCameraType ()
virtual void setPreserveCameraHeightAngle (SbBool flag)
virtual SbBool isCameraHeightAnglePreserved () const
virtual void viewAll ()
virtual void saveHomePosition ()
virtual void resetToHomePosition ()
virtual void setHeadlight (SbBool insertFlag)
SbBool isHeadlight ()
SoDirectionalLightgetHeadlight ()
virtual void setDrawStyle (DrawType type, DrawStyle style)
DrawStyle getDrawStyle (DrawType type)
virtual void setBufferingType (BufferType type)
BufferType getBufferingType ()
virtual void setViewing (SbBool flag)
SbBool isViewing () const
virtual void recomputeSceneSize ()
virtual void setSeekMode (SbBool onOrOff)
SbBool isSeekMode ()
virtual void adjustCameraClippingPlanes ()
void setBoxSelectionMode (SbBool on)
SbBool isBoxSelection () const
void setBoxDrawingMode (SbBool on)
SbBool isBoxDrawing () const
void doBoxZoom (int x1, int y1, int x2, int y2)
virtual void rollCamera (const SbVec2s &newLocator)
virtual void dollyCamera (const SbVec2s &newLocator)
virtual void dollyCamera (float dist)
virtual void reverseDollyCamera (const SbVec2s &newLocator)
virtual void panCamera (const SbVec2f &newLocator)
void doCameraAnimation ()
virtual void rightWheelStart ()
virtual void bottomWheelStart ()
virtual void leftWheelStart ()
virtual void bottomWheelMotion (float newVal)
virtual void leftWheelMotion (float newVal)
virtual void rightWheelMotion (float newVal)
virtual void mouseWheelMotion (float newVal)
void activatePanning ()
void setStartMousePositionLocator (const SbVec2s &mousePosition)
SbVec2s getStartMousePositionLocator () const
void setCurrentMousePositionLocator (const SbVec2s &mousePosition)
SbVec2s getCurrentMousePositionLocator () const
void setPreviousMousePositionLocator (const SbVec2s &mousePosition)
SbVec2s getPreviousMousePositionLocator () const
void setCameraPositionLocator (const SbVec3f &camPosition)
SbVec3f getCameraPositionLocator () const
void setCameraFocalPlane (const SbPlane &focalPlane)
SbPlane getCameraFocalPlane () const
void interactiveCountInc ()
void interactiveCountDec ()
void setPrevAnimTime (SbTime previous)
SbTime getPrevAnimTime () const
virtual void computeSeekFinalOrientation ()
virtual void setMPEGRecorder (SoMPEGRenderer *recorder)
virtual SoMPEGRenderergetMPEGRecorder () const
void viewX (bool reverse=false)
void viewY (bool reverse=false)
void viewZ (bool reverse=false)
SoNodegetSceneRoot ()
virtual void spinCamera (const SbVec2f &newLocator)
virtual void spinConstrainedCamera (const SbVec2f &newLocator, int axisIndex)
void startSpinAnimation ()
void stopSpinAnimation ()
virtual void doSpinAnimation ()
SbProjectorgetSheetProjector () const
SbSphereSheetProjectorgetSphereSheetProjector () const
void activateSpinning ()
void rotateCamera (const SbRotation &rot)
void constrainCameraRotation (bool x=false, bool y=false, bool z=false)
void setPlane (const SbVec3f &newNormal, const SbVec3f &newRight)
void calculateMaxSpeed ()
void changeMaxStraightSpeed (SbBool increase)
void setMinSpeed (float speed)
float getMinSpeed () const
void setMaxSpeed (float speed)
float getMaxSpeed () const
void setSpeedLimit (float limit)
float getSpeedLimit () const
void setCurrentSpeed (float speed)
float getCurrentSpeed () const
void setMaxStraightSpeed (float speed)
float getMaxStraightSpeed () const
void setMaxSpeedInc (float increment)
float getMaxSpeedInc () const
void startFlyAnimation ()
void stopFlyAnimation ()
void activateFlying ()
void updateCameraFocalPoint ()
void setWalkViewerAnimMode (WalkViewerMode mode)
SoGuiAlgoViewers::WalkViewerMode getWalkViewerAnimMode () const
void startWalkAnimation ()
void stopWalkAnimation ()
void rotateCamera ()

Static Public Member Functions

static SoType getClassTypeId ()

Deprecated



SoDEPRECATED SbBool setFullSceneAntialiasing (SbBool enable, float quality=-1.f, int filterMask=SoFullSceneAntialiasing::ALL)
SoDEPRECATED SbBool isFullSceneAntialiasingEnabled () const
SoDEPRECATED SbBool getFullSceneAntialiasing (float &quality, int &filterMask) const
SoDEPRECATED SbBool isFullSceneAntialiasingAvailable ()
SoDEPRECATED SbBool isFullSceneAntialiasingHQAvailable ()
SoDEPRECATED SbBool setFullSceneAntialiasingHQ (SbBool enable)
SoDEPRECATED SbBool isFullSceneAntialiasingHQEnabled () const
SoDEPRECATED int getFullSceneAntialiasingMaxSamples () const

Detailed Description

VSG extension 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.

   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:


Member Enumeration Documentation

List of different buffering types.

Enumerator:
BUFFER_SINGLE 

Single buffer.

BUFFER_DOUBLE 

Double buffer.

BUFFER_INTERACTIVE 

Double buffer while interactive viewing.

Reimplemented from SoGuiViewer.

List of possible drawing styles.

Enumerator:
VIEW_AS_IS 

Unchanged.

VIEW_HIDDEN_LINE 

Render only the frontmost lines.

VIEW_NO_TEXTURE 

Render without textures.

VIEW_LOW_COMPLEXITY 

Render low complexity and no texture.

VIEW_LINE 

Wireframe draw style.

VIEW_POINT 

Point draw style.

VIEW_BBOX 

Bounding box draw style.

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.

Reimplemented from SoGuiViewer.

List of possible drawing types.

Enumerator:
STILL 

Applies to static rendering.

INTERACTIVE 

Applies to rendering while interactive viewing.

Reimplemented from SoGuiViewer.

List of possible projection modes for the virtual trackball.

Enumerator:
SPHERICAL 

Spherical rotation (the classic Open Inventor algorithm).


Uses an SbSphereSheetProjector to determine rotation angle and rotation axis used to rotate the camera.

CYLINDRICAL 

Cylindrical rotation.


Uses an SbCylinderSheetProjector. The axis is the direction normal to the movement of the cursor on the screen and the angle is proportional to the mouse movement. The coefficient can be set using the setMouseAngularSpeed() method.

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.

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.

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().


Constructor & Destructor Documentation

SoGuiAlgoViewers::SoGuiAlgoViewers (  ) 

Constructor.


Member Function Documentation

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.

Parameters:
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.

Parameters:
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.

Parameters:
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

DrawStyle SoGuiAlgoViewers::getDrawStyle ( DrawType  type  ) 

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.

Deprecated:

Deprecated since Open Inventor 9100
Use getAntialiasingMode() or getAntialiasingQuality() to get this information.

Reimplemented from SoGuiGLWidget.

SoDEPRECATED int SoGuiAlgoViewers::getFullSceneAntialiasingMaxSamples (  )  const

Returns the maximum number of samples for full-scene antialiasing (FSAA).

Deprecated:

Deprecated since Open Inventor 9100
Use getAntialiasingParameters() to get this information.

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.

See getSheetProjector() and setSheetProjectionType().

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.

Deprecated:

Deprecated since Open Inventor 9100
See the appropriate subclass of SoGLGraphicConfig, e.g. SoWinGLGraphicConfig.

Reimplemented from SoGuiGLWidget.

SoDEPRECATED SbBool SoGuiAlgoViewers::isFullSceneAntialiasingEnabled (  )  const

Returns TRUE, if full-scene antialiasing (FSAA) is enabled.

Deprecated:

Deprecated since Open Inventor 9100
Use getAntialiasingMode() or getAntialiasingParameters() to get this information.

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.

Deprecated:

Deprecated since Open Inventor 9100
See the appropriate subclass of SoGLGraphicConfig, e.g. SoWinGLGraphicConfig.

Reimplemented from SoGuiGLWidget.

SoDEPRECATED SbBool SoGuiAlgoViewers::isFullSceneAntialiasingHQEnabled (  )  const

Returns TRUE if the high quality mode for full-scene antialiasing (FSAA) is enabled.

Deprecated:

Deprecated since Open Inventor 9100
Use getAntialiasingParameters() to get this information.

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

virtual void SoGuiAlgoViewers::setDrawStyle ( DrawType  type,
DrawStyle  style 
) [virtual]

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.

Parameters:
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.
Deprecated:

Deprecated since Open Inventor 9100
Use setAntialiasing(float,AntialiasingMode) method with mode FSAA or use the setAntialiasing(SoAntialiasingParameters*) with an SoFullSceneAntialiasingParameters object instead.

Reimplemented from SoGuiGLWidget.

SoDEPRECATED SbBool SoGuiAlgoViewers::setFullSceneAntialiasingHQ ( SbBool  enable  ) 

Enables or disables the high quality mode for full-scene antialiasing (FSAA).

This feature requires the GL_MULTISAMPLE_FILTER_HINT_NV extension.

Deprecated:

Deprecated since Open Inventor 9100
To enable FSAA HQ use the setAntialiasing(SoAntialiasingParameters*) method with an SoFullSceneAntialiasingParameters object.

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.

Parameters:
recorder the recorder to be used.

Note: The destruction of the recorder is handled by SoGuiAlgoViewers.

Reimplemented from SoGuiRenderArea.

void SoGuiAlgoViewers::setPlane ( const SbVec3f newNormal,
const SbVec3f newRight 
)

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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:

  • X = 0
  • Y = 1
  • Z = 2
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.


The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 12 Feb 2024
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/