artofillusion.animation
Class ProceduralPositionTrack

java.lang.Object
  extended by artofillusion.animation.Track
      extended by artofillusion.animation.ProceduralPositionTrack
All Implemented Interfaces:
ProcedureOwner

public class ProceduralPositionTrack
extends Track
implements ProcedureOwner

This is a Track which uses a procedure to control the position of an object.


Field Summary
static int ABSOLUTE
           
static int LOCAL
           
static int OBJECT
           
static int PARENT
           
static int RELATIVE
           
static int WORLD
           
 
Constructor Summary
ProceduralPositionTrack(ObjectInfo info)
           
 
Method Summary
 void acceptEdits(ProcedureEditor editor)
          This is called when the user clicks OK in the procedure editor.
 boolean allowParameters()
          Determine whether the procedure may contain Parameter modules.
 boolean allowViewAngle()
          Determine whether the procedure may contain View Angle modules.
 void apply(double time)
          This method should modify whatever aspects of the scene are governed by this track, so that they correspond to their values at the specified time.
 boolean canAcceptAsParent(java.lang.Object obj)
          Determine whether this track can be added as a child of an object.
 boolean canEditName()
          Determine whether the procedure may be renamed.
 void copy(Track tr)
          Make this track identical to another one.
 void deleteDependencies(ObjectInfo obj)
          Delete all references to the specified object from this track.
 void deleteKeyframe(int which)
          Delete the specified keyframe.
 void disposePreview(java.lang.Object preview)
          Dispose of the preview object when the editor is closed.
 Track duplicate(java.lang.Object obj)
          Create a duplicate of this track (possibly for another object and/or parent track).
 void edit(LayoutWindow win)
          This method should present a window in which the user can edit the track.
 void editKeyframe(LayoutWindow win, int which)
          Present a window in which the user can edit the specified keyframe.
 void editProperties(ProcedureEditor editor)
          Display the Properties dialog.
 int getApplyToJoint()
          Get the ID of the joint this track applies to, or -1 if it applies to the object origin.
 int getCoordinateSystem()
          Get the coordinate system of this track (WORLD, PARENT, OBJECT, or LOCAL).
 ObjectRef getCoordsObject()
          Get the object reference for the parent coordinate system.
 double[] getDefaultGraphValues()
          Get the default list of graphable values (for a track which has no keyframes).
 ObjectInfo[] getDependencies()
          Get an array of any objects which this track depends on (and which therefore must be updated before this track is applied).
 double[] getKeyTimes()
          Get a list of all keyframe times for this track.
 java.lang.Object getParent()
          Get the parent object of this track.
 java.lang.Object getPreview(ProcedureEditor editor)
          Create an object which displays a preview of the procedure.
 int getSmoothingMethod()
          Get the smoothing method for this track.
 Track[] getSubtracks()
          Get any child tracks of this track.
 Timecourse getTimecourse()
          Get the timecourse describing this track, or null if it is not described by a timecourse.
 java.lang.String[] getValueNames()
          Get the names of all graphable values for this track.
 double[][] getValueRange()
          Get the allowed range for graphable values.
 java.lang.String getWindowTitle()
          Get the title of the procedure's editing window.
 void initFromStream(java.io.DataInputStream in, Scene scene)
          Initialize this tracked based on its serialized representation as written by writeToStream().
 boolean isNullTrack()
          A null track is one which has no affect on the scene.
 boolean isRelative()
          Determine whether this track is in absolute or relative mode.
 int moveKeyframe(int which, double time)
          Move a keyframe to a new time, and return its new position in the list.
 void setApplyToJoint(int jointID)
          Set the ID of the joint this track applies to.
 void setCoordinateSystem(int system)
          Set the coordinate system of this track (WORLD, PARENT, OBJECT, or LOCAL).
 void setCoordsObject(ObjectRef obj)
          Set the object reference for the parent coordinate system.
 void setKeyframe(double time, Keyframe k, Smoothness s)
          Set a keyframe at the specified time.
 Keyframe setKeyframe(double time, Scene sc)
          Set a keyframe at the specified time, based on the current state of the Scene.
 void setParent(java.lang.Object obj)
          Set the parent object of this track.
 void setRelative(boolean rel)
          Set whether this track is in absolute or relative mode.
 void setSmoothingMethod(int method)
           
 void updateObjectReferences(java.util.Map<ObjectInfo,ObjectInfo> objectMap)
          Update any references to objects this track depends on.
 void updatePreview(java.lang.Object preview)
          Update the display of the preview.
 void writeToStream(java.io.DataOutputStream out, Scene scene)
          Write a serialized representation of this track to a stream.
 
Methods inherited from class artofillusion.animation.Track
getGraphValues, getName, isEnabled, isQuantized, setEnabled, setKeyframeIfModified, setName, setQuantized
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface artofillusion.procedural.ProcedureOwner
getName, setName
 

Field Detail

ABSOLUTE

public static final int ABSOLUTE
See Also:
Constant Field Values

RELATIVE

public static final int RELATIVE
See Also:
Constant Field Values

WORLD

public static final int WORLD
See Also:
Constant Field Values

PARENT

public static final int PARENT
See Also:
Constant Field Values

OBJECT

public static final int OBJECT
See Also:
Constant Field Values

LOCAL

public static final int LOCAL
See Also:
Constant Field Values
Constructor Detail

ProceduralPositionTrack

public ProceduralPositionTrack(ObjectInfo info)
Method Detail

apply

public void apply(double time)
Description copied from class: Track
This method should modify whatever aspects of the scene are governed by this track, so that they correspond to their values at the specified time.

Specified by:
apply in class Track

duplicate

public Track duplicate(java.lang.Object obj)
Description copied from class: Track
Create a duplicate of this track (possibly for another object and/or parent track).

Specified by:
duplicate in class Track

copy

public void copy(Track tr)
Description copied from class: Track
Make this track identical to another one.

Specified by:
copy in class Track

getKeyTimes

public double[] getKeyTimes()
Description copied from class: Track
Get a list of all keyframe times for this track.

Specified by:
getKeyTimes in class Track

getTimecourse

public Timecourse getTimecourse()
Description copied from class: Track
Get the timecourse describing this track, or null if it is not described by a timecourse.

Overrides:
getTimecourse in class Track

setKeyframe

public void setKeyframe(double time,
                        Keyframe k,
                        Smoothness s)
Description copied from class: Track
Set a keyframe at the specified time.

Overrides:
setKeyframe in class Track

setKeyframe

public Keyframe setKeyframe(double time,
                            Scene sc)
Description copied from class: Track
Set a keyframe at the specified time, based on the current state of the Scene.

Overrides:
setKeyframe in class Track

moveKeyframe

public int moveKeyframe(int which,
                        double time)
Description copied from class: Track
Move a keyframe to a new time, and return its new position in the list.

Specified by:
moveKeyframe in class Track

deleteKeyframe

public void deleteKeyframe(int which)
Description copied from class: Track
Delete the specified keyframe.

Specified by:
deleteKeyframe in class Track

isNullTrack

public boolean isNullTrack()
Description copied from class: Track
A null track is one which has no affect on the scene. This usually means that no keyframes have been added to it.

Specified by:
isNullTrack in class Track

getSubtracks

public Track[] getSubtracks()
Description copied from class: Track
Get any child tracks of this track.

Overrides:
getSubtracks in class Track

canAcceptAsParent

public boolean canAcceptAsParent(java.lang.Object obj)
Description copied from class: Track
Determine whether this track can be added as a child of an object.

Overrides:
canAcceptAsParent in class Track

getParent

public java.lang.Object getParent()
Description copied from class: Track
Get the parent object of this track.

Overrides:
getParent in class Track

setParent

public void setParent(java.lang.Object obj)
Description copied from class: Track
Set the parent object of this track.

Overrides:
setParent in class Track

getSmoothingMethod

public int getSmoothingMethod()
Description copied from class: Track
Get the smoothing method for this track.

Overrides:
getSmoothingMethod in class Track

setSmoothingMethod

public void setSmoothingMethod(int method)

isRelative

public boolean isRelative()
Determine whether this track is in absolute or relative mode.


setRelative

public void setRelative(boolean rel)
Set whether this track is in absolute or relative mode.


getCoordinateSystem

public int getCoordinateSystem()
Get the coordinate system of this track (WORLD, PARENT, OBJECT, or LOCAL).


setCoordinateSystem

public void setCoordinateSystem(int system)
Set the coordinate system of this track (WORLD, PARENT, OBJECT, or LOCAL).


getCoordsObject

public ObjectRef getCoordsObject()
Get the object reference for the parent coordinate system. The return value is undefined if getCoordinateSystem() does not return OBJECT.


setCoordsObject

public void setCoordsObject(ObjectRef obj)
Set the object reference for the parent coordinate system. This causes the coordinate system to be set to OBJECT.


getApplyToJoint

public int getApplyToJoint()
Get the ID of the joint this track applies to, or -1 if it applies to the object origin.


setApplyToJoint

public void setApplyToJoint(int jointID)
Set the ID of the joint this track applies to. Specify -1 if it should apply to the object origin.


getValueNames

public java.lang.String[] getValueNames()
Description copied from class: Track
Get the names of all graphable values for this track.

Overrides:
getValueNames in class Track

getDefaultGraphValues

public double[] getDefaultGraphValues()
Description copied from class: Track
Get the default list of graphable values (for a track which has no keyframes).

Overrides:
getDefaultGraphValues in class Track

getValueRange

public double[][] getValueRange()
Description copied from class: Track
Get the allowed range for graphable values. This returns a 2D array, where elements [n][0] and [n][1] are the minimum and maximum allowed values, respectively, for the nth graphable value.

Overrides:
getValueRange in class Track

getDependencies

public ObjectInfo[] getDependencies()
Description copied from class: Track
Get an array of any objects which this track depends on (and which therefore must be updated before this track is applied).

Overrides:
getDependencies in class Track

deleteDependencies

public void deleteDependencies(ObjectInfo obj)
Description copied from class: Track
Delete all references to the specified object from this track. This is used when an object is deleted from the scene.

Overrides:
deleteDependencies in class Track

updateObjectReferences

public void updateObjectReferences(java.util.Map<ObjectInfo,ObjectInfo> objectMap)
Description copied from class: Track
Update any references to objects this track depends on. Any reference to an object found as a key in the map should be replaced with the corresponding object. This is used, for example, when copying and pasting objects between scenes.

Overrides:
updateObjectReferences in class Track

writeToStream

public void writeToStream(java.io.DataOutputStream out,
                          Scene scene)
                   throws java.io.IOException
Write a serialized representation of this track to a stream.

Specified by:
writeToStream in class Track
Throws:
java.io.IOException

initFromStream

public void initFromStream(java.io.DataInputStream in,
                           Scene scene)
                    throws java.io.IOException,
                           java.io.InvalidObjectException
Initialize this tracked based on its serialized representation as written by writeToStream().

Specified by:
initFromStream in class Track
Throws:
java.io.IOException
java.io.InvalidObjectException

editKeyframe

public void editKeyframe(LayoutWindow win,
                         int which)
Present a window in which the user can edit the specified keyframe.

Overrides:
editKeyframe in class Track

edit

public void edit(LayoutWindow win)
Description copied from class: Track
This method should present a window in which the user can edit the track.

Specified by:
edit in class Track

getWindowTitle

public java.lang.String getWindowTitle()
Get the title of the procedure's editing window.

Specified by:
getWindowTitle in interface ProcedureOwner

getPreview

public java.lang.Object getPreview(ProcedureEditor editor)
Create an object which displays a preview of the procedure.

Specified by:
getPreview in interface ProcedureOwner

updatePreview

public void updatePreview(java.lang.Object preview)
Update the display of the preview.

Specified by:
updatePreview in interface ProcedureOwner

disposePreview

public void disposePreview(java.lang.Object preview)
Dispose of the preview object when the editor is closed.

Specified by:
disposePreview in interface ProcedureOwner

allowViewAngle

public boolean allowViewAngle()
Determine whether the procedure may contain View Angle modules.

Specified by:
allowViewAngle in interface ProcedureOwner

allowParameters

public boolean allowParameters()
Determine whether the procedure may contain Parameter modules.

Specified by:
allowParameters in interface ProcedureOwner

canEditName

public boolean canEditName()
Determine whether the procedure may be renamed.

Specified by:
canEditName in interface ProcedureOwner

acceptEdits

public void acceptEdits(ProcedureEditor editor)
This is called when the user clicks OK in the procedure editor.

Specified by:
acceptEdits in interface ProcedureOwner

editProperties

public void editProperties(ProcedureEditor editor)
Display the Properties dialog.

Specified by:
editProperties in interface ProcedureOwner


Copyright © 1999-2011 by Peter Eastman.