Encapsulates methods common to Alias objects that can belong to clusters.
#include <AlClusterable.h>
class AlClusterable
virtual AlCluster* firstCluster() const;
virtual AlCluster* nextCluster( const AlCluster* ) const;
virtual AlCluster* prevCluster( const AlCluster* ) const;
virtual statusCode nextClusterD( AlCluster* ) const;
virtual statusCode prevClusterD( AlCluster* ) const;
virtual statusCode applyIteratorToClusters( AlIterator*, int& );
statusCode addToCluster( AlCluster*, double = 1.0 );
statusCode removeFromCluster( AlCluster* );
statusCode removeFromAllClusters();
AlClusterMember* isClusterMember( AlCluster* ) const;
double percentEffect( AlCluster* ) const;
statusCode setPercentEffect( AlCluster*, double );
This class is a base class for all objects which can be contained in a cluster. It provides the methods necessary to access the cluster methods of these objects.
AlCluster* AlClusterable::nextCluster( const AlCluster* lastCluster ) const
AlCluster* AlClusterable::prevCluster( const AlCluster* lastCluster ) const
statusCode AlClusterable::nextClusterD( AlCluster* lastCluster ) const
statusCode AlClusterable::prevClusterD( AlCluster* lastCluster ) const
statusCode AlClusterable::applyIteratorToClusters( AlIterator* iter, int &rc )
Applies the given iterator to all the clusters in this object. See the documentation for AlIterator.
Warning: be careful when using this iterator. If you modify the actual cluster during an iteration, it is possible that this routine will end up pointing to invalid data and send you garbage. This should not happen when simply applying transformations to a cluster. But deleting a cluster using this method is considered unsafe. If you do it, return immediately.
double AlClusterable::percentEffect( AlCluster* cluster ) const
statusCode AlClusterable::addToCluster( AlCluster* cluster, double percentage )
Adds this clusterable object to a cluster. This means that all CVs 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. The default value of 1.0 means that the object’s CVs are affected 100% by the cluster leaf transformations.
The method may fail if unable to create a cluster member object, or if the addition of the object would create a cycle of clusters, or if the object to be added is already in the cluster, or if the object to be added already has an ancestor in the same target cluster.
AlClusterMember* AlClusterable::isClusterMember( AlCluster* cluster ) const