artofillusion.object
Class ObjectCollection

java.lang.Object
  extended by artofillusion.object.Object3D
      extended by artofillusion.object.ObjectCollection
Direct Known Subclasses:
ScriptedObject

public abstract class ObjectCollection
extends Object3D

This abstract class represents an Object3D which is actually composed of other objects. Typically, these objects are procedurally generated, such as by a script.


Field Summary
 
Fields inherited from class artofillusion.object.Object3D
APPROXIMATELY, CANT_CONVERT, EXACTLY
 
Constructor Summary
ObjectCollection()
           
ObjectCollection(java.io.DataInputStream in, Scene theScene)
           
 
Method Summary
 int canConvertToTriangleMesh()
          For simplicity, just assume that the object can be converted approximately.
 boolean canSetMaterial()
          Assume that a material can be set for the object collection (though actually setting one may or may not have any effect).
 TriangleMesh convertToTriangleMesh(double tol)
          Create a triangle mesh which is the union of all the objects in this collection.
 BoundingBox getBounds()
          Get a BoundingBox which just encloses the object.
 java.util.Enumeration<ObjectInfo> getObjects(ObjectInfo info, boolean interactive, Scene scene)
          Get an enumeration of ObjectInfos listing the objects which this object is composed of.
 RenderingMesh getRenderingMesh(double tol, boolean interactive, ObjectInfo info)
          Get a mesh representing the union of all objects in the collection.
 WireframeMesh getWireframeMesh()
          An object collection is never drawn directly.
 boolean isClosed()
          Determine whether the object is closed.
 void renderObject(ObjectInfo obj, ViewerCanvas canvas, Vec3 viewDir)
          RenderObject is overridden to render each component object individually.
 void sceneChanged(ObjectInfo info, Scene scene)
          If this object explicitly references time or position, the cached objects and bounding box may need to be reevaluated.
 void setUsesCoords(boolean b)
          Since object collections are generally procedurally generated, they may depend explicitly on position.
 void setUsesTime(boolean b)
          Since object collections are generally procedurally generated, they may depend explicitly on time.
 
Methods inherited from class artofillusion.object.Object3D
applyPoseKeyframe, canConvertToActor, canSetTexture, configurePoseTrack, copyObject, copyTextureAndMaterial, duplicate, edit, editGesture, editKeyframe, getAverageParameterValues, getMaterial, getMaterialMapping, getParameters, getParameterValue, getParameterValues, getPosableObject, getPoseKeyframe, getProperties, getPropertyValue, getSkeleton, getTexture, getTextureMapping, isEditable, readParameterValue, setMaterial, setParameters, setParameterValue, setParameterValues, setPropertyValue, setSize, setTexture, writeToFile
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectCollection

public ObjectCollection()

ObjectCollection

public ObjectCollection(java.io.DataInputStream in,
                        Scene theScene)
                 throws java.io.IOException,
                        java.io.InvalidObjectException
Throws:
java.io.IOException
java.io.InvalidObjectException
Method Detail

getObjects

public java.util.Enumeration<ObjectInfo> getObjects(ObjectInfo info,
                                                    boolean interactive,
                                                    Scene scene)
Get an enumeration of ObjectInfos listing the objects which this object is composed of. This calls the protected method enumerateObjects() (which must be provided by subclasses), while applying Distortions and caching objects for interactive previews.


getBounds

public BoundingBox getBounds()
Get a BoundingBox which just encloses the object.

Specified by:
getBounds in class Object3D

setUsesTime

public void setUsesTime(boolean b)
Since object collections are generally procedurally generated, they may depend explicitly on time. If so, this should be called with the value true.


setUsesCoords

public void setUsesCoords(boolean b)
Since object collections are generally procedurally generated, they may depend explicitly on position. If so, this should be called with the value true.


isClosed

public boolean isClosed()
Determine whether the object is closed.

Overrides:
isClosed in class Object3D

canSetMaterial

public boolean canSetMaterial()
Assume that a material can be set for the object collection (though actually setting one may or may not have any effect).

Overrides:
canSetMaterial in class Object3D

getRenderingMesh

public RenderingMesh getRenderingMesh(double tol,
                                      boolean interactive,
                                      ObjectInfo info)
Get a mesh representing the union of all objects in the collection.

Overrides:
getRenderingMesh in class Object3D

getWireframeMesh

public WireframeMesh getWireframeMesh()
An object collection is never drawn directly. Instead, its component objects are enumerated and drawn individually.

Specified by:
getWireframeMesh in class Object3D

renderObject

public void renderObject(ObjectInfo obj,
                         ViewerCanvas canvas,
                         Vec3 viewDir)
RenderObject is overridden to render each component object individually.

Overrides:
renderObject in class Object3D
Parameters:
obj - the ObjectInfo for this object
canvas - the canvas in which to render this object
viewDir - the direction from which this object is being viewed

canConvertToTriangleMesh

public int canConvertToTriangleMesh()
For simplicity, just assume that the object can be converted approximately.

Overrides:
canConvertToTriangleMesh in class Object3D

convertToTriangleMesh

public TriangleMesh convertToTriangleMesh(double tol)
Create a triangle mesh which is the union of all the objects in this collection.

Overrides:
convertToTriangleMesh in class Object3D

sceneChanged

public void sceneChanged(ObjectInfo info,
                         Scene scene)
If this object explicitly references time or position, the cached objects and bounding box may need to be reevaluated.

Overrides:
sceneChanged in class Object3D


Copyright © 1999-2011 by Peter Eastman.