Class SoRenderAreaCore
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.viewercomponents.SoRenderAreaCore
-
- All Implemented Interfaces:
SafeDisposable
,SiRenderArea
,SiRenderAreaAntialiasing
,SiRenderAreaInteractive
,SiRenderAreaStereo
,SiRenderAreaStillSuperSampling
,SiRenderAreaTransparency
public class SoRenderAreaCore extends Inventor implements SiRenderAreaAntialiasing, SiRenderAreaTransparency, SiRenderAreaStereo, SiRenderAreaInteractive, SiRenderArea, SiRenderAreaStillSuperSampling, SafeDisposable
(Preview Feature) Utility class to render a scene with an OpenGl context.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
Constructors Constructor Description SoRenderAreaCore(SoGLContext glContext)
Build a newSoRenderAreaCore
that uses an existing glContext.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
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.SoSceneManager.AntialiasingModes
getAntialiasingMode()
float
getAntialiasingQuality()
SbColorRGBA
getClearColor()
float
getClearDepth()
SiRenderArea.ClearPolicies
getClearPolicy()
SoGLRenderAction
getGLRenderAction()
Returns the render action used for rendering.SoInteractiveComplexity.InteractiveModes
getInteractiveMode()
Deprecated.As of Open Inventor 101.0.0.0.SoNode
getSceneGraph()
SoSceneManager
getSceneManager()
Returns the scene manager.SbVec2i32
getSize()
SoStereoParameters
getStereoParameters()
int
getStillSuperSamplingDelay()
float
getStillSuperSamplingQuality()
SoGLRenderAction.TransparencyTypes
getTransparencyType()
boolean
isDisposable()
Returns a boolean flag which indicates if it is safe to callSafeDisposable.dispose()
on the object.boolean
isStereoActivated()
SbEventHandler<SiRenderArea.RenderEventArg>
onStartRender()
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(java.util.Collection<SoEvent> eventList)
Processes the passed event by applying anSoHandleEventAction
to the scene graph managed here.SiRenderArea.RenderStatus
render()
Applies anSoGLRenderAction
to the scene graph managed here.void
setAntialiasingMode(SoSceneManager.AntialiasingModes mode)
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
setClearPolicy(SiRenderArea.ClearPolicies policy)
Defines the color buffer and depth buffer clear policy.void
setGLRenderAction(SoGLRenderAction glAction)
Defines the render action used for rendering.void
setInteractiveMode(SoInteractiveComplexity.InteractiveModes mode)
Deprecated.As of Open Inventor 101.0.0.0.void
setSceneGraph(SoNode newScene)
Defines the scene graph which is managed here.void
setSize(SbVec2i32 size)
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
setTransparencyType(SoGLRenderAction.TransparencyTypes type)
Defines the algorithm for rendering transparent objects.-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Constructor Detail
-
SoRenderAreaCore
public SoRenderAreaCore(SoGLContext glContext)
Build a newSoRenderAreaCore
that uses an existing glContext.
-
-
Method Detail
-
onStartRender
public SbEventHandler<SiRenderArea.RenderEventArg> 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
public void setSize(SbVec2i32 size)
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
public SiRenderArea.RenderStatus 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()
-
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
public SoGLRenderAction getGLRenderAction()
Returns the render action used for rendering.
-
setTransparencyType
public void setTransparencyType(SoGLRenderAction.TransparencyTypes type)
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
public SbVec2i32 getSize()
- Specified by:
getSize
in interfaceSiRenderArea
- See Also:
setSize()
-
setGLRenderAction
public void setGLRenderAction(SoGLRenderAction glAction)
Defines the render action used for rendering.
-
setSceneGraph
public void setSceneGraph(SoNode newScene)
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
public SoNode getSceneGraph()
- Specified by:
getSceneGraph
in interfaceSiRenderArea
- See Also:
setSceneGraph()
-
getStereoParameters
public SoStereoParameters getStereoParameters()
- Specified by:
getStereoParameters
in interfaceSiRenderAreaStereo
- See Also:
setStereoParameters()
-
processEvents
public boolean processEvents(java.util.Collection<SoEvent> eventList)
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
public boolean processEvent(SoEvent event)
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:
setStillSuperSamplingDelay()
-
getClearDepth
public float getClearDepth()
- Specified by:
getClearDepth
in interfaceSiRenderArea
- See Also:
setClearDepth()
-
getAntialiasingQuality
public float getAntialiasingQuality()
- Specified by:
getAntialiasingQuality
in interfaceSiRenderAreaAntialiasing
- See Also:
setAntialiasingQuality()
-
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
public void setStereoParameters(SoStereoParameters parameters)
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
public void setClearPolicy(SiRenderArea.ClearPolicies policy)
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
public SoSceneManager.AntialiasingModes getAntialiasingMode()
- Specified by:
getAntialiasingMode
in interfaceSiRenderAreaAntialiasing
- See Also:
setAntialiasingMode()
-
setAntialiasingMode
public void setAntialiasingMode(SoSceneManager.AntialiasingModes mode)
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:
activateStereo()
-
getSceneManager
public SoSceneManager getSceneManager()
Returns the scene manager.
-
getClearColor
public SbColorRGBA getClearColor()
- Specified by:
getClearColor
in interfaceSiRenderArea
- See Also:
setClearColor()
-
getTransparencyType
public SoGLRenderAction.TransparencyTypes getTransparencyType()
- Specified by:
getTransparencyType
in interfaceSiRenderAreaTransparency
- See Also:
setTransparencyType()
-
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(since="101.0.0.0") public SoInteractiveComplexity.InteractiveModes getInteractiveMode()
Deprecated.As of Open Inventor 101.0.0.0. Use SoInteractiveComplexity node instead.- Specified by:
getInteractiveMode
in interfaceSiRenderAreaInteractive
- See Also:
setInteractiveMode() Warning Deprecated since Open Inventor 101000. Use node instead.
-
getClearPolicy
public SiRenderArea.ClearPolicies getClearPolicy()
- Specified by:
getClearPolicy
in interfaceSiRenderArea
- See Also:
setClearPolicy()
-
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
public void setClearColor(SbColorRGBA color)
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.
-
-