AlClusterMember

Basic Interface to the object representing the relationship between an item and a cluster that it belongs to.

Synopsis

#include <AlClusterMember.h>
class AlClusterMember : public AlObject , public AlAnimatable
virtual ~AlClusterMember();
virtual AlObject* copyWrapper() const;
virtual AlObjectType type() const;
virtual AlClusterMember* asClusterMemberPtr();
virtual AlAnimatable* asAnimatablePtr();
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, AlCurveCV, or AlPolysetVertex. 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
else if( asPolysetVertexPtr( objectMember ) )
;// This member is an AlPolysetVertex 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, AlCurveCV, or AlPolysetVertex 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.

Summary

AlClusterMember::~AlClusterMember()

Description

Deletes an AlClusterMember wrapper object.

AlObject* AlClusterMember::copyWrapper() const

Description

This method makes an exact copy of the current AlClusterMember wrapper.

AlObjectType AlClusterMember::type() const

Description

Returns the class identifier 'kClusterMemberType'.

AlClusterMember* AlClusterMember::asClusterMemberPtr()

Description

This virtual function returns a non-null pointer to itself, indicating that it is safe to cast to an object of this class.

AlClusterMember* AlClusterMember::nextClusterMember() const

Description

This function 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

This function 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 preceding this one in the cluster.

Return codes

sSuccess - the wrapper now points to the preceding cluster member

sInvalidObject - the cluster member was invalid

sFailure - there was no preceding cluster member

AlObject* AlClusterMember::object() const

Description

This method returns the object that this cluster member references.

AlCluster* AlClusterMember::cluster() const

Description

This method returns the cluster that this cluster member belongs to.

statusCode AlClusterMember::removeFromCluster( AlCluster* cluster )

Description

Removes this cluster member from the cluster.

Arguments

< cluster - is the cluster to be removed from

Return codes

sSuccess - if everything successful

sInvalidObject - if cluster is not valid

sInvalidArgument - clusterMember was not valid





aliasdocs@aw.sgi.com
Copyright © 1996, Alias|Wavefront, a Silicon Graphics Company. All rights reserved.