Class SoRenderAreaCore
- All Implemented Interfaces:
SafeDisposable
,SiRenderArea
,SiRenderAreaAntialiasing
,SiRenderAreaInteractive
,SiRenderAreaStereo
,SiRenderAreaStillSuperSampling
,SiRenderAreaTransparency
Preview Feature means this class is fully supported and can be used in Open Inventor applications. Being tagged as a Preview Feature just means that the implementation is still subject to API changes and adjustments based on feedback from early adopters. Please be also aware that source compatibility might be broken regardless of the Open Inventor compatibility changes policy due to our commitment to bring needed changes to be sure the specifications of this Preview Feature match the expectations of our customers.
RenderArea
-
Nested Class Summary
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
Nested classes/interfaces inherited from interface com.openinventor.inventor.viewercomponents.SiRenderArea
SiRenderArea.ClearPolicies, SiRenderArea.RenderEventArg, SiRenderArea.RenderStatus
-
Field Summary
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
Constructor Summary
ConstructorsConstructorDescriptionSoRenderAreaCore
(SoGLContext glContext) Build a newSoRenderAreaCore
that uses an existing glContext. -
Method Summary
Modifier and TypeMethodDescriptionvoid
activateStereo
(boolean activate) Activate (or deactivate) stereo rendering with specified parameters (see setStereoParameters).boolean
dispose()
Explicitly call this method to force object to dispose its unmanaged resources.float
float
Returns the render action used for rendering.Deprecated.As of Open Inventor 101.0.0.0.Returns the scene manager.getSize()
int
float
boolean
Returns a boolean flag which indicates if it is safe to callSafeDisposable.dispose()
on the object.boolean
Returns the event handler that raises when a new render starts.boolean
processEvent
(SoEvent event) Processes the passed event by applying anSoHandleEventAction
to the scene graph managed here.boolean
processEvents
(Collection<SoEvent> eventList) Processes the passed event by applying anSoHandleEventAction
to the scene graph managed here.render()
Applies anSoGLRenderAction
to the scene graph managed here.void
Define the antialiasing mode.void
setAntialiasingQuality
(float quality) Define the antialiasing quality value.void
setClearColor
(SbColorRGBA color) Defines the RGBA value used when the color buffer is cleared.void
setClearDepth
(float depth) Defines the depth value used when the depth buffer is cleared.void
Defines the color buffer and depth buffer clear policy.void
setGLRenderAction
(SoGLRenderAction glAction) Defines the render action used for rendering.void
Deprecated.As of Open Inventor 101.0.0.0.void
setSceneGraph
(SoNode newScene) Defines the scene graph which is managed here.void
Defines the size to use for rendering.void
setStereoParameters
(SoStereoParameters parameters) Defines the stereo parameters.void
setStillSuperSamplingDelay
(int delay) Set delay for supersampling when "still" (not interacting).void
setStillSuperSamplingQuality
(float quality) Set quality for supersampling when "still" (not interacting).void
Defines the algorithm for rendering transparent objects.Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
Constructor Details
-
SoRenderAreaCore
Build a newSoRenderAreaCore
that uses an existing glContext.
-
-
Method Details
-
onStartRender
Returns the event handler that raises when a new render starts.- Specified by:
onStartRender
in interfaceSiRenderArea
-
isDisposable
public boolean isDisposable()Description copied from interface:SafeDisposable
Returns a boolean flag which indicates if it is safe to callSafeDisposable.dispose()
on the object.- Specified by:
isDisposable
in interfaceSafeDisposable
- Returns:
true
if the object can be disposed in a safe manner
-
dispose
public boolean dispose()Description copied from class:Inventor
Explicitly call this method to force object to dispose its unmanaged resources. The object may not be reused in the application code after this call.- Specified by:
dispose
in interfaceSafeDisposable
- Overrides:
dispose
in classInventor
- Returns:
true
if this object native resources were successfully disposed;false
if it was already disposed or no native resources has been registered for this object.
-
setSize
Defines the size to use for rendering. Typically this method must be called when the render area has been resized or moved.- Specified by:
setSize
in interfaceSiRenderArea
-
render
Applies anSoGLRenderAction
to the scene graph managed here. See RenderStatus documentation for details on the returned value. The rendering may have been aborted, so check this function result before calling swap buffer for example- Specified by:
render
in interfaceSiRenderArea
-
getStillSuperSamplingQuality
public float getStillSuperSamplingQuality()- Specified by:
getStillSuperSamplingQuality
in interfaceSiRenderAreaStillSuperSampling
- See Also:
-
setStillSuperSamplingQuality
public void setStillSuperSamplingQuality(float quality) Set quality for supersampling when "still" (not interacting). When quality is greater than 0, still images will be automatically supersampled.- Specified by:
setStillSuperSamplingQuality
in interfaceSiRenderAreaStillSuperSampling
- Parameters:
quality
- The quality is a factor in the range [0.0,1.0].
Default value is 0.0. Use the value 0.0 to turn off still supersampling. 0.5 is a typical value. See also setStillSuperSamplingDelay.
-
getGLRenderAction
Returns the render action used for rendering. -
setTransparencyType
Defines the algorithm for rendering transparent objects. Default is NO_SORT. SeeSoGLRenderAction
for possible transparency types. See alsoSoGLRenderAction.TransparencyType
.Note: When using transparency types with DELAYED in the name, the depth buffer is not updated (depth buffer writes are disabled) while rendering transparent objects. As a result complex 3D shapes may not be rendered correctly.
- Specified by:
setTransparencyType
in interfaceSiRenderAreaTransparency
-
getSize
- Specified by:
getSize
in interfaceSiRenderArea
- See Also:
-
setGLRenderAction
Defines the render action used for rendering. -
setSceneGraph
Defines the scene graph which is managed here. This is the Open Inventor scene which will be traversed for rendering and event processing.- Specified by:
setSceneGraph
in interfaceSiRenderArea
- Parameters:
newScene
- scene graph.
-
getSceneGraph
- Specified by:
getSceneGraph
in interfaceSiRenderArea
- See Also:
-
getStereoParameters
- Specified by:
getStereoParameters
in interfaceSiRenderAreaStereo
- See Also:
-
processEvents
Processes the passed event by applying anSoHandleEventAction
to the scene graph managed here. Returns true if at least one event was handled by a node.- Specified by:
processEvents
in interfaceSiRenderAreaInteractive
-
setStillSuperSamplingDelay
public void setStillSuperSamplingDelay(int delay) Set delay for supersampling when "still" (not interacting). If greater than 0, images will be supersampled after the specified delay.- Specified by:
setStillSuperSamplingDelay
in interfaceSiRenderAreaStillSuperSampling
- Parameters:
delay
- The delay is in milliseconds.
If greater than 0, images will be supersampled after the specified delay See also setStillSuperSamplingQuality.
-
processEvent
Processes the passed event by applying anSoHandleEventAction
to the scene graph managed here. Returns true if the event was handled by a node.- Specified by:
processEvent
in interfaceSiRenderAreaInteractive
-
getStillSuperSamplingDelay
public int getStillSuperSamplingDelay()- Specified by:
getStillSuperSamplingDelay
in interfaceSiRenderAreaStillSuperSampling
- See Also:
-
getClearDepth
public float getClearDepth()- Specified by:
getClearDepth
in interfaceSiRenderArea
- See Also:
-
getAntialiasingQuality
public float getAntialiasingQuality()- Specified by:
getAntialiasingQuality
in interfaceSiRenderAreaAntialiasing
- See Also:
-
activateStereo
public void activateStereo(boolean activate) Activate (or deactivate) stereo rendering with specified parameters (see setStereoParameters). The stereo mode is determined by which subclass is used to set the parameters. For example, passing anSoRawStereoParameters
object activates OpenGL "quad buffered" stereo (if possible on the current graphics board).NOTES - Stereo rendering needs a
SoStereoCamera
to be activated. The edited camera is the first stereo camera found in the current scene graph. If no stereo camera is found, a warning is displayed. This method must be called to update the edited camera if the scene graph changed.
- Specified by:
activateStereo
in interfaceSiRenderAreaStereo
- Stereo rendering needs a
-
setStereoParameters
Defines the stereo parameters.- Specified by:
setStereoParameters
in interfaceSiRenderAreaStereo
- Parameters:
parameters
- Provides specific parameters for a stereo mode. Use one of the subclasses ofSoStereoParameters
.NOTES SoRenderAreaCore
makes a copy of the parameter values.
-
setClearPolicy
Defines the color buffer and depth buffer clear policy. See also setClearColor and setClearDepth. Default is COLORBUFFER_AND_DEPTHBUFFER.- Specified by:
setClearPolicy
in interfaceSiRenderArea
- Parameters:
policy
- color buffer and depth buffer clear policy.
-
getAntialiasingMode
- Specified by:
getAntialiasingMode
in interfaceSiRenderAreaAntialiasing
- See Also:
-
setAntialiasingMode
Define the antialiasing mode.- Specified by:
setAntialiasingMode
in interfaceSiRenderAreaAntialiasing
- Parameters:
mode
- The antialiasing algorithm. Default is NO_ANTIALIASING which turns off antialiasing.
-
setAntialiasingQuality
public void setAntialiasingQuality(float quality) Define the antialiasing quality value.- Specified by:
setAntialiasingQuality
in interfaceSiRenderAreaAntialiasing
- Parameters:
quality
- The quality is a factor in the range [0.0,1.0].
Default is 0.0. The value 0.0 turns off antialiasing.
-
isStereoActivated
public boolean isStereoActivated()- Specified by:
isStereoActivated
in interfaceSiRenderAreaStereo
- See Also:
-
getSceneManager
Returns the scene manager. -
getClearColor
- Specified by:
getClearColor
in interfaceSiRenderArea
- See Also:
-
getTransparencyType
- Specified by:
getTransparencyType
in interfaceSiRenderAreaTransparency
- See Also:
-
setClearDepth
public void setClearDepth(float depth) Defines the depth value used when the depth buffer is cleared. See also setClearPolicy. Default is 1. Range is 0..1.- Specified by:
setClearDepth
in interfaceSiRenderArea
- Parameters:
depth
- value used to clear the depth buffer.
-
getInteractiveMode
Deprecated.As of Open Inventor 101.0.0.0. Use SoInteractiveComplexity node instead.- Specified by:
getInteractiveMode
in interfaceSiRenderAreaInteractive
- See Also:
-
getClearPolicy
- Specified by:
getClearPolicy
in interfaceSiRenderArea
- See Also:
-
setInteractiveMode
@Deprecated(since="101.0.0.0") public void setInteractiveMode(SoInteractiveComplexity.InteractiveModes mode) Deprecated.As of Open Inventor 101.0.0.0. Use SoInteractiveComplexity node instead.Set the current interactive mode.- Specified by:
setInteractiveMode
in interfaceSiRenderAreaInteractive
- Parameters:
mode
- interactive mode. Default is AUTO.Warning Deprecated since Open Inventor 101000. Use
SoInteractiveComplexity
node instead.
-
setClearColor
Defines the RGBA value used when the color buffer is cleared. See also setClearPolicy. Default is transparent black (0,0,0,0).This is equivalent to setBackgroundColor() in the classical view classes.
- Specified by:
setClearColor
in interfaceSiRenderArea
- Parameters:
color
- RGBA value used to clear the color buffer.
-