artofillusion.object
Class ObjectInfo

java.lang.Object
  extended by artofillusion.object.ObjectInfo

public class ObjectInfo
extends java.lang.Object

ObjectInfo represents information about an object within a Scene: its position, orientation, name, visibility, etc. The internal properties (i.e. geometry) of the object are defined by the "object" property.

There may be several ObjectInfos in a scene which all reference the same Object3D. In that case, they are live duplicates of each other.


Field Summary
 ObjectInfo[] children
           
 CoordinateSystem coords
           
 int id
           
 java.lang.String name
           
 Object3D object
           
 ObjectInfo parent
           
 boolean parentSelected
           
 Keyframe pose
           
 boolean selected
           
 Track[] tracks
           
 boolean visible
           
 
Constructor Summary
ObjectInfo(Object3D obj, CoordinateSystem c, java.lang.String name)
          Create a new ObjectInfo.
 
Method Summary
 void addChild(ObjectInfo info, int position)
          Add a child to this object.
 void addDistortion(Distortion d)
          Add a Distortion to apply to the object.
 void addTrack(Track tr, int position)
          Add a track to this object.
 void clearCachedMeshes()
          Clear the cached preview meshes.
 void clearDistortion()
          Remove any Distortions from the object.
 void copyInfo(ObjectInfo info)
          Make this ObjectInfo identical to another one.
 ObjectInfo duplicate()
          Create a new ObjectInfo which is identical to this one.
 ObjectInfo duplicate(Object3D obj)
          Create a new ObjectInfo which is identical to this one, but references a new Object3D.
static ObjectInfo[] duplicateAll(ObjectInfo[] info)
          Given an array of ObjectInfos, duplicate all of them (including the objects they point to), keeping parent-child relationships intact.
 BoundingBox getBounds()
          Get a bounding box for the object.
 ObjectInfo[] getChildren()
          Get the list of children for this object.
 CoordinateSystem getCoords()
          Get the CoordinateSystem for this object.
 Object3D getDistortedObject(double tol)
          Get a new object which has had the distortion applied to it.
 Distortion getDistortion()
          Get the current Distortion applied to this object.
 int getId()
          Get this object's ID.
 java.lang.String getName()
          Get the name of this object.
 Object3D getObject()
          Get the Object3D defining the geometry for this ObjectInfo.
 ObjectInfo getParent()
          Get this object's parent, or null if it is a top level object.
 Keyframe getPose()
          Get the current pose for this object (may be null).
 RenderingMesh getPreviewMesh()
          Get a rendering mesh for interactive previews.
 RenderingMesh getRenderingMesh(double tol)
          Get a rendering mesh for this object.
 Skeleton getSkeleton()
          Get the skeleton for this object, or null if it does not have one.
 Track[] getTracks()
          Get the list of Tracks for this object.
 WireframeMesh getWireframePreview()
          Get a wireframe mesh for interactive previews.
 boolean isDistorted()
          Returns true if a Distortion has been applied to this object.
 boolean isLocked()
          Get whether this object is locked.
 boolean isVisible()
          Get whether this object is visible.
 void removeChild(int which)
          Remove a child from this object.
 void removeChild(ObjectInfo info)
          Remove a child from this object.
 void removeTrack(int which)
          Remove a track from this object.
 void removeTrack(Track tr)
          Remove a track from this object.
 void setCoords(CoordinateSystem coords)
          Set the CoordinateSystem for this object.
 void setDistortion(Distortion d)
          Set the current Distortion applied to this object.
 void setId(int id)
          Set this object's ID.
 void setLocked(boolean locked)
          Set whether this object is locked.
 void setMaterial(Material mat, MaterialMapping map)
          Set the material and material mapping for this object.
 void setName(java.lang.String name)
          Set the name of this object.
 void setObject(Object3D object)
          Set the Object3D defining the geometry for this ObjectInfo.
 void setParent(ObjectInfo parent)
          Set this object's parent.
 void setPose(Keyframe pose)
          Set the current pose for this object (may be null).
 void setTexture(Texture tex, TextureMapping map)
          Set the texture and texture mapping for this object.
 void setVisible(boolean visible)
          Set whether this object is visible.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

object

public Object3D object

coords

public CoordinateSystem coords

name

public java.lang.String name

visible

public boolean visible

selected

public boolean selected

parentSelected

public boolean parentSelected

parent

public ObjectInfo parent

children

public ObjectInfo[] children

tracks

public Track[] tracks

pose

public Keyframe pose

id

public int id
Constructor Detail

ObjectInfo

public ObjectInfo(Object3D obj,
                  CoordinateSystem c,
                  java.lang.String name)
Create a new ObjectInfo.

Method Detail

duplicate

public ObjectInfo duplicate()
Create a new ObjectInfo which is identical to this one. It will still reference the same Object3D object, but all other fields will be cloned.


duplicate

public ObjectInfo duplicate(Object3D obj)
Create a new ObjectInfo which is identical to this one, but references a new Object3D.


duplicateAll

public static ObjectInfo[] duplicateAll(ObjectInfo[] info)
Given an array of ObjectInfos, duplicate all of them (including the objects they point to), keeping parent-child relationships intact.


copyInfo

public void copyInfo(ObjectInfo info)
Make this ObjectInfo identical to another one. Both ObjectInfos will reference the same Object3D object, but all other fields will be cloned.


addChild

public void addChild(ObjectInfo info,
                     int position)
Add a child to this object.


removeChild

public void removeChild(ObjectInfo info)
Remove a child from this object.


removeChild

public void removeChild(int which)
Remove a child from this object.


addTrack

public void addTrack(Track tr,
                     int position)
Add a track to this object.


removeTrack

public void removeTrack(Track tr)
Remove a track from this object.


removeTrack

public void removeTrack(int which)
Remove a track from this object.


setTexture

public void setTexture(Texture tex,
                       TextureMapping map)
Set the texture and texture mapping for this object.


setMaterial

public void setMaterial(Material mat,
                        MaterialMapping map)
Set the material and material mapping for this object.


clearDistortion

public void clearDistortion()
Remove any Distortions from the object.


addDistortion

public void addDistortion(Distortion d)
Add a Distortion to apply to the object. Any other Distortions which have previously been added will be applied before this one.


getDistortion

public Distortion getDistortion()
Get the current Distortion applied to this object.


isDistorted

public boolean isDistorted()
Returns true if a Distortion has been applied to this object.


setDistortion

public void setDistortion(Distortion d)
Set the current Distortion applied to this object. Any previously applied Distortion is discarded.


getDistortedObject

public Object3D getDistortedObject(double tol)
Get a new object which has had the distortion applied to it. If there is no distortion, this simply returns the original object.


getRenderingMesh

public RenderingMesh getRenderingMesh(double tol)
Get a rendering mesh for this object.


getPreviewMesh

public RenderingMesh getPreviewMesh()
Get a rendering mesh for interactive previews.


getWireframePreview

public WireframeMesh getWireframePreview()
Get a wireframe mesh for interactive previews.


getBounds

public BoundingBox getBounds()
Get a bounding box for the object. The bounding box is defined in the object's local coordinate system.


clearCachedMeshes

public void clearCachedMeshes()
Clear the cached preview meshes. This should be called whenever the object is changed.


getSkeleton

public Skeleton getSkeleton()
Get the skeleton for this object, or null if it does not have one.


getObject

public Object3D getObject()
Get the Object3D defining the geometry for this ObjectInfo.


setObject

public void setObject(Object3D object)
Set the Object3D defining the geometry for this ObjectInfo.


getCoords

public CoordinateSystem getCoords()
Get the CoordinateSystem for this object.


setCoords

public void setCoords(CoordinateSystem coords)
Set the CoordinateSystem for this object.


getName

public java.lang.String getName()
Get the name of this object.


setName

public void setName(java.lang.String name)
Set the name of this object.


isVisible

public boolean isVisible()
Get whether this object is visible.


setVisible

public void setVisible(boolean visible)
Set whether this object is visible.


isLocked

public boolean isLocked()
Get whether this object is locked.


setLocked

public void setLocked(boolean locked)
Set whether this object is locked.


getParent

public ObjectInfo getParent()
Get this object's parent, or null if it is a top level object.


setParent

public void setParent(ObjectInfo parent)
Set this object's parent.


getPose

public Keyframe getPose()
Get the current pose for this object (may be null).


setPose

public void setPose(Keyframe pose)
Set the current pose for this object (may be null).


getId

public int getId()
Get this object's ID.


setId

public void setId(int id)
Set this object's ID.


getChildren

public ObjectInfo[] getChildren()
Get the list of children for this object.


getTracks

public Track[] getTracks()
Get the list of Tracks for this object.



Copyright © 1999-2011 by Peter Eastman.