Aviatrix3D
2.1.0

org.j3d.aviatrix3d
Class ViewportLayer2D

java.lang.Object
  extended by org.j3d.aviatrix3d.SceneGraphObject
      extended by org.j3d.aviatrix3d.ViewportLayer
          extended by org.j3d.aviatrix3d.ViewportLayer2D
All Implemented Interfaces:
Cullable, ViewportLayerCullable

public class ViewportLayer2D
extends ViewportLayer
implements ViewportLayerCullable

An ViewportLayer that supports only 2D-based rendering concepts.

Internationalisation Resource Names

Version:
$Revision: 1.7 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.ViewportLayer
FLAT, layerType, MULTIPASS, SIMPLE, viewHeight, viewWidth, viewX, viewY
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler
 
Constructor Summary
ViewportLayer2D()
          Construct a new layer instance.
 
Method Summary
 SceneCullable getCullableScene()
          Get the cullable layer child that for the given layer index.
 Scene2D getScene()
          Get the currently set scene instance.
 boolean isActiveSoundLayer()
          Check to see if this is the currently active layer for sound rendering.
 boolean isAudioSource()
          Check to see if this render pass is the one that also has the spatialised audio to be rendered for this frame.
 boolean isMultipassViewport()
          Check to see if this is a multipass cullable or single pass.
 void makeActiveSoundLayer()
          Set this layer to be the currently active sound layer.
protected  void setLive(boolean state)
          Notification that this object is live now.
 void setScene(Scene2D sc)
          Set a new scene instance to be used by this layer.
protected  void setUpdateHandler(NodeUpdateHandler handler)
          Set the scenegraph update handler for this node.
 
Methods inherited from class org.j3d.aviatrix3d.ViewportLayer
getType
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
checkForCyclicChild, checkForCyclicParent, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewportLayer2D

public ViewportLayer2D()
Construct a new layer instance.

Method Detail

isMultipassViewport

public boolean isMultipassViewport()
Check to see if this is a multipass cullable or single pass.

Specified by:
isMultipassViewport in interface ViewportLayerCullable
Returns:
true if this is a multipass cullable

isAudioSource

public boolean isAudioSource()
Check to see if this render pass is the one that also has the spatialised audio to be rendered for this frame. If this is a multipass layer then there is must return false and potentially one of the render passes will be the active audio source. See the package documentation for more information about how this state is managed.

Specified by:
isAudioSource in interface ViewportLayerCullable
Returns:
true if this is the source that should be rendered this this frame.

getCullableScene

public SceneCullable getCullableScene()
Get the cullable layer child that for the given layer index.

Specified by:
getCullableScene in interface ViewportLayerCullable
Returns:
The layer cullable at the given index or null

setUpdateHandler

protected void setUpdateHandler(NodeUpdateHandler handler)
Set the scenegraph update handler for this node. It will notify all its children of the value. A null value will clear the current handler.

Overrides:
setUpdateHandler in class SceneGraphObject
Parameters:
handler - The instance to use as a handler

setLive

protected void setLive(boolean state)
Notification that this object is live now. Overridden to make sure that the live state of the nodes represents the same state as the parent scene graph.

Overrides:
setLive in class SceneGraphObject
Parameters:
state - true if this should be marked as live now

makeActiveSoundLayer

public void makeActiveSoundLayer()
                          throws InvalidWriteTimingException
Set this layer to be the currently active sound layer. The previously active layer will be disabled. This method can only be called during the dataChanged() callback.

Throws:
InvalidWriteTimingException

isActiveSoundLayer

public boolean isActiveSoundLayer()
Check to see if this is the currently active layer for sound rendering. This will only return true the frame after calling makeActiveSoundLayer(). The effects, however, will be rendered starting the frame that this is set.

Returns:
true if this is the layer that will generate sound rendering

setScene

public void setScene(Scene2D sc)
              throws InvalidWriteTimingException,
                     AlreadyParentedException
Set a new scene instance to be used by this layer.

Note that a scene cannot have more than one parent, so sharing it between layers will result in an error.

Parameters:
sc - The scene instance to use, or null to clear
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener callback method
AlreadyParentedException - This scene already has a current parent preventing it from being used

getScene

public Scene2D getScene()
Get the currently set scene instance. If no scene is set, null is returned.

Returns:
The current scene instance or null

Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org