artofillusion.animation
Class Track

java.lang.Object
  extended by artofillusion.animation.Track
Direct Known Subclasses:
BendTrack, ConstraintTrack, CustomDistortionTrack, FilterParameterTrack, IKTrack, PoseTrack, PositionTrack, ProceduralPositionTrack, ProceduralRotationTrack, RotationTrack, ScaleTrack, ShatterTrack, SkeletonShapeTrack, TextureTrack, TwistTrack, VisibilityTrack, WeightTrack

public abstract class Track
extends java.lang.Object

This is an abstract class representing an aspect of the scene which changes with time. Tracks are typically defined either by a Timecourse or a Procedure.


Constructor Summary
Track(java.lang.String name)
           
 
Method Summary
abstract  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.
abstract  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.
abstract  void deleteKeyframe(int which)
          Delete the specified keyframe.
abstract  Track duplicate(java.lang.Object parent)
          Create a duplicate of this track (possibly for another object and/or parent track).
abstract  void edit(LayoutWindow win)
          This method should present a window in which the user can edit the track.
 void editKeyframe(LayoutWindow win, int which)
          This method should present a window in which the user can edit the specified keyframe.
 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[] getGraphValues(Keyframe key)
          Get the list of graphable values for a particular keyframe.
abstract  double[] getKeyTimes()
          Get a list of all keyframe times for this track.
 java.lang.String getName()
          Get the name of the track.
 java.lang.Object getParent()
          Get the parent object of this track.
 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.
abstract  void initFromStream(java.io.DataInputStream in, Scene scene)
          Initialize this tracked based on its serialized representation as written by writeToStream().
 boolean isEnabled()
          Returns whether the track is currently enabled.
abstract  boolean isNullTrack()
          A null track is one which has no affect on the scene.
 boolean isQuantized()
          Returns whether timepoints for the track must lie exactly on a frame.
abstract  int moveKeyframe(int which, double time)
          Move a keyframe to a new time, and return its new position in the list.
 void setEnabled(boolean enable)
          Enable or disable the track.
 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.
 Keyframe setKeyframeIfModified(double time, Scene sc)
          Set a keyframe at the specified time, based on the current state of the Scene, if and only if the Scene does not match the current state of the track.
 void setName(java.lang.String name)
          Set the name of the track.
 void setParent(java.lang.Object obj)
          Set the parent object of this track.
 void setQuantized(boolean quantize)
          Set whether timepoints for the track must lie exactly on a frame.
 void updateObjectReferences(java.util.Map<ObjectInfo,ObjectInfo> objectMap)
          Update any references to objects this track depends on.
abstract  void writeToStream(java.io.DataOutputStream out, Scene scene)
          Write a serialized representation of this track to a stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Track

public Track(java.lang.String name)
Method Detail

getName

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


setName

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


isEnabled

public boolean isEnabled()
Returns whether the track is currently enabled.


setEnabled

public void setEnabled(boolean enable)
Enable or disable the track.


isQuantized

public boolean isQuantized()
Returns whether timepoints for the track must lie exactly on a frame.


setQuantized

public void setQuantized(boolean quantize)
Set whether timepoints for the track must lie exactly on a frame.


getValueNames

public java.lang.String[] getValueNames()
Get the names of all graphable values for this track.


getGraphValues

public double[] getGraphValues(Keyframe key)
Get the list of graphable values for a particular keyframe.


getDefaultGraphValues

public double[] getDefaultGraphValues()
Get the default list of graphable values (for a track which has no keyframes).


getValueRange

public double[][] getValueRange()
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.


edit

public abstract void edit(LayoutWindow win)
This method should present a window in which the user can edit the track.


editKeyframe

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


apply

public abstract 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.


duplicate

public abstract Track duplicate(java.lang.Object parent)
Create a duplicate of this track (possibly for another object and/or parent track).


copy

public abstract void copy(Track tr)
Make this track identical to another one.


getKeyTimes

public abstract double[] getKeyTimes()
Get a list of all keyframe times for this track.


getTimecourse

public Timecourse getTimecourse()
Get the timecourse describing this track, or null if it is not described by a timecourse.


getSmoothingMethod

public int getSmoothingMethod()
Get the smoothing method for this track.


setKeyframe

public void setKeyframe(double time,
                        Keyframe k,
                        Smoothness s)
Set a keyframe at the specified time.


setKeyframe

public Keyframe setKeyframe(double time,
                            Scene sc)
Set a keyframe at the specified time, based on the current state of the Scene.


setKeyframeIfModified

public Keyframe setKeyframeIfModified(double time,
                                      Scene sc)
Set a keyframe at the specified time, based on the current state of the Scene, if and only if the Scene does not match the current state of the track. Return the new keyframe, or null if none was set.


moveKeyframe

public abstract int moveKeyframe(int which,
                                 double time)
Move a keyframe to a new time, and return its new position in the list.


deleteKeyframe

public abstract void deleteKeyframe(int which)
Delete the specified keyframe.


isNullTrack

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


getSubtracks

public Track[] getSubtracks()
Get any child tracks of this track.


canAcceptAsParent

public boolean canAcceptAsParent(java.lang.Object obj)
Determine whether this track can be added as a child of an object.


getParent

public java.lang.Object getParent()
Get the parent object of this track.


setParent

public void setParent(java.lang.Object obj)
Set the parent object of this track.


getDependencies

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


deleteDependencies

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


updateObjectReferences

public void updateObjectReferences(java.util.Map<ObjectInfo,ObjectInfo> objectMap)
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.


writeToStream

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

Throws:
java.io.IOException

initFromStream

public abstract 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().

Throws:
java.io.IOException
java.io.InvalidObjectException


Copyright © 1999-2011 by Peter Eastman.