SoWinViewer Class |
Viewer component lowest base class.
Namespace: OIV.Inventor.Win.Viewers
The SoWinViewer type exposes the following members.
Name | Description | |
---|---|---|
ActualRendering | This method is called automatically when the viewer requests that its OIV.Inventor.Components.Stereo.SoBaseStereo object perform stereo rendering. | |
AddHook |
Adds an event handler that receives all messages dispatched
to this window.
(Inherited from SoWinGLWidget.) | |
AdjustClippingPlanes | Obsolete. Along with the manipulation of the camera, OIV.Inventor.Components.Stereo.SoBaseStereo needs to set the scene appropriately when changing the camera settings. | |
BindNormalContext | Makes the normal rendering context the current context. | |
CopyView | Copies the view. | |
Dispose | (Inherited from SoWinRenderArea.) | |
EnableFullRenderingWhenStill | If this flag is set, the viewer will render at full resolution when it sits still for a certain period of time. | |
EnableMouseWheelDolly | Enable/disable moving the camera with the mouse wheel, true by default. | |
EnableSeekWithOrtho | If false, the seek functionality is disabled for an OIV.Inventor.Nodes.SoOrthographicCamera. | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Flush | (Inherited from SoWinGLWidget.) | |
GetAntialiasingMode | Returns the antialiasing mode set using the setAntialiasing(float,AntialiasingMode) method. | |
GetAntialiasingParameters | Returns the antialiasing parameters set using the OIV.Inventor.Win.SoWinGLWidget.SetAntialiasing(OIV.Inventor.Antialiasing.SoAntialiasingParameters) method. | |
GetAntialiasingQuality | Returns the antialiasing quality set using the setAntialiasing(float,AntialiasingMode) method. | |
GetAutoClipTolerance | Returns the auto clipping tolerance value. | |
GetBackgroundColor | Gets the background color for this window. | |
GetBackgroundIndex | Gets the window background color when in color index mode. | |
GetBorderSize | Included for portability only. | |
GetBottomRight | 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). | |
GetBufferingType | Gets the current buffering type in the main view. | |
GetCamera | Gets the camera controlled by the viewer. | |
GetCameraSceneGraph | Gets the sub-scene graph to be viewed. | |
GetCameraType | 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). | |
GetClassName | Returns the class name. | |
GetCurrentDecimationPercentage | Returns the Decimation Percentage the viewer used in its last render. | |
GetCursor | Obsolete. Returns the current cursor. | |
GetCursorStyle | Returns the cursor style. | |
GetDecimationStrategy | Gets strategy to use to decide on decimation value. | |
GetDepthValue | ||
GetDrawStyle | Queries the current drawing style in the main view. | |
GetFastEditSavePolicy | Returns fast editing save policy used when rendering. | |
GetFixedPercentage | Gets fixed percentage for the viewer to render (0.0 to 1.0) | |
GetFloatingColorBuffer | Returns true if floating point rendering is used and its precision. | |
GetGLRenderAction | Gets the current GL render action. | |
GetGoalFramesPerSecond | Gets goal frames per second for the viewer to try to render. | |
GetGoalNumberOfTriangles | Gets goal number of triangles for the viewer to try to render. | |
GetGraphicConfigTemplate | Gets the current graphics configuration template. | |
GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) | |
GetHeadlight | Returns the headlight node. | |
GetIconTitle | Included for portability only. | |
GetInvalidateCacheMode | Returns the current cache invalidation mode. | |
GetMPEGRecorder | Returns the recorder used for MPEG encoding. | |
GetNormalDC | Returns the device context (which is needed for SbGlContextHelper.makeCurrent). | |
GetNormalSoContext | (Inherited from SoWinGLWidget.) | |
GetNumSamples | Gets how many frames should be timed before frames per second delegateis called. | |
GetPickRadius | Returns the current pick radius for picking and seeking actions. | |
GetPixelFormat | Returns the current pixel format. | |
GetRedrawPriority | Gets the priority of the redraw sensor. | |
GetSceneGraph | Gets the scene graph to be rendered in this component's window. | |
GetSceneManager | Gets the normal scene manager. | |
GetSeekTime | Queries the seek time. | |
GetShareContext | Returns the information needed to make OpenGL render contexts share OpenGL objects, for example, display lists and texture objects. | |
GetSize | 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). | |
GetStereoBalance | Returns the current stereo balance. | |
GetStereoOffset | Returns the stereo offset. | |
GetStereoViewType | Returns the current stereo implementation. | |
GetTitle | Gets window title. | |
GetTopLeft | 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). | |
GetTransparencyType | Gets the algorithm for rendering transparent objects. | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetViewerCamera | Returns the camera so OIV.Inventor.Components.Stereo.SoBaseStereo can manipulate it to achieve the stereo effect. | |
GetViewport | Returns viewport region as origin (lower-left corner) and size, given as pixel coordinates. | |
GetViewportRegion | Gets current viewport region to use for rendering. | |
GetWidgetName | Returns the window handle name. | |
Hide | This hides the component. | |
IsAutoClipping | Queries if auto clipping is ON. | |
IsAutoRedraw | Queries whether the render area will automatically redraw whenever something in the scene graph changes. | |
IsBorder | Included for portability only. | |
IsCameraHeightAnglePreserved | 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. | |
IsClearBeforeRender | Queries whether the window will be cleared before rendering starts. | |
IsClearZBufferBeforeRender | Queries whether the depth buffer (sometimes called the Z buffer) will be cleared before rendering starts. | |
IsCursorEnabled | Obsolete. Queries whether the viewer is allowed to change the cursor over the renderArea window. | |
IsDetailSeek | Queries whether detail seek is on. | |
IsDoubleBuffer | Returns whether double buffering is on or off. | |
IsDrawToFrontBufferEnable | Returns whether drawing to the front buffer is enabled. | |
IsFullRenderingWhenStill | Queries if the viewer will render at full resolution when it sits still for a certain period of time. | |
IsFullScreen | Queries if the viewer is in fullscreen mode. | |
IsFullScreenEnable | Queries if it is possible to put the viewer in fullscreen mode. | |
IsHeadlight | Queries if the headlight is on. | |
IsSeekWithOrthoEnabled | Query whether the seek functionality is enabled for an OIV.Inventor.Nodes.SoOrthographicCamera. | |
IsStereoAbsoluteAdjustments | Returns true if stereo absolute adjustments are enabled. | |
IsStereoActive | Returns true if stereo is active. | |
IsStereoBalanceNearFrac | Returns true if the stereo balance adjustement is defined as a fraction of the camera near distance. | |
IsStereoViewing | Queries if stereo viewing is on or off on the viewer. | |
IsStereoViewReversed | Returns true if the left and right eye views are reversed. | |
IsStillNow | Returns whether the viewer is currently still. | |
IsTopLevelShell | Returns true if this component is a top level shell component (has its own window). | |
IsViewerDoubleBuffer | Returns true if viewer is double buffered. | |
IsViewing | Queries whether the viewer is turned on or off. | |
IsVisible | Returns true if this component is mapped onto the screen. | |
PasteView | Pastes the view. | |
RecomputeSceneSize | This can be used to let the viewer know that the scene graph has changed so that the viewer can recompute things like speed which depend on the scene graph size. | |
RedrawOnSelectionChange | Call this convenience method to have this render area redraw whenever the selection list changes in the passed node. | |
RegisterDevice | Registers interest in devices. | |
RemoveHook |
Removes the event handlers that were added by
AddHook.
(Inherited from SoWinGLWidget.) | |
Render | Calling this forces the render area to be redrawn now. | |
ResetToHomePosition | Restores the camera values. | |
ReverseStereoView | If true, reverse the left and right eye views. | |
SaveHomePosition | Saves the camera values. | |
SaveSnapshot(String) | Calls SaveSnapshot(filename, true). (Inherited from SoWinGLWidget.) | |
SaveSnapshot(String, Boolean) | Save a snapshot of the current image displayed in the viewer. | |
ScheduleRedraw | Schedules a redraw to happen sometime soon (as opposed to immediately). | |
SetAntialiasing(Single) | Calls SetAntialiasing(quality, OIV.Inventor.SoSceneManager.AntialiasingModes( .SoSceneManager.AUTO )). (Inherited from SoWinGLWidget.) | |
SetAntialiasing(SoAntialiasingParameters) | Enable (or disable) antialiasing with specific parameters. | |
SetAntialiasing(Single, SoSceneManagerAntialiasingModes) | Enable (or disable) antialiasing with specified quality and mode. | |
SetAutoClipping | Sets the auto clipping plane. | |
SetAutoClipTolerance | Sets the auto clipping tolerance value. | |
SetAutoRedraw | The render area will automatically redraw whenever something in the scene graph changes. | |
SetBackgroundColor | Sets the background color for this window. | |
SetBackgroundIndex | Sets the window background color when in color index mode. | |
SetBorder | Included for portability only. | |
SetBufferingType | Sets the current buffering type in the main view (default OIV.Inventor.Win.Viewers.SoWinViewer.BufferTypes.BUFFER_DOUBLE). | |
SetCamera | Sets the camera that will be controlled by the viewer. | |
SetCameraSceneGraph | Sets the sub-scene graph to be used for OIV.Inventor.Win.Viewers.SoWinViewer.ViewAll() computation. | |
SetCameraType | 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). | |
SetClearBeforeRender(Boolean) | Calls SetClearBeforeRender(trueOrFalse, true). (Inherited from SoWinRenderArea.) | |
SetClearBeforeRender(Boolean, Boolean) | Enables/prevents window clearing from happening before a rendering starts (default is clear true). | |
SetColorMap | Sets the colors to use when displaying in color index mode. | |
SetCursor | Obsolete. Sets the current cursor. | |
SetCursorEnabled | Obsolete. Sets whether the viewer is allowed to change the cursor over the renderArea window. | |
SetCursorStyle | Sets the cursor style. | |
SetDecimationStrategy | Sets strategy to use to decide on decimation value. | |
SetDetailSeek | 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. | |
SetDoubleBuffer | Routine that dynamically changes between single and double buffering. | |
SetDrawStyle | Sets the current drawing style in the main view. | |
SetDrawToFrontBufferEnable | Sets drawing to the front buffer. | |
SetFastEditSavePolicy(SoGLRenderActionFastEditSavePolicies) | Calls SetFastEditSavePolicy(policy, false). (Inherited from SoWinRenderArea.) | |
SetFastEditSavePolicy(SoGLRenderActionFastEditSavePolicies, Boolean) | Sets fast editing save policy to use when rendering. | |
SetFixedPercentage | Sets fixed percentage for the viewer to render (0.0 to 1.0) Default is 1.0. | |
SetFloatingColorBuffer(Boolean) | Calls SetFloatingColorBuffer(enable, OIV.Inventor.Win.SoWinGLWidget.FloatColorBufferSizes( .SoWinGLWidget.FLOAT_16_COLOR_BUFFER )). (Inherited from SoWinGLWidget.) | |
SetFloatingColorBuffer(Boolean, SoWinGLWidgetFloatColorBufferSizes) | Enables/disables floating point rendering using 16- or 32-bit components. | |
SetFullScreen | Switches the viewer into (or out of) fullscreen mode. | |
SetFullScreenEnable | Enables/disables fullscreen mode. | |
SetGLRenderAction | Sets the GL render action to use. | |
SetGoalFramesPerSecond | Sets goal frames per second for the viewer to try to render. | |
SetGoalNumberOfTriangles | Sets goal number of triangles for the viewer to try to render. | |
SetGraphicConfigTemplate | Sets a new graphics configuration template. | |
SetHeadlight | Turns the headlight on/off (default on). | |
SetIconTitle | Included for portability only. | |
SetInvalidateCacheMode | Enables or disables the invalidation of render caches. | |
SetMPEGRecorder | Sets the recorder used for MPEG encoding. | |
SetNumSamples | Sets how many frames should be timed before frames per second delegateis called, default is 10. | |
SetPickRadius | Sets the pick radius, in pixels, used by the viewer for picking and seeking actions. | |
SetPixelFormat | Sets the current pixel format. | |
SetPreserveCameraHeightAngle | 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. | |
SetRedrawPriority | Sets the priority of the redraw sensor. | |
SetSceneGraph | Sets the scene graph to be rendered in this component's window. | |
SetSceneManager | Sets the normal scene manager. | |
SetSeekTime | Sets the time a seek takes to change to the new camera location. | |
SetSize | Convenience routine on the window handle. | |
SetStealFocus | By default the GLWidget "steals" focus whenever the cursor moves over it. | |
SetStereoAbsoluteAdjustments | If true, use stereo absolute adjustments. | |
SetStereoActive | If true, stero is activated. | |
SetStereoBalance(Single) | Calls SetStereoBalance(balance, false). | |
SetStereoBalance(Single, Boolean) | Sets the stereo balance (the position of the zero parallax plane). | |
SetStereoOffset | Sets the stereo offset. | |
SetStereoViewing | Turns stereo viewing on/off on the viewer (default off). | |
SetStereoViewType | Set an implementation of stereo viewing to use. | |
SetTitle | Sets window title. | |
SetTransparencyType | Sets the algorithm for rendering transparent objects. | |
SetViewing | Sets whether the viewer is turned on or off. | |
SetViewport | Sets viewport region with given origin (lower-left corner) and size, given as pixel coordinates. | |
SetViewportRegion | Sets viewport region to use for rendering. | |
Show | This shows the component. | |
SwapNormalBuffers | Swaps the normal front and back buffers. | |
ToggleCameraType | This routine will toggle the current camera from perspective to orthographic, and from orthographic back to perspective. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
UnbindNormalContext | unbind the current context (previously bind with bindNormalContext ); | |
UnregisterDevice | Unregisters interest in devices. | |
ViewAll | Changes the camera position to view the entire scene (the camera zoom or orientation isn't changed). |
Name | Description | |
---|---|---|
CameraTypeChangeCallback | 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). | |
Cursor | Sets the current cursor. | |
CursorEnabled | Sets whether the viewer is allowed to change the cursor over the renderArea window. | |
DecimationPercentageCallback | Registers decimation percentage callback. | |
EventFunction |
Sets the event delegate that will be called
before viewer process keyboard or mouse event.
(Inherited from SoWinRenderArea.) | |
FramesPerSecondCallback | Registers frames per second callback. | |
Handle |
Implements Handle.
(Inherited from SoWinComponent.) | |
PostRenderCallback | Specifies a function to be called after the Open Inventor render traversal and immediately before the OpenGL buffer swap. | |
SeekMode | Externally set the viewer into/out off seek mode (default OFF). | |
WindowCloseCallback | 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. |
Name | Description | |
---|---|---|
FinishViewing | ||
StartViewing |
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.