artofillusion.object
Class ObjectWrapper

java.lang.Object
  extended by artofillusion.object.Object3D
      extended by artofillusion.object.ObjectWrapper
Direct Known Subclasses:
Actor, ExternalObject

public abstract class ObjectWrapper
extends Object3D

An ObjectWrapper is an Object3D that acts as a wrapper around another Object3D. The "wrapped object" is the one which actually defines the geometry for this object.


Field Summary
 
Fields inherited from class artofillusion.object.Object3D
APPROXIMATELY, CANT_CONVERT, EXACTLY
 
Constructor Summary
ObjectWrapper()
           
ObjectWrapper(java.io.DataInputStream in, Scene theScene)
           
 
Method Summary
 void applyPoseKeyframe(Keyframe k)
          Modify this object based on a pose keyframe.
 int canConvertToTriangleMesh()
          Tells whether the object can be converted to a TriangleMesh.
 void configurePoseTrack(PoseTrack track)
          This will be called whenever a new pose track is created for this object.
 TriangleMesh convertToTriangleMesh(double tol)
          Return a TriangleMesh which reproduces the shape of this object.
 void editGesture(EditingWindow parent, ObjectInfo info, java.lang.Runnable cb, ObjectInfo realObject)
          Edit an object which represents a gesture for an Actor object.
 void editKeyframe(EditingWindow parent, Keyframe k, ObjectInfo info)
          Allow the user to edit a keyframe returned by getPoseKeyframe().
 double[] getAverageParameterValues()
          Get the average value of each texture parameter.
 BoundingBox getBounds()
          Get a BoundingBox which just encloses the object.
 Material getMaterial()
          Get this object's Material.
 MaterialMapping getMaterialMapping()
          Get this object's MaterialMapping.
 TextureParameter[] getParameters()
          Get the list of texture parameters for this object.
 ParameterValue getParameterValue(TextureParameter param)
          Get the object defining the value of a particular texture parameter.
 ParameterValue[] getParameterValues()
          Get the list of objects defining the values of texture parameters.
 Keyframe getPoseKeyframe()
          Return a Keyframe which describes the current pose of this object.
 RenderingMesh getRenderingMesh(double tol, boolean interactive, ObjectInfo info)
          Objects which can be rendered as part of a scene should override this method to return a RenderingMesh which describes the appearance of the object.
 Skeleton getSkeleton()
          Get the skeleton for this object, or null if it does not have one.
 Texture getTexture()
          Get this object's Texture.
 TextureMapping getTextureMapping()
          Get this object's TextureMapping.
 WireframeMesh getWireframeMesh()
          Every object should override this method to return a WireframeMesh.
 Object3D getWrappedObject()
          Get the inner Object3D which is wrapped by this one.
 boolean isClosed()
          Tells whether the object is closed.
 void renderObject(ObjectInfo obj, ViewerCanvas canvas, Vec3 viewDir)
          Render this object into a ViewerCanvas.
 void sceneChanged(ObjectInfo info, Scene scene)
          This will be called whenever this object is moved, or the time changes.
 void setParameters(TextureParameter[] param)
          Set the list of texture parameters for this object.
 void setParameterValue(TextureParameter param, ParameterValue val)
          Set the object defining the value of a particular texture parameter.
 void setParameterValues(ParameterValue[] val)
          Set the list of objects defining the values of texture parameters.
 
Methods inherited from class artofillusion.object.Object3D
canConvertToActor, canSetMaterial, canSetTexture, copyObject, copyTextureAndMaterial, duplicate, edit, getPosableObject, getProperties, getPropertyValue, isEditable, readParameterValue, setMaterial, setPropertyValue, setSize, setTexture, writeToFile
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectWrapper

public ObjectWrapper()

ObjectWrapper

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

getWrappedObject

public Object3D getWrappedObject()
Get the inner Object3D which is wrapped by this one.


getBounds

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

Specified by:
getBounds in class Object3D

isClosed

public boolean isClosed()
Tells whether the object is closed. For curves, this means it has no endpoints. For surface, it means the surface has no boundary.

Overrides:
isClosed in class Object3D

canConvertToTriangleMesh

public int canConvertToTriangleMesh()
Tells whether the object can be converted to a TriangleMesh. It should return one of the following values: CANT_CONVERT: The object cannot be converted to a TriangleMesh. EXACTLY: The object can be represented exactly by a TriangleMesh. APPROXIMATELY: The object can be converted to a TriangleMesh. However, the resulting mesh will not be exactly the same shape as the original object. If a class overrides this method, it must also override convertToTriangleMesh().

Overrides:
canConvertToTriangleMesh in class Object3D

convertToTriangleMesh

public TriangleMesh convertToTriangleMesh(double tol)
Return a TriangleMesh which reproduces the shape of this object. If canConvertToTriangleMesh() returned APPROXIMATELY, this method should return a TriangleMesh which reproduces the object to within the specified tolerance. That is, no point on the mesh should be further than tol from the corresponding point on the original surface. If canConvertToTriangleMesh() returned EXACTLY, then tol should be ignored. If canConvertToTriangleMesh() return CANT_CONVERT, this method returns null.

Overrides:
convertToTriangleMesh in class Object3D

sceneChanged

public void sceneChanged(ObjectInfo info,
                         Scene scene)
This will be called whenever this object is moved, or the time changes. Most objects will do nothing here, and do not need to override this. It is available for those cases where an object's internal properties depend explicitly on time or on the object's position within the scene.

Overrides:
sceneChanged in class Object3D

editGesture

public void editGesture(EditingWindow parent,
                        ObjectInfo info,
                        java.lang.Runnable cb,
                        ObjectInfo realObject)
Edit an object which represents a gesture for an Actor object. realObject specifies the object in the scene which this is a gesture for.

Overrides:
editGesture in class Object3D

getTexture

public Texture getTexture()
Get this object's Texture.

Overrides:
getTexture in class Object3D

getTextureMapping

public TextureMapping getTextureMapping()
Get this object's TextureMapping.

Overrides:
getTextureMapping in class Object3D

getMaterial

public Material getMaterial()
Get this object's Material.

Overrides:
getMaterial in class Object3D

getMaterialMapping

public MaterialMapping getMaterialMapping()
Get this object's MaterialMapping.

Overrides:
getMaterialMapping in class Object3D

getParameters

public TextureParameter[] getParameters()
Get the list of texture parameters for this object.

Overrides:
getParameters in class Object3D

setParameters

public void setParameters(TextureParameter[] param)
Set the list of texture parameters for this object.

Overrides:
setParameters in class Object3D

getParameterValues

public ParameterValue[] getParameterValues()
Get the list of objects defining the values of texture parameters.

Overrides:
getParameterValues in class Object3D

getAverageParameterValues

public double[] getAverageParameterValues()
Get the average value of each texture parameter.

Overrides:
getAverageParameterValues in class Object3D

setParameterValues

public void setParameterValues(ParameterValue[] val)
Set the list of objects defining the values of texture parameters.

Overrides:
setParameterValues in class Object3D

getParameterValue

public ParameterValue getParameterValue(TextureParameter param)
Get the object defining the value of a particular texture parameter. If the parameter is not defined for this object, this returns null.

Overrides:
getParameterValue in class Object3D

setParameterValue

public void setParameterValue(TextureParameter param,
                              ParameterValue val)
Set the object defining the value of a particular texture parameter.

Overrides:
setParameterValue in class Object3D

getSkeleton

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

Overrides:
getSkeleton in class Object3D

getRenderingMesh

public RenderingMesh getRenderingMesh(double tol,
                                      boolean interactive,
                                      ObjectInfo info)
Objects which can be rendered as part of a scene should override this method to return a RenderingMesh which describes the appearance of the object. All points on the RenderingMesh should be within a distance tol of the true surface. The interactive flag tells whether the resulting Mesh will be rendered in interactive mode. When interactive is set to true, the RenderingMesh should be cached for future use, so that it may be rendered repeatedly without needing to be regenerated. The ObjectInfo contains additional information which may affect how the object is rendered, such as it location in the scene, texture parameters, etc. Objects which cannot be rendered directly (lights, cameras, curves, etc.) do not need to override this method.

Overrides:
getRenderingMesh in class Object3D

getWireframeMesh

public WireframeMesh getWireframeMesh()
Every object should override this method to return a WireframeMesh. This will be used for drawing the object in wireframe mode, and also for drawing "nonrenderable" objects in other rendering modes.

Specified by:
getWireframeMesh in class Object3D

renderObject

public void renderObject(ObjectInfo obj,
                         ViewerCanvas canvas,
                         Vec3 viewDir)
Description copied from class: Object3D
Render this object into a ViewerCanvas. The default implementation is sufficient for most objects, but subclasses may override this to customize how they are displayed.

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

getPoseKeyframe

public Keyframe getPoseKeyframe()
Return a Keyframe which describes the current pose of this object.

Specified by:
getPoseKeyframe in class Object3D

applyPoseKeyframe

public void applyPoseKeyframe(Keyframe k)
Modify this object based on a pose keyframe.

Specified by:
applyPoseKeyframe in class Object3D

configurePoseTrack

public void configurePoseTrack(PoseTrack track)
This will be called whenever a new pose track is created for this object. It allows the object to configure the track by setting its graphable values, subtracks, etc.

Overrides:
configurePoseTrack in class Object3D

editKeyframe

public void editKeyframe(EditingWindow parent,
                         Keyframe k,
                         ObjectInfo info)
Allow the user to edit a keyframe returned by getPoseKeyframe().

Overrides:
editKeyframe in class Object3D


Copyright © 1999-2011 by Peter Eastman.