SoWinMPViewer Class Reference

ScaleViz Multi-Pipe viewer component lowest base class. More...

#include <Inventor/MP/Win/viewers/SoWinMPViewer.h>

Inheritance diagram for SoWinMPViewer:
SoWinMPRenderArea SoWinMPGLWidget SoStereoViewer SoWinComponent SoWinMPFullViewer SoWinMPExaminerViewer

List of all members.

Public Types

enum  Type {
  BROWSER,
  EDITOR
}
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  DecimationStrategy {
  NORMAL,
  FIXED_NUM_TRIANGLES,
  FRAMES_PER_SECOND,
  FIXED_PERCENTAGE
}
enum  CursorStyle {
  CLASSIC,
  XOR,
  SHADOW
}

Public Member Functions

virtual void setSceneGraph (SoNode *newScene)
virtual SoNodegetSceneGraph ()
virtual void setCamera (SoCamera *cam)
SoCameragetCamera ()
virtual void setCameraType (SoType type)
SoType getCameraType ()
virtual void setPreserveCameraHeightAngle (SbBool flag)
virtual SbBool isCameraHeightAnglePreserved () const
virtual void enableSeekWithOrtho (SbBool flag)
virtual SbBool isSeekWithOrthoEnabled () const
virtual void viewAll ()
virtual void saveHomePosition ()
virtual void resetToHomePosition ()
void setCameraTypeChangeCallback (SoWinMPViewerCameraTypeChangeCB *callback, void *userdata)
void setHeadlight (SbBool onOrOff)
SbBool isHeadlight ()
SoDirectionalLightgetHeadlight ()
void setDrawStyle (SoWinMPViewer::DrawType type, SoWinMPViewer::DrawStyle style)
SoWinMPViewer::DrawStyle getDrawStyle (SoWinMPViewer::DrawType type)
void setBufferingType (SoWinMPViewer::BufferType type)
SoWinMPViewer::BufferType getBufferingType ()
virtual void setDoubleBuffer (SbBool onOrOff)
virtual void setViewing (SbBool onOrOff)
SbBool isViewing () const
virtual void setCursorEnabled (SbBool onOrOff)
SbBool isCursorEnabled () const
void setAutoClipping (SbBool onOrOff)
SbBool isAutoClipping () const
void setDetailSeek (SbBool onOrOff)
SbBool isDetailSeek ()
void setSeekTime (float seconds)
float getSeekTime ()
void addStartCallback (SoWinMPViewerCB *f, void *userData=NULL)
void addFinishCallback (SoWinMPViewerCB *f, void *userData=NULL)
void removeStartCallback (SoWinMPViewerCB *f, void *userData=NULL)
void removeFinishCallback (SoWinMPViewerCB *f, void *userData=NULL)
void copyView (Time eventTime)
void pasteView (Time eventTime)
virtual void setNormalVisual (XVisualInfo *)
virtual void recomputeSceneSize ()
void setDecimationStrategy (DecimationStrategy strategy)
DecimationStrategy getDecimationStrategy ()
void setGoalNumberOfTriangles (int32_t goal)
int32_t getGoalNumberOfTriangles ()
void setGoalFramesPerSecond (float goal)
float getGoalFramesPerSecond ()
void setFixedPercentage (float percent)
float getFixedPercentage ()
void enableFullRenderingWhenStill (SbBool onOff)
SbBool isFullRenderingWhenStill ()
SbBool isStillNow ()
void setFramesPerSecondCallback (SoWinMPViewerFPSCB *callback, void *userData=NULL)
void setNumSamples (int numFrames)
int getNumSamples ()
void setDecimationPercentageCallback (SoWinMPViewerDecimationPercentageCB *callback, void *userData=NULL)
float getCurrentDecimationPercentage ()
void insertSceneTransform (void)
SoTransformgetSceneTransform (void)
SoTransformgetWandTransform (void)
void setWandGeometryFile (SbString wandFile)
void setHeadTracking (int value)
virtual void navigate (void)
HDC getCurrentDC (int id)
virtual void setCursorStyle (SoWinMPViewer::CursorStyle style)
SoWinMPViewer::CursorStyle getCursorStyle ()
virtual void toggleCameraType ()

Deprecated



SoDEPRECATED HDC getCurrentDC ()

Detailed Description

ScaleViz Multi-Pipe viewer component lowest base class.

This is the Multi-Pipe version of SoWinViewer.

NOTE: This class does not exist in Open Inventor 10.0 and later.

The typedefs, enums, and public methods of SoWinMPViewer are exactly the same as for SoWinViewer (except for the name changes).


Member Enumeration Documentation

list of different buffering types

Enumerator:
BUFFER_SINGLE 

Single buffer.

BUFFER_DOUBLE 

Double buffer.

BUFFER_INTERACTIVE 

Double buffer while interactive viewing.

Classic cursors are all white and tend to disappear over white geometry or white background.

New styles avoid that problem (but have quirks of their own of course :-). Added for v2.6

Enumerator:
CLASSIC 

Standard Open Inventor cursors.

XOR 

Improved cursors using XOR.

SHADOW 

Improved cursors using "shadow".

list of decimation strategies

Enumerator:
NORMAL 

Decimation is not changed.

FIXED_NUM_TRIANGLES 

Try to fix number of triangles drawn.

FRAMES_PER_SECOND 

Try to fix frames per second.

FIXED_PERCENTAGE 

Use given decimation percentage.

list of possible drawing styles Note: Refer to the SoWinMPViewer man pages for a complete description of those draw 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.

DrawType.

Enumerator:
STILL 

Applies to static rendering.

INTERACTIVE 

Applies to rendering while interactive viewing.

An EDITOR viewer will create a camera under the user supplied scene graph (specified in setSceneGraph()) if it cannot find one in the scene and will leave the camera behind when supplied with a new scene.

A BROWSER viewer will also create a camera if it cannot find one in the scene, but will place it above the scene graph node (camera will not appear in the user supplied scene graph), and will automatically remove it when another scene is supplied to the viewer.

Enumerator:
BROWSER 

Camera views scene, but is not added to scene.

EDITOR 

Camera is added to user's scene.


Member Function Documentation

void SoWinMPViewer::addFinishCallback ( SoWinMPViewerCB f,
void *  userData = NULL 
) [inline]

Adds finish callback routine on the viewer.

Start callbacks are called whenever the user starts doing interactive viewing (for example, mouse down), and finish callbacks are called when user is done doing interactive work (for example, mouse up).

Note: The viewer "this" pointer is passed as callback data.

void SoWinMPViewer::addStartCallback ( SoWinMPViewerCB f,
void *  userData = NULL 
) [inline]

Adds start callback routine on the viewer.

Start callbacks are called whenever the user starts doing interactive viewing (for example, mouse down), and finish callbacks are called when user is done doing interactive work (for example, mouse up).

Note: The viewer "this" pointer is passed as callback data.

void SoWinMPViewer::copyView ( Time  eventTime  ) 

Copies the view.

eventTime should be the time of the Windows message which initiated the copy (e.g. if copy is initiated from a keystroke, eventTime should be the time in the key down message.)

void SoWinMPViewer::enableFullRenderingWhenStill ( SbBool  onOff  ) 

If this flag is set, the viewer will render at full resolution when it sits still for a certain period of time.

virtual void SoWinMPViewer::enableSeekWithOrtho ( SbBool  flag  )  [inline, virtual]

If FALSE, the seek functionality is disabled for an SoOrthographicCamera.

Default is TRUE.

SoWinMPViewer::BufferType SoWinMPViewer::getBufferingType (  )  [inline]

Gets the current buffering type in the main view.

SoCamera* SoWinMPViewer::getCamera (  )  [inline]

Gets the edited camera.

SoType SoWinMPViewer::getCameraType (  )  [inline]

Gets the camera type that will be created by the viewer if no cameras are found in the scene graph (see SoPerspectiveCamera and SoOrthographicCamera).

SoDEPRECATED HDC SoWinMPViewer::getCurrentDC (  )  [virtual]
Deprecated:

Deprecated since Open Inventor 9000
No longer used.

Reimplemented from SoWinMPRenderArea.

HDC SoWinMPViewer::getCurrentDC ( int  id  ) 
float SoWinMPViewer::getCurrentDecimationPercentage (  ) 

Returns the Decimation Percentage the viewer used in its last render.

SoWinMPViewer::CursorStyle SoWinMPViewer::getCursorStyle (  )  [inline]

Returns the cursor style.

DecimationStrategy SoWinMPViewer::getDecimationStrategy (  )  [inline]

Gets strategy to use to decide on decimation value.

SoWinMPViewer::DrawStyle SoWinMPViewer::getDrawStyle ( SoWinMPViewer::DrawType  type  ) 

Queries the current drawing style in the main view.

float SoWinMPViewer::getFixedPercentage (  )  [inline]

Gets fixed percentage for the viewer to render (0.0 to 1.0).

float SoWinMPViewer::getGoalFramesPerSecond (  )  [inline]

Gets goal frames per second for the viewer to try to render.

int32_t SoWinMPViewer::getGoalNumberOfTriangles (  )  [inline]

Gets goal number of triangles for the viewer to try to render.

SoDirectionalLight* SoWinMPViewer::getHeadlight (  )  [inline]

Returns the headlight node.

int SoWinMPViewer::getNumSamples (  )  [inline]

Gets how many frames should be timed before frames per second callback is called.

virtual SoNode* SoWinMPViewer::getSceneGraph (  )  [virtual]

Gets the scene graph to be rendered in this component's window.

Reimplemented from SoWinMPRenderArea.

SoTransform* SoWinMPViewer::getSceneTransform ( void   ) 

returns the SoTransform node

float SoWinMPViewer::getSeekTime (  )  [inline]

Queries the seek time.

SoTransform* SoWinMPViewer::getWandTransform ( void   ) 

returns the SoTransform that modifies the wand

void SoWinMPViewer::insertSceneTransform ( void   ) 

add an SoTransform node just after the viewer's camera

SbBool SoWinMPViewer::isAutoClipping (  )  const [inline]

Queries if auto clipping is ON.

virtual SbBool SoWinMPViewer::isCameraHeightAnglePreserved (  )  const [inline, virtual]

Query whether the SoPerspectiveCamera's heightAngle is preserved if the camera is changed to an SoOrthographicCamera and then toggled back to an SoPerspectiveCamera.

SbBool SoWinMPViewer::isCursorEnabled (  )  const [inline]

Queries whether the viewer is allowed to change the cursor over the renderArea window.

SbBool SoWinMPViewer::isDetailSeek (  )  [inline]

Queries whether detail seek is on.

SbBool SoWinMPViewer::isFullRenderingWhenStill (  )  [inline]

Queries if the viewer will render at full resolution when it sits still for a certain period of time.

SbBool SoWinMPViewer::isHeadlight (  )  [inline]

Queries if the headlight is on.

virtual SbBool SoWinMPViewer::isSeekWithOrthoEnabled (  )  const [inline, virtual]

Query whether the seek functionality is enabled for an SoOrthographicCamera.

SbBool SoWinMPViewer::isStillNow (  )  [inline]

Returns whether the viewer is currently still.

SbBool SoWinMPViewer::isViewing (  )  const [inline]

Queries whether the viewer is turned on or off.

See setViewing() for details.

virtual void SoWinMPViewer::navigate ( void   )  [virtual]
void SoWinMPViewer::pasteView ( Time  eventTime  ) 

Pastes the view.

eventTime should be the time of the Windows message which initiated the paste (e.g. if paste is initiated from a keystroke, eventTime should be the time in the key down message.)

virtual void SoWinMPViewer::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.

void SoWinMPViewer::removeFinishCallback ( SoWinMPViewerCB f,
void *  userData = NULL 
) [inline]

Removes finish callback routine from the viewer.

Note: The viewer "this" pointer is passed as callback data.

void SoWinMPViewer::removeStartCallback ( SoWinMPViewerCB f,
void *  userData = NULL 
) [inline]

Removes start callback routine from the viewer.

Note: The viewer "this" pointer is passed as callback data.

virtual void SoWinMPViewer::resetToHomePosition (  )  [virtual]

Restores the camera values.

Reimplemented in SoWinMPExaminerViewer.

virtual void SoWinMPViewer::saveHomePosition (  )  [virtual]

Saves the camera values.

void SoWinMPViewer::setAutoClipping ( SbBool  onOrOff  ) 

Sets the auto clipping plane.

When auto clipping is ON, the camera near and far planes are dynamically adjusted to be as tight as possible around the objects being viewed.

void SoWinMPViewer::setBufferingType ( SoWinMPViewer::BufferType  type  ) 

Sets the current buffering type in the main view (default SoWinViewer::BUFFER_DOUBLE).

Reimplemented in SoWinMPFullViewer.

virtual void SoWinMPViewer::setCamera ( SoCamera cam  )  [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 in SoWinMPExaminerViewer, and SoWinMPFullViewer.

virtual void SoWinMPViewer::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).

void SoWinMPViewer::setCameraTypeChangeCallback ( SoWinMPViewerCameraTypeChangeCB callback,
void *  userdata 
)

Defines a callback which is called each time the camera type has changed (change from SoPerspectiveCamera to SoOrthographicCamera or vice versa).

virtual void SoWinMPViewer::setCursorEnabled ( SbBool  onOrOff  )  [virtual]

Sets whether the viewer is allowed to change the cursor over the renderArea window.

When disabled, the cursor is undefined by the viewer and will not change as the mode of the viewer changes. When re-enabled, the viewer will reset it to the appropriate icon.

Disabling the cursor enables the application to set the cursor directly on the viewer window or on any parent widget of the viewer. This can be used when setting a busy cursor on the application shell.

Reimplemented in SoWinMPExaminerViewer.

virtual void SoWinMPViewer::setCursorStyle ( SoWinMPViewer::CursorStyle  style  )  [virtual]

Sets the cursor style.

The standard Open Inventor (CLASSIC) cursors use all white pixels, which can be difficult to see over light colored geometry or background. The XOR and SHADOW style cursors are much easier to see. The XOR style cursors that have a "hand" shape differ from the other styles in that the cursor hotspot is at the tip of the index finger. This generally works better for picking.

The cursor can also be specified using environment variable OIV_CURSOR_STYLE, where the values 0, 1, and 2 specify Classic, XOR, and Shadow cursors respectively.

Note: This method only has an effect if setCursorEnabled is set to TRUE.

void SoWinMPViewer::setDecimationPercentageCallback ( SoWinMPViewerDecimationPercentageCB callback,
void *  userData = NULL 
)

Registers decimation percentage callback.

void SoWinMPViewer::setDecimationStrategy ( DecimationStrategy  strategy  ) 

Sets strategy to use to decide on decimation value.

void SoWinMPViewer::setDetailSeek ( SbBool  onOrOff  )  [inline]

Turns stereo viewing on/off on the viewer (default off).

To insure backward compatibility with older Open Inventor versions, and specifically with the old stereo model, this method still applies to stereo. Like the current stereo model, the old model makes use of an offset to represent the eye separation. However, instead of adapting the view volume, the cameras were rotated toward the default point of focus, creating the stereo viewing angle.

If no type of stereo (from the current stereo model) is set on the viewer and setStereoViewing() is called, then the old stereo model is in effect. Note that setStereoViewing is the method that actually sets OpenGL in stereo mode. If the old stereo model is in effect, then the offset passed to setStereoOffset() is no longer a factor but the actual value used to separate the cameras. In that case, the default value for the offset is 3.

When in stereo mode, which may not work on all machines, the scene is rendered twice (in the left and right buffers) with an offset between the two views to simulate stereo viewing. Stereo glasses may be needed to see the effect. Old style stereo viewing is only possible with a graphics board that has support for stereo.

See SoStereoViewer for information on the current stereo model. Queries if stereo viewing is on or off on the viewer. See setStereoViewing() for additional info. Sets the stereo offset. See setStereoViewing() for additional info. Returns the stereo offset. See setStereoViewing() for additional info. When the viewer is in seek mode, left mouse clicks initiate a pick, and the viewer changes its orientation and position to look at the picked object. This routine tells the seeking viewer whether to orient the camera towards the picked point (detail on), or the center of the object's bounding box (detail off). Default is detail on.

virtual void SoWinMPViewer::setDoubleBuffer ( SbBool  onOrOff  )  [virtual]

Routine that dynamically changes between single and double buffering.

Default is double buffer off. (The SoWinRenderArea subclass makes it double buffer by default.)

Reimplemented from SoWinMPGLWidget.

void SoWinMPViewer::setDrawStyle ( SoWinMPViewer::DrawType  type,
SoWinMPViewer::DrawStyle  style 
)

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

Reimplemented in SoWinMPFullViewer.

void SoWinMPViewer::setFixedPercentage ( float  percent  ) 

Sets fixed percentage for the viewer to render (0.0 to 1.0).

void SoWinMPViewer::setFramesPerSecondCallback ( SoWinMPViewerFPSCB callback,
void *  userData = NULL 
)

Registers frames per second callback.

void SoWinMPViewer::setGoalFramesPerSecond ( float  goal  ) 

Sets goal frames per second for the viewer to try to render.

void SoWinMPViewer::setGoalNumberOfTriangles ( int32_t  goal  ) 

Sets goal number of triangles for the viewer to try to render.

void SoWinMPViewer::setHeadlight ( SbBool  onOrOff  ) 

Turns the headlight on/off (default on).

Reimplemented in SoWinMPFullViewer.

void SoWinMPViewer::setHeadTracking ( int  value  ) 

sets the sensor id that tracks the head.

If set with value of -1, headtracking is disabled.

virtual void SoWinMPViewer::setNormalVisual ( XVisualInfo *  vis  )  [virtual]

Specifies the exact pixel format descriptor for the normal window.

This allows the user to create all possible pixel format descriptors supported by OpenGL. The PIXELFORMATDESCRIPTOR structure should be a valid OpenGL pixel format descriptor returned by ChoosePixelFormat(). (The methods for setting the pixel format descriptor are virtual so that derived classes can know when the pixel format descriptor is changing.)

Reimplemented from SoWinMPGLWidget.

void SoWinMPViewer::setNumSamples ( int  numFrames  ) 

Sets how many frames should be timed before frames per second callback is called, default is 10.

virtual void SoWinMPViewer::setPreserveCameraHeightAngle ( SbBool  flag  )  [inline, 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.

virtual void SoWinMPViewer::setSceneGraph ( SoNode newScene  )  [virtual]

Sets the scene graph to be rendered in this component's window.

Reimplemented from SoWinMPRenderArea.

void SoWinMPViewer::setSeekTime ( float  seconds  )  [inline]

Sets the time a seek takes to change to the new camera location.

A value of zero seeks directly to the point without any animation. Default value is 2 seconds.

For historical reasons, setting the seek time to zero causes the viewer to stay in seek mode. If you want the camera to move immediately to its new position and still have the viewer leave seek mode after moving the camera, set the seek time to a very small non-zero value.

virtual void SoWinMPViewer::setViewing ( SbBool  onOrOff  )  [virtual]

Sets whether the viewer is turned on or off.

When turned on, messages are consumed by the viewer. When viewing is off, messages are processed by the viewer's render area. This means messages will be sent down to the scene graph for processing (i.e. picking can occur). Note that if the application has registered a message 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 message or not) is ignored when viewing is on. That is, the viewer will process the message even if the callback already did. This is to ensure that the viewing paradigm is not broken (default viewing is on).

Reimplemented in SoWinMPExaminerViewer, and SoWinMPFullViewer.

void SoWinMPViewer::setWandGeometryFile ( SbString  wandFile  ) 

set the file containing the wand geometry

virtual void SoWinMPViewer::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.

virtual void SoWinMPViewer::viewAll (  )  [virtual]

Changes the camera position to view the entire scene (the camera zoom or orientation isn't changed).

Reimplemented in SoWinMPExaminerViewer.


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/