edu.washington.NVisF.plotter
Class ObjectGroup

java.lang.Object
  |
  +--edu.washington.NVisF.plotter.ObjectGroup

public class ObjectGroup
extends java.lang.Object

An ObjectGroup wraps a 3D scene that can be added to a viewer. The wrapping serves two purposes: (1) it hides the implementation of 3D viewing from classes that only need to pass the viewable object rather than doing something with it. (2) In the Java3D representation, the ObjectGroup maintains a Branchgroup suitable for adding to an active scene graph as well as references to the internal objects within the BranchGroup allowing direct manipulation of those objects. The structure provided to the constructors is added to a TransformGroup that allows transformation of the entire provided structure, and this TransformGroup is then attached to a BranchGroup that will be provided by calls to the getBranchGroup() method.


Constructor Summary
ObjectGroup(Geometry geometry, Appearance appearance)
          Constructs a new ObjectGroup from the provided Geometry and Appearance.
ObjectGroup(Group displayGroup)
          Constructs a new ObjectGroup that wraps the supplied Group.
ObjectGroup(Node[] displayNodes)
          Constructs a new ObjectGroup that wraps the supplied Nodes.
ObjectGroup(Shape3D shape)
          Constructs a new ObjectGroup from the provided Shape3D object.
ObjectGroup(Shape3D[] shapes)
          Constructs a new ObjectGroup from the provided Shape3D objects.
 
Method Summary
 Appearance getAppearance()
          If this ObjectGroup was constructed with an Appearance, a reference to that Appearance is returned; otherwise returns null.
 BranchGroup getBranchGroup()
          returns the top level BranchGroup of this ObjectGroup.
 Geometry[] getGeometries()
          If this ObjectGroup was constructed with Geometry objects, a reference to an array of those Geometrys is returned; otherwise returns null.
 Shape3D[] getShape3Ds()
          If this ObjectGroup was constructed with a Shape3D or its components, returns a reference to that Shape3D; otherwise returns null.
 TransformGroup getTransformGroup()
          returns the TransformGroup above the wrapped structure.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectGroup

public ObjectGroup(Geometry geometry,
                   Appearance appearance)
Constructs a new ObjectGroup from the provided Geometry and Appearance. The arguments are combined into a Shape3D object that is then attached to a new TransformGroup (that itself is attached to a BranchGroup). References to all of the components are stored for later access.

ObjectGroup

public ObjectGroup(Shape3D shape)
Constructs a new ObjectGroup from the provided Shape3D object. References to the Appearance and Geometry components of the Shape3D will be stored.

ObjectGroup

public ObjectGroup(Shape3D[] shapes)
Constructs a new ObjectGroup from the provided Shape3D objects. References to the Appearance and Geometry components of the Shape3D will be stored.

ObjectGroup

public ObjectGroup(Group displayGroup)
Constructs a new ObjectGroup that wraps the supplied Group.

ObjectGroup

public ObjectGroup(Node[] displayNodes)
Constructs a new ObjectGroup that wraps the supplied Nodes.
Method Detail

getBranchGroup

public BranchGroup getBranchGroup()
returns the top level BranchGroup of this ObjectGroup.

getTransformGroup

public TransformGroup getTransformGroup()
returns the TransformGroup above the wrapped structure. This TransformGroup can be used to manipulate everything wrapped within this ObjectGroup.

getShape3Ds

public Shape3D[] getShape3Ds()
If this ObjectGroup was constructed with a Shape3D or its components, returns a reference to that Shape3D; otherwise returns null.

getGeometries

public Geometry[] getGeometries()
If this ObjectGroup was constructed with Geometry objects, a reference to an array of those Geometrys is returned; otherwise returns null.

getAppearance

public Appearance getAppearance()
If this ObjectGroup was constructed with an Appearance, a reference to that Appearance is returned; otherwise returns null.