artofillusion.object
Class ReferenceImage

java.lang.Object
  extended by artofillusion.object.Object3D
      extended by artofillusion.object.ReferenceImage

public class ReferenceImage
extends Object3D

A ReferenceImage is an object that displays an image for use during modelling. When drawn in a ViewerCanvas, it is a rectangle with the image mapped to it, but when rendered by a Renderer, it is invisible.


Field Summary
 
Fields inherited from class artofillusion.object.Object3D
APPROXIMATELY, CANT_CONVERT, EXACTLY
 
Constructor Summary
ReferenceImage()
          Create a ReferenceImage whose width and height are both 1.0, and with no image set.
ReferenceImage(java.io.DataInputStream in, Scene theScene)
          Reconstruct a ReferenceImage that was saved to a file.
ReferenceImage(java.awt.Image image)
           
 
Method Summary
 void applyPoseKeyframe(Keyframe k)
          Modify this object based on a pose keyframe.
 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.
 BoundingBox getBounds()
          Get a BoundingBox which just encloses the object.
 java.awt.Image getImage()
          Get the Image displayed by this object.
 Keyframe getPoseKeyframe()
          Return a Keyframe which describes the current pose of this object.
 WireframeMesh getWireframeMesh()
          Every object should override this method to return a WireframeMesh.
 void renderObject(ObjectInfo obj, ViewerCanvas canvas, Vec3 viewDir)
          This method is overridden to render the reference image into the ViewerCanvas.
 void setImage(java.awt.Image image)
          Set the Image displayed by this object.
 void setSize(double xsize, double ysize, double zsize)
          Resize the object.
 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.Object3D
canConvertToActor, canConvertToTriangleMesh, canSetMaterial, configurePoseTrack, convertToTriangleMesh, copyTextureAndMaterial, edit, editGesture, editKeyframe, getAverageParameterValues, getMaterial, getMaterialMapping, getParameters, getParameterValue, getParameterValues, getPosableObject, getProperties, getPropertyValue, getRenderingMesh, getSkeleton, getTexture, getTextureMapping, isClosed, isEditable, readParameterValue, sceneChanged, setMaterial, setParameters, setParameterValue, setParameterValues, setPropertyValue, setTexture
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReferenceImage

public ReferenceImage()
Create a ReferenceImage whose width and height are both 1.0, and with no image set.


ReferenceImage

public ReferenceImage(java.awt.Image image)

ReferenceImage

public ReferenceImage(java.io.DataInputStream in,
                      Scene theScene)
               throws java.io.IOException
Reconstruct a ReferenceImage that was saved to a file.

Throws:
java.io.IOException
Method Detail

getImage

public java.awt.Image getImage()
Get the Image displayed by this object.


setImage

public void setImage(java.awt.Image image)
Set the Image displayed by this object.


canSetTexture

public boolean canSetTexture()
Description copied from class: Object3D
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

duplicate

public Object3D duplicate()
Description copied from class: Object3D
Create a new object which is an exact duplicate of this one.

Specified by:
duplicate in class Object3D

copyObject

public void copyObject(Object3D obj)
Description copied from class: Object3D
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

getBounds

public BoundingBox getBounds()
Description copied from class: Object3D
Get a BoundingBox which just encloses the object.

Specified by:
getBounds in class Object3D

setSize

public void setSize(double xsize,
                    double ysize,
                    double zsize)
Description copied from class: Object3D
Resize the object. This should be interpreted such that, if setSize() is followed by a call to getBounds(), the dimensions of the BoundingBox will exactly match the dimensions specified in setSize().

Specified by:
setSize in class Object3D

getWireframeMesh

public WireframeMesh getWireframeMesh()
Description copied from class: Object3D
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

getPoseKeyframe

public Keyframe getPoseKeyframe()
Description copied from class: Object3D
Return a Keyframe which describes the current pose of this object.

Specified by:
getPoseKeyframe in class Object3D

applyPoseKeyframe

public void applyPoseKeyframe(Keyframe k)
Description copied from class: Object3D
Modify this object based on a pose keyframe.

Specified by:
applyPoseKeyframe in class Object3D

renderObject

public void renderObject(ObjectInfo obj,
                         ViewerCanvas canvas,
                         Vec3 viewDir)
This method is overridden to render the reference image into the ViewerCanvas.

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

writeToFile

public void writeToFile(java.io.DataOutputStream out,
                        Scene theScene)
                 throws java.io.IOException
Description copied from class: Object3D
The following method writes the object's data to an output stream. Subclasses should override this method, but also call super.writeToFile() to save information about materials, etc. In addition to this method, every Object3D must include a constructor with the signature public Classname(DataInputStream in, Scene theScene) throws IOException, InvalidObjectException which reconstructs the object by reading its data from an input stream. This constructor, similarly, should call the overridden constructor to read information about materials, etc.

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


Copyright © 1999-2011 by Peter Eastman.