Basic Interface to Alias objects that support animation.
Synopsis
#include <AlAnimatable.h>
class AlAnimatable
virtual AlChannel* firstChannel() const;
virtual AlChannel* nextChannel( const AlChannel* ) const;
virtual AlChannel* prevChannel( const AlChannel* ) const;
virtual statusCode nextChannelD( AlChannel* ) const;
virtual statusCode prevChannelD( AlChannel* ) const;
virtual statusCode applyIteratorToChannels( AlIterator*, int &);
virtual statusCode deleteAnimation();
statusCode globalParam( const char *param, boolean& );
AlList* globalParamList();
statusCode localParam( const char *param, boolean& );
AlList* localParamList();
statusCode setLocalParam( const char *paramName, boolean state );
statusCode setGlobalParam( const char *paramName, boolean state );
class AlParamItem : public AlLinkItem
AlParamItem* nextItem()
AlParamItem* prevItem()
char* name;
boolean value;
Description
This class encapsulates the functionality of Alias objects that have the capacity to be animated. It also provides access to channels.
The AlParamItem class is also defined in the AlAnimatable.h header file. AlParamItem classes are used for returning information
from several of the methods of AlAnimatable. In both cases, an AlList of AlParamItem classes is returned by this API. No specific
method information is provided for AlParamItem because it is similar to AlLinkItem with the addition of two variable fields.
AlChannel* AlAnimatable::firstChannel() const
Description
Gets the first channel animating this object. If this object is not animated, this method returns NULL.
AlChannel* AlAnimatable::nextChannel( const AlChannel *channel) const
Description
Gets the next channel after the specified channel, as determined by the object’s list of channels. If the specified channel
is not part of the object’s channel list, or it is the last channel in the list, then NULL is returned.
Arguments
< channel - one of this object’s channels for which we want to find the next channel
AlChannel* AlAnimatable::prevChannel( const AlChannel *channel) const
Description
Gets the next channel in this object’s list of channels following the given ’channel’. If ’channel’ is not part of the object’s
channel list, or it is the last channel in the list, then NULL is returned.
Arguments
< channel - one of this object’s channels for which we want to find the next channel.
statusCode AlAnimatable::nextChannelD( AlChannel *channel ) const
Description
Destructively sets the passed-in channel to point to the next channel in the list of channels for this object.
Arguments
< channel - the channel
Return Codes
sSuccess - the next channel was successfully found
sInvalidObject - the channel was not valid
sFailure - there is no next channel
statusCode AlAnimatable::prevChannelD( AlChannel *channel ) const
Description
Destructively sets the passed-in channel to point to the next channel in the list of channels for this object.
Arguments
< channel - the channel
Return Codes
sSuccess - the previous channel was successfully determined
sInvalidObject - the channel was not valid
sFailure - there is no next channel
statusCode AlAnimatable::applyIteratorToChannels( AlIterator* iter, int &rc )
Description
Applies the given iterator to each of the channels in this object. See the documentation for AlIterator.
Arguments
< iter - the iterator to apply to each channel
> rc - the result of the last application of the iterator
Return Codes
sSuccess - the iterator was successfully applied
sInvalidObject - the object was not valid
sFailure - the application of the iterator failed or the object had no channels
sInvalidArgument - the iterator was NULL
AlChannel *AlAnimatable::findChannel( int parameter ) const
Description
A fast way to obtain a particular AlChannel on an object from the parameter of that channel. This method returns the AlChannel,
which animates the passed-in parameter of the given AlAnimatable. If the object is not valid, or the parameter is not currently
animated, NULL is returned.
Arguments
< parameter - the parameter of the AlAnimatable corresponding to the desired channel.
double AlAnimatable::sampleChannel( int parameter ) const
Description
Samples the parameter of the AlAnimatable without actually evaluating it. It reads the current value of the parameter and
returns it as a double. Note that the parameter does not need to be currently animated to sample it.
If this method succeeds, it returns the value of the parameter at the current frame. If it fails, 0.0 is returned.
Arguments
< parameter - the parameter of the AlAnimatable to be sampled.
statusCode AlAnimatable::deleteAnimation()
Description
Deletes all the channels that currently animate this object.
Return Codes
sSuccess - the animation was successfully deleted
sInvalidObject - the object was not valid
statusCode AlAnimatable::globalParam( const char *paramName, boolean& state )
Description
Returns the parameter control.
Arguments
paramName - the name of the parameter in question
state - the returned state of the parameter
Return Codes
sSuccess - the parameter was read
sObjectNotFound - the paramName could not be found
sInvalidArgument - paramName was NULL
sInvalidObject - the object was not valid
statusCode AlAnimatable::localParam( const char *paramName, boolean& state )
Description
Returns the parameter control. If there are no local params set, then the default local params are returned.
Arguments
paramName - the name of the parameter in question
state - the returned state of the parameter
Return Codes
sSuccess - the parameter was read
sObjectNotFound - the paramName could not be found
sInvalidArgument - paramName was NULL
sInvalidObject - the object was not valid
AlList* AlAnimatable::localParamList()
Description
Returns a list of the parameter control names. The list contains a list of ’AlParamItem’s.
AlList* AlAnimatable::globalParamList()
Description
Returns a list of the parameter controls.
statusCode AlAnimatable::setLocalParam( const char *paramName, boolean state )
Description
Sets the parameter control.
Arguments
paramName - the name of the parameter in question
state - the returned state of the parameter
Return Codes
sSuccess - the parameter was read
sObjectNotFound - the paramName could not be found
sFailure - there were no local params set
sInvalidArgument - paramName was NULL
sInvalidObject - the object was not valid
statusCode AlAnimatable::setGlobalParam( const char *paramName, boolean state )
Description
Sets the parameter control for objects of this type.
Arguments
paramName - the name of the parameter in question
state - the new state of the parameter
Return Codes
sSuccess - the parameter was read
sObjectNotFound - the paramName could not be found
sInvalidArgument - paramName was NULL
sInvalidObject - the object was not valid