Aviatrix3D
2.0 Beta 2

org.j3d.aviatrix3d
Class SimpleViewport

java.lang.Object
  extended byorg.j3d.aviatrix3d.SceneGraphObject
      extended byorg.j3d.aviatrix3d.Viewport
          extended byorg.j3d.aviatrix3d.SimpleViewport
All Implemented Interfaces:
Cullable, ViewportCullable, ViewportLayerCullable

public class SimpleViewport
extends Viewport
implements ViewportCullable, ViewportLayerCullable

A viewport that contains a single scene, with no internal layering.

Version:
$Revision: 1.5 $
Author:
Justin Couch

Field Summary
protected static java.lang.String HAS_PARENT_MSG
          Message about code that is not valid parent
 
Fields inherited from class org.j3d.aviatrix3d.Viewport
COMPOSITE, FLAT, MULTIPASS, SIMPLE, viewHeight, viewportType, viewWidth, viewX, viewY
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, LISTENER_SET_NOT_LIVE_MESSAGE, updateHandler, WRITE_TIMING_MSG
 
Constructor Summary
SimpleViewport()
          Construct a new, empty, viewport instance
 
Method Summary
 ViewportLayerCullable getCullableLayer(int viewportIndex)
          Get the cullable layer child that for the given layer index.
 SceneCullable getCullableScene()
          Get the cullable layer child that for the given layer index.
 SimpleScene getScene()
          Get the currently set scene instance.
 boolean isMultipassViewport()
          Check to see if this is a multipass cullable or single pass.
 int numCullableChildren()
          Returns the number of valid cullable children to process.
 void setDimensions(int x, int y, int width, int height)
          Set the dimensions of the viewport in pixels.
protected  void setLive(boolean state)
          Notification that this object is live now.
 void setScene(SimpleScene sc)
          Set a new scene instance to be used by this viewport.
protected  void setUpdateHandler(NodeUpdateHandler handler)
          Set the scenegraph update handler for this node.
 
Methods inherited from class org.j3d.aviatrix3d.Viewport
getDimensions, getHeight, getType, getWidth, getX, getY, isValid
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
checkForCyclicChild, checkForCyclicParent, dataChanged, getUserData, isLive, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.j3d.aviatrix3d.rendering.ViewportCullable
isValid
 

Field Detail

HAS_PARENT_MSG

protected static final java.lang.String HAS_PARENT_MSG
Message about code that is not valid parent

See Also:
Constant Field Values
Constructor Detail

SimpleViewport

public SimpleViewport()
Construct a new, empty, viewport instance

Method Detail

getCullableLayer

public ViewportLayerCullable getCullableLayer(int viewportIndex)
Get the cullable layer child that for the given layer index.

Specified by:
getCullableLayer in interface ViewportCullable
Returns:
The layer cullable at the given index or null

numCullableChildren

public int numCullableChildren()
Returns the number of valid cullable children to process. If there are no valid cullable children, return 0.

Specified by:
numCullableChildren in interface ViewportCullable
Returns:
A number greater than or equal to zero

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

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

setDimensions

public void setDimensions(int x,
                          int y,
                          int width,
                          int height)
                   throws InvalidWriteTimingException
Set the dimensions of the viewport in pixels. Coordinates are defined in the space of the parent component that is being rendered to.

Overrides:
setDimensions in class Viewport
Parameters:
x - The lower left x coordinate for the view
y - The lower left y coordinate for the view
width - The width of the viewport in pixels
height - The height of the viewport in pixels
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the ApplicationUpdateObserver callback method

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

setScene

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

Note that a scene cannot have more than one parent, so sharing it between viewports 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 SimpleScene getScene()
Get the currently set scene instance. If no scene is set, null is returned.

Returns:
The current scene instance or null

Aviatrix3D
2.0 Beta 2

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