Encapsulates creation, deletion and manipulation of clusters.
#include <AlCluster.h> class AlCluster : public AlObject enum PercentEffectType { kInvalid, kLeafNode, kJoint }; AlCluster(); virtual ~AlCluster(); virtual statusCode deleteObject(); virtual AlObject* copyWrapper() const; statusCode create(); AlObjectType type() const; AlCluster* nextCluster() const; statusCode nextClusterD(); AlCluster* prevCluster() const; statusCode prevClusterD(); AlClusterNode* clusterNode() const; boolean isEmpty() const; int numberOfMembers() const; AlClusterMember* firstMember() const; statusCode applyIteratorToMembers( AlIterator*, int& ) const; statusCode clusterRestrict( AlClusterRestrict& ) const; statusCode setClusterRestrict( AlClusterRestrict ); statusCode originalTRS( double[3], double[3], double[3] ) const;
This class encapsulates the functionality for creating, manipulating and deleting a cluster. A cluster is a group of DAG nodes and/or curve and surface control points, which are grouped as such for deformation purposes. Every cluster has a cluster DAG node which is in the universe’s DAG. Adding and removing nodes and control points to and from a cluster does not affect the topology of the universe’s DAG. Transforming the cluster DAG node affects the transformations of the objects in the cluster.
Empty clusters are allowed. An object can be in more than one cluster at a time, provided that those clusters are of type kMultiCluster. When an object is added to a cluster, it is given a weight that indicates how much of the cluster’s leaf transformation is applied to the object. The default weight is 100%. If a DAG node is added to a cluster the percentages of each individual CV may be manipulated separately without actually adding the CVs themselves to the cluster.
To create a cluster, the user must instantiate and call create on an AlCluster object. This also creates an AlClusterNode which gets attached to the AlCluster and which is inserted into the universe’s DAG. The user may not instantiate an AlClusterNode or an AlClusterMember directly.
There are two ways to delete a cluster object. When a cluster is deleted, its attached cluster node is deleted. Alternatively, when AlClusterNode::deleteObject() is used, its cluster is deleted. The DAG nodes and control points in a cluster are not deleted, however the AlClusterMember objects that represented the "in a cluster" relation are invalidated.
Clusters don’t have names. Any attempts to query for a name will return NULL.
Constructs an AlCluster wrapper object.
Deletes an AlCluster wrapper object.
Returns an exact duplicate of the current AlCluster wrapper.
Deletes the associated cluster node and for removes the cluster from the universe. This function also invalidates all of the AlClusterMember objects associated with this cluster.
A cluster can be deleted in two ways. If AlCluster::deleteObject() is called, it deletes the associated cluster node. If AlClusterNode::deleteObject() is called, it invalidates the associated AlCluster and AlClusterMembers.
Note that removing all members of a cluster will not destroy it. You must call the cluster deleteObject() to do this.
sSuccess - the data for the cluster was successfully deleted
sInvalidObject - the cluster was not valid
Creates a cluster and a cluster DAG node. The cluster DAG node is added to the current universe. The cluster by default is given ’non-exclusive’ status - this means that a particular item can be in more than one cluster at a time.
sSuccess - everything was successful
sInsufficientMemory - not enough memory available
Returns the class identifier ’kClusterType’.
Returns a pointer to the cluster following this one in the global cluster list. If this is the last one then NULL is returned.
Destructively sets the object to point to the next cluster in the global cluster list, if the next cluster can be found. If not, the object is unaffected.
sSuccess - the AlCluster was successfully updated
sInvalidObject - the AlCluster was not valid
sFailure - the method failed
Returns a pointer to the cluster preceding this one in the global cluster list. If this is the first one then NULL is returned.
Destructively sets the object to point to the next cluster in the global cluster list, if the next cluster can be found. If not, the object is unaffected.
sSuccess - the AlCluster was successfully updated
sInvalidObject - the AlCluster was not valid
sFailure - the method failed
Returns a pointer to the attached (parent) cluster node. The cluster node must exist.
Returns TRUE if this cluster is empty (that is, doesn’t have any members). If the call fails, TRUE is returned.
Returns the head of the list of members in this cluster.
Returns the number of members in this cluster. Zero is returned if the call fails.
Applies the given iterator to each member of this cluster. See the documentation for AlIterator.
sSuccess - the iterator completed successfully
sInvalidArgument - the iterator ’iter’ was NULL
sInvalidObject - the cluster was invalid
sFailure - the iterator completed abnormally
Puts the type of the current cluster, kMultiCluster or kExclusiveCluster, into the argument.
> restrict - value to return
sSuccess - the cluster type was successfully set
sInvalidObject - the cluster was invalid
sFailure - the cluster type could not be determined
Sets the type of the current cluster, kMultiCluster or kExclusiveCluster
< newRestrict - new cluster type
sSuccess - everything successful
sInvalidObject - the cluster was not valid
sFailure - if cluster could not take on the given type
sInvalidArgument - the argument was neither kMultiCluster nor kExclusiveCluster
Gets the original translate, rotate and scale of this cluster.
sSuccess - original TRS was get successfully
sInvalidObject - the cluster was not valid
sFailure - can’t get the original TRS
sInvalidArgument - if any of the arguments are NULL