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 newSoRenderAreaCorethat uses an existing glContext.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidactivateStereo(boolean activate)Activate (or deactivate) stereo rendering with specified parameters (see setStereoParameters).booleandispose()Explicitly call this method to force object to dispose its unmanaged resources.SoSceneManager.AntialiasingModesgetAntialiasingMode()floatgetAntialiasingQuality()SbColorRGBAgetClearColor()floatgetClearDepth()SiRenderArea.ClearPoliciesgetClearPolicy()SoGLRenderActiongetGLRenderAction()Returns the render action used for rendering.SoInteractiveComplexity.InteractiveModesgetInteractiveMode()Deprecated.As of Open Inventor 101000.SoNodegetSceneGraph()SoSceneManagergetSceneManager()Returns the scene manager.SbVec2i32getSize()SoStereoParametersgetStereoParameters()intgetStillSuperSamplingDelay()floatgetStillSuperSamplingQuality()SoGLRenderAction.TransparencyTypesgetTransparencyType()booleanisDisposable()Returns a boolean flag which indicates if it is safe to callSafeDisposable.dispose()on the object.booleanisStereoActivated()SbEventHandler<SiRenderArea.RenderEventArg>onStartRender()Returns the event handler that raises when a new render starts.booleanprocessEvent(SoEvent event)Processes the passed event by applying anSoHandleEventActionto the scene graph managed here.booleanprocessEvents(java.util.Collection<SoEvent> eventList)Processes the passed event by applying anSoHandleEventActionto the scene graph managed here.SiRenderArea.RenderStatusrender()Applies anSoGLRenderActionto the scene graph managed here.voidsetAntialiasingMode(SoSceneManager.AntialiasingModes mode)Define the antialiasing mode.voidsetAntialiasingQuality(float quality)Define the antialiasing quality value.voidsetClearColor(SbColorRGBA color)Defines the RGBA value used when the color buffer is cleared.voidsetClearDepth(float depth)Defines the depth value used when the depth buffer is cleared.voidsetClearPolicy(SiRenderArea.ClearPolicies policy)Defines the color buffer and depth buffer clear policy.voidsetGLRenderAction(SoGLRenderAction glAction)Defines the render action used for rendering.voidsetInteractiveMode(SoInteractiveComplexity.InteractiveModes mode)Deprecated.As of Open Inventor 101000.voidsetSceneGraph(SoNode newScene)Defines the scene graph which is managed here.voidsetSize(SbVec2i32 size)Defines the size to use for rendering.voidsetStereoParameters(SoStereoParameters parameters)Defines the stereo parameters.voidsetStillSuperSamplingDelay(int delay)Set delay for supersampling when "still" (not interacting).voidsetStillSuperSamplingQuality(float quality)Set quality for supersampling when "still" (not interacting).voidsetTransparencyType(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 newSoRenderAreaCorethat 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:
onStartRenderin interfaceSiRenderArea
-
isDisposable
public boolean isDisposable()
Description copied from interface:SafeDisposableReturns a boolean flag which indicates if it is safe to callSafeDisposable.dispose()on the object.- Specified by:
isDisposablein interfaceSafeDisposable- Returns:
trueif the object can be disposed in a safe manner
-
dispose
public boolean dispose()
Description copied from class:InventorExplicitly 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:
disposein interfaceSafeDisposable- Overrides:
disposein classInventor- Returns:
trueif this object native resources were successfully disposed;falseif 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:
setSizein interfaceSiRenderArea
-
render
public SiRenderArea.RenderStatus render()
Applies anSoGLRenderActionto 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:
renderin interfaceSiRenderArea
-
getStillSuperSamplingQuality
public float getStillSuperSamplingQuality()
- Specified by:
getStillSuperSamplingQualityin 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:
setStillSuperSamplingQualityin 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. SeeSoGLRenderActionfor 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:
setTransparencyTypein interfaceSiRenderAreaTransparency
-
getSize
public SbVec2i32 getSize()
- Specified by:
getSizein 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:
setSceneGraphin interfaceSiRenderArea- Parameters:
newScene- scene graph.
-
getSceneGraph
public SoNode getSceneGraph()
- Specified by:
getSceneGraphin interfaceSiRenderArea- See Also:
setSceneGraph()
-
getStereoParameters
public SoStereoParameters getStereoParameters()
- Specified by:
getStereoParametersin interfaceSiRenderAreaStereo- See Also:
setStereoParameters()
-
processEvents
public boolean processEvents(java.util.Collection<SoEvent> eventList)
Processes the passed event by applying anSoHandleEventActionto the scene graph managed here. Returns true if at least one event was handled by a node.- Specified by:
processEventsin 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:
setStillSuperSamplingDelayin 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 anSoHandleEventActionto the scene graph managed here. Returns true if the event was handled by a node.- Specified by:
processEventin interfaceSiRenderAreaInteractive
-
getStillSuperSamplingDelay
public int getStillSuperSamplingDelay()
- Specified by:
getStillSuperSamplingDelayin interfaceSiRenderAreaStillSuperSampling- See Also:
setStillSuperSamplingDelay()
-
getClearDepth
public float getClearDepth()
- Specified by:
getClearDepthin interfaceSiRenderArea- See Also:
setClearDepth()
-
getAntialiasingQuality
public float getAntialiasingQuality()
- Specified by:
getAntialiasingQualityin 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 anSoRawStereoParametersobject activates OpenGL "quad buffered" stereo (if possible on the current graphics board).NOTES - Stereo rendering needs a
SoStereoCamerato 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:
activateStereoin interfaceSiRenderAreaStereo
- Stereo rendering needs a
-
setStereoParameters
public void setStereoParameters(SoStereoParameters parameters)
Defines the stereo parameters.- Specified by:
setStereoParametersin interfaceSiRenderAreaStereo- Parameters:
parameters- Provides specific parameters for a stereo mode. Use one of the subclasses ofSoStereoParameters.NOTES SoRenderAreaCoremakes 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:
setClearPolicyin interfaceSiRenderArea- Parameters:
policy- color buffer and depth buffer clear policy.
-
getAntialiasingMode
public SoSceneManager.AntialiasingModes getAntialiasingMode()
- Specified by:
getAntialiasingModein interfaceSiRenderAreaAntialiasing- See Also:
setAntialiasingMode()
-
setAntialiasingMode
public void setAntialiasingMode(SoSceneManager.AntialiasingModes mode)
Define the antialiasing mode.- Specified by:
setAntialiasingModein 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:
setAntialiasingQualityin 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:
isStereoActivatedin interfaceSiRenderAreaStereo- See Also:
activateStereo()
-
getSceneManager
public SoSceneManager getSceneManager()
Returns the scene manager.
-
getClearColor
public SbColorRGBA getClearColor()
- Specified by:
getClearColorin interfaceSiRenderArea- See Also:
setClearColor()
-
getTransparencyType
public SoGLRenderAction.TransparencyTypes getTransparencyType()
- Specified by:
getTransparencyTypein 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:
setClearDepthin interfaceSiRenderArea- Parameters:
depth- value used to clear the depth buffer.
-
getInteractiveMode
@Deprecated public SoInteractiveComplexity.InteractiveModes getInteractiveMode()
Deprecated.As of Open Inventor 101000. Use SoInteractiveComplexity node instead.- Specified by:
getInteractiveModein interfaceSiRenderAreaInteractive- See Also:
setInteractiveMode() Warning Deprecated since Open Inventor 101000. Use node instead.
-
getClearPolicy
public SiRenderArea.ClearPolicies getClearPolicy()
- Specified by:
getClearPolicyin interfaceSiRenderArea- See Also:
setClearPolicy()
-
setInteractiveMode
@Deprecated public void setInteractiveMode(SoInteractiveComplexity.InteractiveModes mode)
Deprecated.As of Open Inventor 101000. Use SoInteractiveComplexity node instead.Set the current interactive mode.- Specified by:
setInteractiveModein interfaceSiRenderAreaInteractive- Parameters:
mode- interactive mode. Default is AUTO.Warning Deprecated since Open Inventor 101000. Use
SoInteractiveComplexitynode 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:
setClearColorin interfaceSiRenderArea- Parameters:
color- RGBA value used to clear the color buffer.
-
-