de.jreality.scene
Interface Viewer

All Known Implementing Classes:
ViewerSwitch

public interface Viewer

The Viewer interface represents a renderable 3D scene. It consists of specifying a SceneGraphComponent, the scene root, and a path in the scene graph to a Camera. Each implementation of this interface represents a different "backend". See separate packages for details.

Author:
Charles Gunn, Steffen Weissmann

Method Summary
 boolean canRenderAsync()
          Tells wether this viewer supports asyncronous rendering.
 SceneGraphComponent getAuxiliaryRoot()
          Some viewers (at least the jogl viewer) support an auxilary root - for things to display that are no part of the scene itself.
 SceneGraphPath getCameraPath()
          Get the camera path.
 SceneGraphComponent getSceneRoot()
          Get the scene root.
 int getSignature()
          Some viewers (at least the jogl viewer) support rendering of non-euclidean geometries.
 Object getViewingComponent()
          Gives the viewing component.
 Dimension getViewingComponentSize()
          Gives the dimension of the viewing component in pixel.
 boolean hasViewingComponent()
          Has this viewer a viewing component?
 void render()
          This method triggers rendering of the viewer.
 void renderAsync()
          Some viewers support asyncronous rendering.
 void setAuxiliaryRoot(SceneGraphComponent auxRoot)
          Some viewers (at least the jogl viewer) support an auxilary root - for things to display that are no part of the scene itself.
 void setCameraPath(SceneGraphPath cameraPath)
          Set the camera path.
 void setSceneRoot(SceneGraphComponent root)
          Set the scene root.
 void setSignature(int sig)
          Some viewers (at least the jogl viewer) support rendering of non-euclidean geometries.
 

Method Detail

getSceneRoot

SceneGraphComponent getSceneRoot()
Get the scene root.

Returns:
the scene root

setSceneRoot

void setSceneRoot(SceneGraphComponent root)
Set the scene root.

Parameters:
root - the scene root

getCameraPath

SceneGraphPath getCameraPath()
Get the camera path.

Returns:
the camera path

setCameraPath

void setCameraPath(SceneGraphPath cameraPath)
Set the camera path. Some backends assume that this is a valid (existing) path starting at the scene root. This implies that one first needs to set the scene root. A camera path must have a Camera as the last element.

Parameters:
cameraPath - the camera path.

render

void render()
This method triggers rendering of the viewer. The method returns as soon as the rendering is finished.


hasViewingComponent

boolean hasViewingComponent()
Has this viewer a viewing component?

Returns:
true if the viewer has a viewing component, false otherwise.

getViewingComponent

Object getViewingComponent()
Gives the viewing component. This is a java.awt.Component for an AWT viewer, or an org.eclipse.swt.Widget for an SWT viewer. Maybe there will be other types of viewing components that we do not know yet.

Returns:
for now: a java.awt.Component or a org.eclipse.swt.Widget

getViewingComponentSize

Dimension getViewingComponentSize()
Gives the dimension of the viewing component in pixel.

Returns:
the Dimension of the viewing component when hasViewingComponent() returns true - null otherwise.

getSignature

int getSignature()
Some viewers (at least the jogl viewer) support rendering of non-euclidean geometries. The definition of the signature is in de.jreality.math.Pn.

Returns:
the signature of the viewer.
See Also:
Pn

setSignature

void setSignature(int sig)
Some viewers (at least the jogl viewer) support rendering of non-euclidean geometries. The definition of the signature is in de.jreality.math.Pn.

Parameters:
the - signature of the viewer as defined in de.jreality.math.Pn
See Also:
Pn

setAuxiliaryRoot

void setAuxiliaryRoot(SceneGraphComponent auxRoot)
Some viewers (at least the jogl viewer) support an auxilary root - for things to display that are no part of the scene itself. I. e. bounding boxes should go here.

Parameters:
auxRoot - the auxiliary root

getAuxiliaryRoot

SceneGraphComponent getAuxiliaryRoot()
Some viewers (at least the jogl viewer) support an auxilary root - for things to display that are no part of the scene itself. I. e. bounding boxes should go here.

Returns:
the auxiliary root

canRenderAsync

boolean canRenderAsync()
Tells wether this viewer supports asyncronous rendering.

Returns:
true if the viewer supports renderAsync() false otherwise

renderAsync

void renderAsync()
Some viewers support asyncronous rendering. This means: when this method is called, it returns immediately and the viewer renders again as soon as possible: either right now or when the current rendering has finished. Multiple calls of this method while the viewer is rendering trigger one single rendering after the current one (optional operation).