artofillusion.object
Class ExternalObject

java.lang.Object
  extended by artofillusion.object.Object3D
      extended by artofillusion.object.ObjectWrapper
          extended by artofillusion.object.ExternalObject

public class ExternalObject
extends ObjectWrapper

ExternalObject is an Object3D that is stored in a separate file.


Field Summary
 
Fields inherited from class artofillusion.object.Object3D
APPROXIMATELY, CANT_CONVERT, EXACTLY
 
Constructor Summary
ExternalObject(java.io.DataInputStream in, Scene theScene)
          Recreate an ExternalObject by reading in the serialized representation written by writeToFile().
ExternalObject(java.io.File file, java.lang.String name)
          Create an ExternalObject from a file.
 
Method Summary
 boolean canConvertToActor()
          Determine whether the user should be allowed to convert this object to an Actor.
 boolean canSetMaterial()
          This method tells whether materials can be assigned to the object.
 boolean canSetTexture()
          This method tells whether textures can be assigned to the object.
 void copyObject(Object3D obj)
          Copy all the properties of another object, to make this one identical to it.
 Object3D duplicate()
          Create a new object which is an exact duplicate of this one.
 void edit(EditingWindow parent, ObjectInfo info, java.lang.Runnable cb)
          Display a window in which the user can edit this object.
 int getExternalObjectId()
          Get the id of the object in the external scene.
 java.lang.String getExternalObjectName()
          Get the name of the object in the external scene.
 java.io.File getExternalSceneFile()
          Get the path to the external scene file.
 boolean getIncludeChildren()
          Get whether to include children of the external object.
 java.lang.String getLoadingError()
          Get an error message which describes why the object could not be loaded, or null if it was loaded successfully.
 boolean isEditable()
          If the object can be edited by the user, isEditable() should be overridden to return true.
 void reloadObject()
          Reload the external object from its file.
 void setExternalObjectId(int id)
          Set the id of the object in the external scene.
 void setExternalObjectName(java.lang.String name)
          Set the name of the object in the external scene.
 void setExternalSceneFile(java.io.File file)
          Set the path to the external scene file.
 void setIncludeChildren(boolean include)
          Set whether to include children of the external object.
 void setSize(double xsize, double ysize, double zsize)
          ExternalObjects cannot be resized, since they are entirely defined by a separate file.
 void writeToFile(java.io.DataOutputStream out, Scene theScene)
          The following method writes the object's data to an output stream.
 
Methods inherited from class artofillusion.object.ObjectWrapper
applyPoseKeyframe, canConvertToTriangleMesh, configurePoseTrack, convertToTriangleMesh, editGesture, editKeyframe, getAverageParameterValues, getBounds, getMaterial, getMaterialMapping, getParameters, getParameterValue, getParameterValues, getPoseKeyframe, getRenderingMesh, getSkeleton, getTexture, getTextureMapping, getWireframeMesh, getWrappedObject, isClosed, renderObject, sceneChanged, setParameters, setParameterValue, setParameterValues
 
Methods inherited from class artofillusion.object.Object3D
copyTextureAndMaterial, getPosableObject, getProperties, getPropertyValue, readParameterValue, setMaterial, setPropertyValue, setTexture
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExternalObject

public ExternalObject(java.io.File file,
                      java.lang.String name)
Create an ExternalObject from a file.

Parameters:
file - the scene file containing the object
name - the name of the object to load

ExternalObject

public ExternalObject(java.io.DataInputStream in,
                      Scene theScene)
               throws java.io.IOException,
                      java.io.InvalidObjectException
Recreate an ExternalObject by reading in the serialized representation written by writeToFile().

Throws:
java.io.IOException
java.io.InvalidObjectException
Method Detail

getExternalObjectName

public java.lang.String getExternalObjectName()
Get the name of the object in the external scene.


setExternalObjectName

public void setExternalObjectName(java.lang.String name)
Set the name of the object in the external scene.


getExternalObjectId

public int getExternalObjectId()
Get the id of the object in the external scene.


setExternalObjectId

public void setExternalObjectId(int id)
Set the id of the object in the external scene.


getIncludeChildren

public boolean getIncludeChildren()
Get whether to include children of the external object.


setIncludeChildren

public void setIncludeChildren(boolean include)
Set whether to include children of the external object.


getExternalSceneFile

public java.io.File getExternalSceneFile()
Get the path to the external scene file.


setExternalSceneFile

public void setExternalSceneFile(java.io.File file)
Set the path to the external scene file.


getLoadingError

public java.lang.String getLoadingError()
Get an error message which describes why the object could not be loaded, or null if it was loaded successfully.


reloadObject

public void reloadObject()
Reload the external object from its file.


duplicate

public Object3D duplicate()
Create a new object which is an exact duplicate of this one.

Specified by:
duplicate in class Object3D

copyObject

public void copyObject(Object3D obj)
Copy all the properties of another object, to make this one identical to it. If the two objects are of different classes, this will throw a ClassCastException.

Specified by:
copyObject in class Object3D

setSize

public void setSize(double xsize,
                    double ysize,
                    double zsize)
ExternalObjects cannot be resized, since they are entirely defined by a separate file.

Specified by:
setSize in class Object3D

isEditable

public boolean isEditable()
If the object can be edited by the user, isEditable() should be overridden to return true. edit() should then create a window and allow the user to edit the object.

Overrides:
isEditable in class Object3D

edit

public void edit(EditingWindow parent,
                 ObjectInfo info,
                 java.lang.Runnable cb)
Description copied from class: Object3D
Display a window in which the user can edit this object.

Overrides:
edit in class Object3D
Parameters:
parent - the window from which this command is being invoked
info - the ObjectInfo corresponding to this object
cb - a callback which will be executed when editing is complete. If the user cancels the operation, it will not be called.

canSetTexture

public boolean canSetTexture()
This method tells whether textures can be assigned to the object. Objects for which it makes no sense to assign a texture (curves, lights, etc.) should override this method to return false.

Overrides:
canSetTexture in class Object3D

canSetMaterial

public boolean canSetMaterial()
This method tells whether materials can be assigned to the object. The default implementation will give the correct result for most objects, but subclasses can override this if necessary.

Overrides:
canSetMaterial in class Object3D

canConvertToActor

public boolean canConvertToActor()
Determine whether the user should be allowed to convert this object to an Actor.

Overrides:
canConvertToActor in class Object3D

writeToFile

public void writeToFile(java.io.DataOutputStream out,
                        Scene theScene)
                 throws java.io.IOException
The following method writes the object's data to an output stream.

Overrides:
writeToFile in class Object3D
Throws:
java.io.IOException


Copyright © 1999-2011 by Peter Eastman.