#include <AlCluster.h>
class AlCluster : public AlObject
AlCluster();
virtual ~AlCluster();
virtual statusCode deleteObject();
virtual AlObject* copyWrapper() const;
statusCode create();
AlObjectType type() const;
AlCluster* asClusterPtr();
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 );
// Obsolete .. moved to AlClusterable, AlClusterMember
statusCode addMember( const AlClusterable*, double = 1.0 );
statusCode removeMember( AlClusterable* );
statusCode removeMember( AlClusterMember* );
AlClusterMember* hasMember( const AlClusterable* ) const;
double percentEffect( AlClusterable* ) const;
statusCode setPercentEffect( AlClusterable*, double );
static statusCode removeFromAllClusters( AlClusterable* );
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.
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.
sInvalidObject - the cluster was not valid
sInsufficientMemory - if not enough memory available
sInvalidObject - the AlCluster was not valid
sFailure - the method failed.
sInvalidObject - the AlCluster was not valid
sFailure - the method failed.
Return codes
sSuccess - the iterator completed successfully statusCode AlCluster::clusterRestrict( AlClusterRestrict& restrict ) const
Description
Puts the type of the current cluster, kMultiCluster or kExclusiveCluster, into the argument. Arguments
> restrict - value to return Return codes
sSuccess - the cluster type was successfully set. statusCode AlCluster::setClusterRestrict( AlClusterRestrict newRestrict )
Description
Sets the type of the current cluster, kMultiCluster or kExclusiveCluster Arguments
< newRestrict - new cluster type Return codes
sSuccess - if everything successful statusCode AlCluster::addMember( const AlClusterable* clustobj,double percentage /* = 1.0 */)
Description
Adds a clusterable object to a cluster. This means that all CV's under this dag are affected by the cluster. The percentage defines how much of the cluster's transformation is applied to the CVs under the dag node. A value of 1.0 means that the object's CVs are affected 100% by the cluster leaf transformations. Arguments
< clustobj - is the object to add to the cluster Return codes
sSuccess - if everything was successful statusCode AlCluster::removeMember( AlClusterable* clustobj )
Description
Removes the object from the cluster. Arguments
< clustobj - the object to remove from the cluster. Return codes
sSuccess - if everything successful statusCode AlCluster::removeMember( AlClusterMember* clusterMember )
Description
Removes the cluster member from the cluster. Arguments
< clusterMember - is the member to be removed Return codes
sSuccess - if everything successful AlClusterMember* AlCluster::hasMember( const AlClusterable* clustobj ) const
Description
Finds the AlClusterMember that corresponds to the relationship between the given object and the cluster object. NULL is returned if the object is not a member of the cluster or the cluster is not valid. Arguments
< clustobj - is the object to be checked. double AlCluster::percentEffect( AlClusterable* clustobj ) const
Description
Returns the percentage effect this cluster has on the given object. If the call fails, 0.0 is returned. Arguments
< clustobj - is the object whose percentage is to be found statusCode AlCluster::setPercentEffect( AlClusterable* clustobj, double percentage )
Description
Sets the percentage effect this cluster has on all things below the given object Arguments
< clustobj - is the object whose children are to have their cluster percentage effects set Return codes
sSuccess - if everything successful statusCode AlCluster::removeFromAllClusters( AlClusterable* clustobj )
Description
Removes this object from all clusters in the universe that it may be in. Arguments
< clustobj - the object to remove from all clusters Return codes
sSuccess - the object was successfully removed from all clusters.