Represents the relationship between an item and a cluster to which it belongs.
#include <AlClusterMember.h> class AlClusterMember : public AlObject , public AlAnimatable virtual ~AlClusterMember(); virtual AlObject* copyWrapper() const; virtual AlObjectType type() const; AlClusterMember* nextClusterMember() const; AlClusterMember* prevClusterMember() const; statusCode nextClusterMemberD(); statusCode prevClusterMemberD(); AlObject* object() const; AlCluster* cluster() const; statusCode removeFromCluster( AlCluster* );
This class encapsulates the relationship that is cluster membership. Whenever an object is placed into a cluster an AlClusterMember object is created to represent the relationship.
Each AlClusterMember object knows the associated cluster object as well as the geometry object which represents the item in the cluster. Currently, this object can be an AlDagNode, AlSurfaceCV, or AlCurveCV. To determine an AlClusterMember’s type, use the following method:
AlClusterMember* clusterMember; AlObject* objectMember; objectMember = clusterMember->object(); if( objectMember->asDagNodePtr() ) ;// This member is an AlDagNode object else if( asCurveCVPtr( objectMember ) ) ;// This member is an AlCurveCV object else if( asSurfaceCVPtr( objectMember ) ) ;// This member is an AlSurfaceCV object
Alternatively, the type() method in the AlObject class can be used to determine the object type:
AlClusterMember* clusterMember; AlObject* objectMember; objectMember = clusterMember->object(); switch( objectMember->type() ) { case kDagNodeType: { AlDagNode *dagNode = objectMember->asDagNodePtr(); .... } }
If an AlDagNode is a member of an AlCluster then every AlSurfaceCV, or AlCurveCV that appears in the DAG hierarchy underneath the AlDagNode is affected by the AlCluster.
For example, if you wanted to set the percentage effects of all CVs that were affected by an AlCluster, you would use the firstMember() method from the AlCluster object, then walk along the AlClusterMember list using the method nextClusterMember() in the AlClusterMember object. Whenever you encountered an AlDagNode member (as determined by the code fragment above) you would recursively walk down the DAG node to find all AlSurfaceCVs and AlCurveCVs below it in the DAG.
The AlClusterMember object may not be created or destroyed directly. The AlCluster object creates or destroys the AlClusterMember object when the memberships of the AlCluster object change.
The print() method is an aid to debugging code. It prints the current contents of the cluster member object.