SoStereoViewer Class Reference
[Stereo]

VSG extension Pure virtual class for stereo support. More...

#include <Inventor/components/stereo/SoStereoViewer.h>

Inheritance diagram for SoStereoViewer:
SoGuiViewer SoQtViewer SoWinMPRenderArea SoWinViewer SoWxViewer SoXtMPRenderArea SoXtViewer SoGuiFullViewer SoQtFullViewer SoWinMPViewer SoWinFullViewer SoWxFullViewer SoXtMPViewer SoXtFullViewer SoGuiConstrainedViewer SoQtConstrainedViewer SoQtExaminerViewer SoQtPlaneViewer SoWinMPFullViewer SoWinConstrainedViewer SoWinExaminerViewer SoWinPlaneViewer SoWxExaminerViewer SoWxPlaneViewer SoXtMPFullViewer SoXtConstrainedViewer SoXtExaminerViewer SoXtPlaneViewer

List of all members.

Public Member Functions

virtual ~SoStereoViewer ()
virtual void setStereoActive (SbBool activate)=0
virtual SbBool isStereoActive ()=0
virtual void actualRendering ()=0
virtual SoCameragetViewerCamera ()=0
virtual const SbVec2sgetSize ()=0
virtual const SbVec2sgetTopLeft ()=0
virtual const SbVec2sgetBottomRight ()=0
virtual SbBool isViewerDoubleBuffer ()=0
virtual void setStereoViewType (SoBaseStereo *stereoViewType)=0
virtual SoBaseStereogetStereoViewType ()=0
virtual void reverseStereoView (SbBool reverse)=0
virtual SbBool isStereoViewReversed ()=0
virtual void setStereoAbsoluteAdjustments (SbBool)
virtual SbBool isStereoAbsoluteAdjustments () const
virtual void setStereoOffset (float offset)=0
virtual float getStereoOffset ()=0
virtual void setStereoBalance (float balance, SbBool nearFrac=false)=0
virtual float getStereoBalance ()=0
virtual SbBool isStereoBalanceNearFrac ()=0
virtual void setViewport (short left, short bottom, short width, short height)=0
virtual void getViewport (short &left, short &bottom, short &width, short &height)=0
virtual SoGLContextgetViewerContext ()=0
virtual SoSceneManagergetViewerSceneManager ()=0

Deprecated



virtual SoDEPRECATED void adjustClippingPlanes ()=0
virtual SoDEPRECATED HDC getCurrentDC ()=0

Detailed Description

VSG extension Pure virtual class for stereo support.

This pure virtual class is the class that should be extended by viewer classes that will do stereo rendering.

Note: because of internal dependant calls between stereo classes and Open Inventor viewer classes, SoStereoViewer and SoBaseStereo (and inheriting classes) cannot be used without using SoWinViewer/SoXtViewer/SoQtViewer inheriting classes.

SEE ALSO

SoWinViewer, SoXtViewer, SoQtViewer


Constructor & Destructor Documentation

virtual SoStereoViewer::~SoStereoViewer (  )  [inline, virtual]

Destructor.


Member Function Documentation

virtual void SoStereoViewer::actualRendering (  )  [pure virtual]

This method is called automatically when the viewer requests that its SoBaseStereo object perform stereo rendering.

actualRendering() may then be called twice (once for each eye view) and therefore must not take into account any stereo-specific settings. It should behave as if it were a rendering method for a monoscopic view.

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual SoDEPRECATED void SoStereoViewer::adjustClippingPlanes (  )  [pure virtual]

Along with the manipulation of the camera, SoBaseStereo needs to set the scene appropriately when changing the camera settings.

Deprecated:

Deprecated since Open Inventor 9000
No longer used.

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual const SbVec2s& SoStereoViewer::getBottomRight (  )  [pure virtual]

Returns the position of the OpenGL drawing window in absolute screen coordinates (not relative to parent window) of the native window system (typically Y increasing downward).

Returns "Bottom" in the first value of the vector and "Right" in the second value (reverse of the usual X,Y ordering).

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual SoDEPRECATED HDC SoStereoViewer::getCurrentDC (  )  [pure virtual]

[Windows only] This method has no effect on UNIX systems.

Gets the current device context for SbGlContextHelper::makeCurrent.

Deprecated:

Deprecated since Open Inventor 9000
No longer used.

Implemented in SoWinMPRenderArea, SoWinMPViewer, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual const SbVec2s& SoStereoViewer::getSize (  )  [pure virtual]

Returns the size of the OpenGL drawing window in absolute screen coordinates (not relative to parent window) of the native window system.

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual float SoStereoViewer::getStereoBalance (  )  [pure virtual]

Queries the stereo balance (the position of the zero parallax plane).

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual float SoStereoViewer::getStereoOffset (  )  [pure virtual]

Queries the stereo offset.

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual SoBaseStereo* SoStereoViewer::getStereoViewType (  )  [pure virtual]

Returns the stereo view type.

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual const SbVec2s& SoStereoViewer::getTopLeft (  )  [pure virtual]

Returns the position of the OpenGL drawing window in absolute screen coordinates (not relative to parent window) of the native window system (typically Y increasing downward).

Returns "Top" in the first value of the vector and "Left" in the second value (reverse of the usual X,Y ordering).

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual SoCamera* SoStereoViewer::getViewerCamera (  )  [pure virtual]

Returning the camera allows the SoBaseStereo to manipulate it to achieve the stereo effect.

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual SoGLContext* SoStereoViewer::getViewerContext (  )  [pure virtual]

Returns the current SoGLContext to render to.

Must return a valid SoGLContext instance.

Implemented in SoWinMPRenderArea, and SoXtMPRenderArea.

virtual SoSceneManager* SoStereoViewer::getViewerSceneManager (  )  [pure virtual]

Returns the current SoSceneManager to render to.

Must return a valid SoSceneManager instance.

Implemented in SoWinMPRenderArea, and SoXtMPRenderArea.

virtual void SoStereoViewer::getViewport ( short &  left,
short &  bottom,
short &  width,
short &  height 
) [pure virtual]

Returns viewport region with origin (lower-left corner) and size, given as pixel coordinates.

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual SbBool SoStereoViewer::isStereoAbsoluteAdjustments (  )  const [inline, virtual]

Queries if the stereo adjustments are absolute.

Not virtual pure for compatibity reasons.

Reimplemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual SbBool SoStereoViewer::isStereoActive (  )  [pure virtual]

Queries stereo activation.

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual SbBool SoStereoViewer::isStereoBalanceNearFrac (  )  [pure virtual]

Returns TRUE when the stereo balance adjustement is defined as a fraction of the camera near distance.

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual SbBool SoStereoViewer::isStereoViewReversed (  )  [pure virtual]

Queries reversal of the left and right views.

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual SbBool SoStereoViewer::isViewerDoubleBuffer (  )  [pure virtual]

Queries if viewer is double buffered.

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual void SoStereoViewer::reverseStereoView ( SbBool  reverse  )  [pure virtual]

Sets reversal of the left and right views.

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual void SoStereoViewer::setStereoAbsoluteAdjustments ( SbBool   )  [inline, virtual]

Specifies if stereo adjustments are absolute.

FALSE by default.

The default non-absolute mode allows the stereo settings to be valid over a range of different view volume settings. If you chose absolute mode, you are responsible for modifying the stereo settings (if necessary) when the view volume changes.

When absolute mode is TRUE, stereo offset and balance are used as follows for the right eye view:

 StereoCameraOffset = getStereoAdjustment();
 FrustumAsymmetry   = getBalanceAdjustment();

 glTranslated (-StereoCameraOffset, 0, 0);
 glFrustum (FrustumLeft + FrustumAsymmetry, FrustumRight + FrustumAsymmetry,
            FrustumBottom, FrustumTop, NearClipDistance, FarClipDistance);

The left eye view is symmetric.

When absolute mode is FALSE, stereo offset and balance are used as follows for the right eye view:

Xrange is right minus left (i.e., first two arguments of glFrustum) and multiply that difference by the ratio of the distance to the desired plane of zero parallax to the near clipping plane distance.

 StereoCameraOffset   = Xrange * 0.035 * getStereoAdjustment();
 FrustumAsymmetry     = -StereoCameraOffset * getBalanceAdjustment();
 ZeroParallaxDistance = (NearClipDistance + FarClipDistance)/0.5;

 FrustumAsymmetry *= NearClipDistance / ZeroParallaxDistance;

 glTranslated (-StereoCameraOffset, 0, 0);
 glFrustum (FrustumLeft + FrustumAsymmetry, FrustumRight + FrustumAsymmetry,
            FrustumBottom, FrustumTop, NearClipDistance, FarClipDistance);

The left eye view is symmetric.

Not virtual pure for compatiblity reasons.

Reimplemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual void SoStereoViewer::setStereoActive ( SbBool  activate  )  [pure virtual]

Sets stereo activation.

Default is FALSE. The default can be set using the OIV_STEREO_ACTIVE environment variable.

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual void SoStereoViewer::setStereoBalance ( float  balance,
SbBool  nearFrac = false 
) [pure virtual]

Sets the stereo balance (the position of the zero parallax plane) and specifies whether the balance value is defined as a fraction of the camera near distance.

Note: Since the projection matrix always depends on the camera's near plane, in some cases it may be necessary to detect changes to the camera near plane and adjust by setting a new stereo balance value. Open Inventor will make these adjustments automatically if the nearFrac parameter is set to TRUE. In this case the stereo balance value is defined as a fraction of the camera near distance.

Default balance is 1.0. The default can be set using the OIV_STEREO_BALANCE environment variable. Default nearFrac is FALSE. The default can be set using the OIV_STEREO_BALANCE_NEAR_FRAC environment variable.

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual void SoStereoViewer::setStereoOffset ( float  offset  )  [pure virtual]

Sets the stereo offset (the distance of each eye from the camera position).

The right eye is moved plus offset and the left eye is moved minus offset. Default is 0.7. The default can be set using OIV_STEREO_OFFSET environment variable.

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual void SoStereoViewer::setStereoViewType ( SoBaseStereo stereoViewType  )  [pure virtual]

If stereoViewType is NULL, the stereo is inactivated (see setStereoActive).

Default is SoAnaglyphStereo with RED_CYAN color filter. The default can be set using the OIV_STEREO_TYPE environment variable.

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.

virtual void SoStereoViewer::setViewport ( short  left,
short  bottom,
short  width,
short  height 
) [pure virtual]

Sets viewport region with given origin (lower-left corner) and size, given as pixel coordinates.

Implemented in SoWinMPRenderArea, SoXtMPRenderArea, SoQtViewer, SoWinViewer, SoWxViewer, and SoXtViewer.


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/