Click or drag to resize
SoWinViewer Class

Viewer component lowest base class.

Inheritance Hierarchy

Namespace: OIV.Inventor.Win.Viewers
Assembly: OIV.Inventor.Win (in OIV.Inventor.Win.dll) Version: 10.12.3.0 (10.12.3.0)
Syntax
public class SoWinViewer : SoWinRenderArea, 
	SoStereoViewer

The SoWinViewer type exposes the following members.

Methods
  NameDescription
Public methodActualRendering

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

Public methodCode exampleAddHook
Adds an event handler that receives all messages dispatched to this window.
(Inherited from SoWinGLWidget.)
Public methodAdjustClippingPlanes Obsolete.

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

Public methodBindNormalContext

Makes the normal rendering context the current context.

(Inherited from SoWinGLWidget.)
Public methodCopyView

Copies the view.

Public methodDispose
(Inherited from SoWinRenderArea.)
Public methodEnableFullRenderingWhenStill

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

Public methodEnableMouseWheelDolly

Enable/disable moving the camera with the mouse wheel, true by default.

Public methodEnableSeekWithOrtho

If false, the seek functionality is disabled for an OIV.Inventor.Nodes.SoOrthographicCamera.

Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodFlush
(Inherited from SoWinGLWidget.)
Public methodGetAntialiasingMode

Returns the antialiasing mode set using the setAntialiasing(float,AntialiasingMode) method.

(Inherited from SoWinGLWidget.)
Public methodGetAntialiasingParameters (Inherited from SoWinGLWidget.)
Public methodGetAntialiasingQuality

Returns the antialiasing quality set using the setAntialiasing(float,AntialiasingMode) method.

(Inherited from SoWinGLWidget.)
Public methodGetAutoClipTolerance

Returns the auto clipping tolerance value.

Public methodGetBackgroundColor

Gets the background color for this window.

(Inherited from SoWinRenderArea.)
Public methodGetBackgroundIndex

Gets the window background color when in color index mode.

(Inherited from SoWinRenderArea.)
Public methodGetBorderSize

Included for portability only.

(Inherited from SoWinGLWidget.)
Public methodGetBottomRight

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

Public methodGetBufferingType

Gets the current buffering type in the main view.

Public methodGetCamera

Gets the camera controlled by the viewer.

Public methodGetCameraSceneGraph

Gets the sub-scene graph to be viewed.

Public methodGetCameraType

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

Public methodGetClassName

Returns the class name.

(Inherited from SoWinComponent.)
Public methodGetCurrentDecimationPercentage

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

Public methodGetCursor Obsolete.

Returns the current cursor.

(Inherited from SoWinGLWidget.)
Public methodGetCursorStyle

Returns the cursor style.

Public methodGetDecimationStrategy

Gets strategy to use to decide on decimation value.

Public methodGetDepthValue
Public methodGetDrawStyle

Queries the current drawing style in the main view.

Public methodGetFastEditSavePolicy

Returns fast editing save policy used when rendering.

(Inherited from SoWinRenderArea.)
Public methodGetFixedPercentage

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

Public methodGetFloatingColorBuffer

Returns true if floating point rendering is used and its precision.

(Inherited from SoWinGLWidget.)
Public methodGetGLRenderAction

Gets the current GL render action.

(Inherited from SoWinRenderArea.)
Public methodGetGoalFramesPerSecond

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

Public methodGetGoalNumberOfTriangles

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

Public methodGetGraphicConfigTemplate

Gets the current graphics configuration template.

(Inherited from SoWinGLWidget.)
Public methodGetHashCode
Overrides GetHashCode().
(Inherited from SoNetBase.)
Public methodGetHeadlight

Returns the headlight node.

Public methodGetIconTitle

Included for portability only.

(Inherited from SoWinComponent.)
Public methodGetInvalidateCacheMode

Returns the current cache invalidation mode.

(Inherited from SoWinRenderArea.)
Public methodGetMPEGRecorder

Returns the recorder used for MPEG encoding.

(Inherited from SoWinRenderArea.)
Public methodGetNormalDC

Returns the device context (which is needed for SbGlContextHelper.makeCurrent).

(Inherited from SoWinGLWidget.)
Public methodGetNormalSoContext
(Inherited from SoWinGLWidget.)
Public methodGetNumSamples

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

Public methodGetPickRadius

Returns the current pick radius for picking and seeking actions.

Public methodGetPixelFormat

Returns the current pixel format.

(Inherited from SoWinGLWidget.)
Public methodGetRedrawPriority

Gets the priority of the redraw sensor.

(Inherited from SoWinRenderArea.)
Public methodGetSceneGraph

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

(Inherited from SoWinRenderArea.)
Public methodGetSceneManager

Gets the normal scene manager.

(Inherited from SoWinRenderArea.)
Public methodGetSeekTime

Queries the seek time.

Public methodGetShareContext

Returns the information needed to make OpenGL render contexts share OpenGL objects, for example, display lists and texture objects.

(Inherited from SoWinRenderArea.)
Public methodGetSize

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

Public methodGetStereoBalance

Returns the current stereo balance.

Public methodGetStereoOffset

Returns the stereo offset.

Public methodGetStereoViewType

Returns the current stereo implementation.

Public methodGetTitle

Gets window title.

(Inherited from SoWinComponent.)
Public methodGetTopLeft

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

Public methodGetTransparencyType

Gets the algorithm for rendering transparent objects.

(Inherited from SoWinRenderArea.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetViewerCamera

Returns the camera so OIV.Inventor.Components.Stereo.SoBaseStereo can manipulate it to achieve the stereo effect.

Public methodGetViewport

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

Public methodGetViewportRegion

Gets current viewport region to use for rendering.

(Inherited from SoWinRenderArea.)
Public methodGetWidgetName

Returns the window handle name.

(Inherited from SoWinComponent.)
Public methodHide

This hides the component.

(Inherited from SoWinComponent.)
Public methodIsAutoClipping

Queries if auto clipping is ON.

Public methodIsAutoRedraw

Queries whether the render area will automatically redraw whenever something in the scene graph changes.

(Inherited from SoWinRenderArea.)
Public methodIsBorder

Included for portability only.

(Inherited from SoWinGLWidget.)
Public methodIsCameraHeightAnglePreserved

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

Public methodIsClearBeforeRender

Queries whether the window will be cleared before rendering starts.

(Inherited from SoWinRenderArea.)
Public methodIsClearZBufferBeforeRender

Queries whether the depth buffer (sometimes called the Z buffer) will be cleared before rendering starts.

(Inherited from SoWinRenderArea.)
Public methodIsCursorEnabled Obsolete.

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

Public methodIsDetailSeek

Queries whether detail seek is on.

Public methodIsDoubleBuffer

Returns whether double buffering is on or off.

(Inherited from SoWinGLWidget.)
Public methodIsDrawToFrontBufferEnable

Returns whether drawing to the front buffer is enabled.

(Inherited from SoWinGLWidget.)
Public methodIsFullRenderingWhenStill

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

Public methodIsFullScreen

Queries if the viewer is in fullscreen mode.

(Inherited from SoWinComponent.)
Public methodIsFullScreenEnable

Queries if it is possible to put the viewer in fullscreen mode.

(Inherited from SoWinComponent.)
Public methodIsHeadlight

Queries if the headlight is on.

Public methodIsSeekWithOrthoEnabled

Query whether the seek functionality is enabled for an OIV.Inventor.Nodes.SoOrthographicCamera.

Public methodIsStereoAbsoluteAdjustments

Returns true if stereo absolute adjustments are enabled.

Public methodIsStereoActive

Returns true if stereo is active.

Public methodIsStereoBalanceNearFrac

Returns true if the stereo balance adjustement is defined as a fraction of the camera near distance.

Public methodIsStereoViewing

Queries if stereo viewing is on or off on the viewer.

Public methodIsStereoViewReversed

Returns true if the left and right eye views are reversed.

Public methodIsStillNow

Returns whether the viewer is currently still.

Public methodIsTopLevelShell

Returns true if this component is a top level shell component (has its own window).

(Inherited from SoWinComponent.)
Public methodIsViewerDoubleBuffer

Returns true if viewer is double buffered.

Public methodIsViewing

Queries whether the viewer is turned on or off.

Public methodIsVisible

Returns true if this component is mapped onto the screen.

(Inherited from SoWinComponent.)
Public methodPasteView

Pastes the view.

Public methodRecomputeSceneSize

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.

Public methodRedrawOnSelectionChange

Call this convenience method to have this render area redraw whenever the selection list changes in the passed node.

(Inherited from SoWinRenderArea.)
Public methodRegisterDevice

Registers interest in devices.

(Inherited from SoWinRenderArea.)
Public methodRemoveHook
Removes the event handlers that were added by AddHook.
(Inherited from SoWinGLWidget.)
Public methodRender

Calling this forces the render area to be redrawn now.

(Inherited from SoWinRenderArea.)
Public methodResetToHomePosition

Restores the camera values.

Public methodReverseStereoView

If true, reverse the left and right eye views.

Public methodSaveHomePosition

Saves the camera values.

Public methodSaveSnapshot(String)
Calls SaveSnapshot(filename, true).
(Inherited from SoWinGLWidget.)
Public methodSaveSnapshot(String, Boolean)

Save a snapshot of the current image displayed in the viewer.

(Inherited from SoWinGLWidget.)
Public methodScheduleRedraw

Schedules a redraw to happen sometime soon (as opposed to immediately).

(Inherited from SoWinRenderArea.)
Public methodSetAntialiasing(Single)
Calls SetAntialiasing(quality, OIV.Inventor.SoSceneManager.AntialiasingModes( .SoSceneManager.AUTO )).
(Inherited from SoWinGLWidget.)
Public methodSetAntialiasing(SoAntialiasingParameters)

Enable (or disable) antialiasing with specific parameters.

(Inherited from SoWinGLWidget.)
Public methodSetAntialiasing(Single, SoSceneManagerAntialiasingModes)

Enable (or disable) antialiasing with specified quality and mode.

(Inherited from SoWinGLWidget.)
Public methodSetAutoClipping

Sets the auto clipping plane.

Public methodSetAutoClipTolerance

Sets the auto clipping tolerance value.

Public methodSetAutoRedraw

The render area will automatically redraw whenever something in the scene graph changes.

(Inherited from SoWinRenderArea.)
Public methodSetBackgroundColor

Sets the background color for this window.

(Inherited from SoWinRenderArea.)
Public methodSetBackgroundIndex

Sets the window background color when in color index mode.

(Inherited from SoWinRenderArea.)
Public methodSetBorder

Included for portability only.

(Inherited from SoWinGLWidget.)
Public methodSetBufferingType

Sets the current buffering type in the main view (default OIV.Inventor.Win.Viewers.SoWinViewer.BufferTypes.BUFFER_DOUBLE).

Public methodSetCamera

Sets the camera that will be controlled by the viewer.

Public methodSetCameraSceneGraph

Sets the sub-scene graph to be used for OIV.Inventor.Win.Viewers.SoWinViewer.ViewAll() computation.

Public methodSetCameraType

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

Public methodSetClearBeforeRender(Boolean)
Calls SetClearBeforeRender(trueOrFalse, true).
(Inherited from SoWinRenderArea.)
Public methodSetClearBeforeRender(Boolean, Boolean)

Enables/prevents window clearing from happening before a rendering starts (default is clear true).

(Inherited from SoWinRenderArea.)
Public methodSetColorMap

Sets the colors to use when displaying in color index mode.

(Inherited from SoWinRenderArea.)
Public methodSetCursor Obsolete.

Sets the current cursor.

(Inherited from SoWinGLWidget.)
Public methodSetCursorEnabled Obsolete.

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

Public methodSetCursorStyle

Sets the cursor style.

Public methodSetDecimationStrategy

Sets strategy to use to decide on decimation value.

Public methodSetDetailSeek

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.

Public methodSetDoubleBuffer

Routine that dynamically changes between single and double buffering.

(Inherited from SoWinGLWidget.)
Public methodSetDrawStyle

Sets the current drawing style in the main view.

Public methodSetDrawToFrontBufferEnable

Sets drawing to the front buffer.

(Inherited from SoWinGLWidget.)
Public methodSetFastEditSavePolicy(SoGLRenderActionFastEditSavePolicies)
Calls SetFastEditSavePolicy(policy, false).
(Inherited from SoWinRenderArea.)
Public methodSetFastEditSavePolicy(SoGLRenderActionFastEditSavePolicies, Boolean)

Sets fast editing save policy to use when rendering.

(Inherited from SoWinRenderArea.)
Public methodSetFixedPercentage

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

Public methodSetFloatingColorBuffer(Boolean)
Calls SetFloatingColorBuffer(enable, OIV.Inventor.Win.SoWinGLWidget.FloatColorBufferSizes( .SoWinGLWidget.FLOAT_16_COLOR_BUFFER )).
(Inherited from SoWinGLWidget.)
Public methodSetFloatingColorBuffer(Boolean, SoWinGLWidgetFloatColorBufferSizes)

Enables/disables floating point rendering using 16- or 32-bit components.

(Inherited from SoWinGLWidget.)
Public methodSetFullScreen

Switches the viewer into (or out of) fullscreen mode.

(Inherited from SoWinComponent.)
Public methodSetFullScreenEnable

Enables/disables fullscreen mode.

(Inherited from SoWinComponent.)
Public methodSetGLRenderAction

Sets the GL render action to use.

(Inherited from SoWinRenderArea.)
Public methodSetGoalFramesPerSecond

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

Public methodSetGoalNumberOfTriangles

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

Public methodSetGraphicConfigTemplate

Sets a new graphics configuration template.

(Inherited from SoWinGLWidget.)
Public methodSetHeadlight

Turns the headlight on/off (default on).

Public methodSetIconTitle

Included for portability only.

(Inherited from SoWinComponent.)
Public methodSetInvalidateCacheMode

Enables or disables the invalidation of render caches.

(Inherited from SoWinRenderArea.)
Public methodSetMPEGRecorder

Sets the recorder used for MPEG encoding.

(Inherited from SoWinRenderArea.)
Public methodSetNumSamples

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

Public methodSetPickRadius

Sets the pick radius, in pixels, used by the viewer for picking and seeking actions.

Public methodSetPixelFormat

Sets the current pixel format.

(Inherited from SoWinGLWidget.)
Public methodSetPreserveCameraHeightAngle

If true, an OIV.Inventor.Nodes.SoPerspectiveCamera's heightAngle is preserved if the camera is changed to an OIV.Inventor.Nodes.SoOrthographicCamera and then toggled back to an OIV.Inventor.Nodes.SoPerspectiveCamera.

Public methodSetRedrawPriority

Sets the priority of the redraw sensor.

(Inherited from SoWinRenderArea.)
Public methodSetSceneGraph

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

(Inherited from SoWinRenderArea.)
Public methodSetSceneManager

Sets the normal scene manager.

(Inherited from SoWinRenderArea.)
Public methodSetSeekTime

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

Public methodSetSize

Convenience routine on the window handle.

(Inherited from SoWinComponent.)
Public methodSetStealFocus

By default the GLWidget "steals" focus whenever the cursor moves over it.

(Inherited from SoWinGLWidget.)
Public methodSetStereoAbsoluteAdjustments

If true, use stereo absolute adjustments.

Public methodSetStereoActive

If true, stero is activated.

Public methodSetStereoBalance(Single)
Calls SetStereoBalance(balance, false).
Public methodSetStereoBalance(Single, Boolean)

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

Public methodSetStereoOffset

Sets the stereo offset.

Public methodSetStereoViewing

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

Public methodSetStereoViewType

Set an implementation of stereo viewing to use.

Public methodSetTitle

Sets window title.

(Inherited from SoWinComponent.)
Public methodSetTransparencyType

Sets the algorithm for rendering transparent objects.

(Inherited from SoWinRenderArea.)
Public methodSetViewing

Sets whether the viewer is turned on or off.

Public methodSetViewport

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

Public methodSetViewportRegion

Sets viewport region to use for rendering.

(Inherited from SoWinRenderArea.)
Public methodShow

This shows the component.

(Inherited from SoWinComponent.)
Public methodSwapNormalBuffers

Swaps the normal front and back buffers.

(Inherited from SoWinGLWidget.)
Public methodToggleCameraType

This routine will toggle the current camera from perspective to orthographic, and from orthographic back to perspective.

Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUnbindNormalContext

unbind the current context (previously bind with bindNormalContext );

(Inherited from SoWinGLWidget.)
Public methodUnregisterDevice

Unregisters interest in devices.

(Inherited from SoWinRenderArea.)
Public methodViewAll

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

Top
Properties
  NameDescription
Public propertyCameraTypeChangeCallback

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

Public propertyCursor

Sets the current cursor.

(Inherited from SoWinGLWidget.)
Public propertyCursorEnabled

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

Public propertyDecimationPercentageCallback

Registers decimation percentage callback.

Public propertyEventFunction
Sets the event delegate that will be called before viewer process keyboard or mouse event.
(Inherited from SoWinRenderArea.)
Public propertyFramesPerSecondCallback

Registers frames per second callback.

Public propertyHandle
Implements Handle.
(Inherited from SoWinComponent.)
Public propertyPostRenderCallback

Specifies a function to be called after the Open Inventor render traversal and immediately before the OpenGL buffer swap.

(Inherited from SoWinRenderArea.)
Public propertySeekMode

Externally set the viewer into/out off seek mode (default OFF).

Public propertyWindowCloseCallback

Sets the delegate to invoke when the user closes this component (double click in the upper left corner) - by default Hide() is called on this component, unless a delegate is specified.

(Inherited from SoWinComponent.)
Top
Events
  NameDescription
Public eventFinishViewing
Public eventStartViewing
Top
Remarks

This is the lowest base class for viewer components. This class adds the notion of a camera to the OIV.Inventor.Win.SoWinRenderArea class. Whenever a new scene is specified with (), the first camera encountered will be by default used as the edited camera. If no camera is found in the scene, the viewer will automatically create one. If the viewer type is OIV.Inventor.Win.Viewers.SoWinViewer.Types.BROWSER then the camera is told to view the supplied scene graph but is not added beneath that scene graph root. If the viewer type is OIV.Inventor.Win.Viewers.SoWinViewer.Types.EDITOR then the camera is added beneath the supplied scene graph root.

In addition to automatically creating a camera if needed, this base class also creates a headlight (directional light which is made to follow the camera), and enables the user to change drawing styles (like wireframe or move wireframe), and buffering types. When the headlight is enabled, a group node is added immediately following the edited camera. This group contains a directional light node.

This base class also provides a convenient way to have the camera near and far clipping planes be automatically adjusted to minimize the clipping of objects in the scene.

Viewers allow the application to shadow message processing. When the application registers a message processing callback by calling setEventCallback() the viewer will invoke this callback for every Windows message it receives. However, unlike the render area, the viewer ignores the return value of this callback, and processes the message as usual. This allows the application to expand viewing capabilities without breaking the viewing paradigm. It is an easy way to hook up other devices, like the spaceball, to an existing viewer.

Depending on the DecimationStrategy, a viewer can control the complexity of a scene by adjusting the Decimation elements to reach certain goals. The viewer can attempt to keep a constant frame rate or a constant number of triangles rendered. The viewer can be set to switch to full detail when the scene is not moving.

In order to set the frame rate, the viewer times each render action traversal, and then adjusts the Decimation percentage to keep the time within a range depending on the goal frames per second. To fix the number of triangles, the viewer applies a GetPrimitiveCountAction before each traversal and sets the DecimationPercentage to the desired percentage of the resulting count.

If the DecimationStrategy is NORMAL (the default) then nothing special is done. If the strategy is FIXED_PERCENTAGE, then the same percentage is used for every render. Also note that FIXED_PERCENTAGE sets the DecimationType to be PERCENTAGE (all others use AUTOMATIC), which means that SoLODs will not use the camera position in their calculations, and can therefore be cached.

The application can add callbacks from the viewer to get the current decimation level, the current primitive count and the current frames per second. The decimation level and primitive count callbacks are called every frame. The frames per second callback is called after a certain number of samples have been averaged together.

See Also