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.
statusCode AlCluster::deleteObject()
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.
statusCode AlCluster::applyIteratorToMembers( AlIterator* iter, int &rc ) const
Applies the given iterator to each member of this cluster. See the documentation for AlIterator.
statusCode AlCluster::clusterRestrict( AlClusterRestrict& restrict ) const