AlClusterMember
 
 
 

Represents the relationship between an item and a cluster to which it belongs.

Synopsis

#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* );

Description

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.

AlClusterMember::~AlClusterMember()

Description

Deletes an AlClusterMember wrapper object.

AlObject* AlClusterMember::copyWrapper() const

Description

Makes an exact copy of the current AlClusterMember wrapper.

AlObjectType AlClusterMember::type() const

Description

Returns the class identifier ’kClusterMemberType’.

AlClusterMember* AlClusterMember::nextClusterMember() const

Description

Returns a pointer to the cluster member following this one in the cluster. If this is the last one then NULL is returned.

AlClusterMember* AlClusterMember::prevClusterMember() const

Description

Returns a pointer to the cluster member preceding this one in the cluster. If this is the first one then NULL is returned.

statusCode AlClusterMember::nextClusterMemberD()

Description

Destructively points the current wrapper to the cluster member following this one in the cluster.

Return Codes

sSuccess - the wrapper now points to the next cluster member

sInvalidObject - the cluster member was invalid

sFailure - there was no next cluster member

statusCode AlClusterMember::prevClusterMemberD()

Description

Destructively points the current wrapper to the cluster member previous to this one in the cluster.

Return Codes

sSuccess - the wrapper now points to the previous cluster member

sInvalidObject - the cluster member was invalid

sFailure - there was no previous cluster member

AlObject* AlClusterMember::object() const

Description

Returns the object that this cluster member references.

AlCluster* AlClusterMember::cluster() const

Description

Returns the cluster that this cluster member belongs to.

statusCode AlClusterMember::removeFromCluster( AlCluster* cluster )

Description

Removes this cluster member from the cluster.

Arguments

< cluster - the cluster to be removed from

Return Codes

sSuccess - everything was successful

sInvalidObject - cluster is not valid

sInvalidArgument - clusterMember was not valid