AlSet
Basic Interface to Alias set structures.
Synopsis
#include <AlSet.h>
class AlSet : public AlObject
AlSet();
virtual ~AlSet();
virtual statusCode deleteObject();
virtual AlObject *copyWrapper() const;
statusCode create( const boolean );
virtual AlObjectType type() const;
virtual AlSet* asSetPtr();
virtual const char* name() const;
virtual statusCode setName( const char* );
AlSet* nextSet() const;
AlSet* prevSet() const;
statusCode nextSetD();
statusCode prevSetD();
boolean isEmpty() const;
boolean isExclusive() const;
int numberOfMembers() const;
AlSetMember *firstMember() const;
statusCode applyIteratorToMembers( AlIterator* iter, int& );
// Obsolete .. Moved to AlSettable, AlSetMember
statusCode addMember( const AlSettable * );
statusCode removeMember( AlSettable *);
statusCode removeMember( AlSetMember *);
AlSetMember *hasMember( const AlSettable* ) const;
static statusCode removeFromAllSets( AlSettable* );
Description
A set can be described as a storable list. A set can contain any combination of cameras, dag nodes, curve CVs and surface CVs, or polyset vertices. A set can be exclusive or multi - exclusive means that a member of a set can be in no other set; multi means that a member of the set can be in any other non-exclusive set.
You can access the members of a set by traversing a set's list of members.
If you remove all members of a set, the empty AlSet object must be explicitly deleted. If you store an empty set, it will be lost when you retrieve your wire file into the interactive Alias package.
The following classes can be grouped into sets: AlDagNode, AlPerspectiveCamera, AlCurveCV, AlPolysetVertex and AlSurfaceCV.
Summary
AlSet::AlSet()
Description
Constructs an AlSet wrapper object. Use the create() method to initialize an AlSet.
AlSet::~AlSet()
Description
Deletes an AlSet wrapper object.
statusCode AlSet::deleteObject()
Description
This method removes all the set members from the set, and then deletes the set itself.
Return codes
sSuccess - the set was deleted
sFailure - the set could not be deleted
sInvalidObject - the set is invalid
AlObject* AlSet::copyWrapper() const
Description
This method returns an exact duplicate of the AlSet wrapper object.
statusCode AlSet::create( const boolean exclusive)
Description
Does any initialization and allocation of data for an AlSet. If the 'exclusive' flag is set to TRUE, then this set is made an exclusive set (i.e., the members of this set are not allowed to be members of any other set). If it is set to FALSE, then the set is designated as "multiple" (i.e., the members of this set can be in any other non-exclusive set).
Arguments
< exclusive - state to set the exclusive flag for this set (see above)
Return codes
sSuccess - set was created
sInsufficientMemory - no memory
AlObjectType AlSet::type() const
Description
Returns the class identifier 'kSetType'.
AlSet* AlSet::asSetPtr()
Description
This virtual function returns a non-null pointer to itself, indicating that it is safe to cast to an object of this class.
const char* AlSet::name() const
Description
Returns the name of the object.
statusCode AlSet::setName( const char* newName )
Description
Changes the name of the set to a new name. If the given name is not a unique one, then a unique name is generated based on the given name and assigned to the set. In this case, a status code of sNameChangedToUniqueOne is returned. It is illegal for the new name to be NULL.
Arguments
< newName - new name of the object
Return codes
sSuccess - name was changed successfully
sFailure - name was not changed
sNameChangedToUniqueOne - name was changed to be a unique version of the given name
sInvalidArgument - 'newName' was NULL
sInvalidObject - the set was invalid
AlSet* AlSet::nextSet() const
Description
Returns a pointer to the next AlSet in the set list or NULL if there are no more sets.
AlSet* AlSet::prevSet() const
Description
Returns a pointer to the previous AlSet in the set list or NULL if there are no previous sets.
statusCode AlSet::nextSetD()
Description
This function destructively sets the wrapper to point to the next set in the set list. If the next set cannot be found, the wrapper is unaffected.
Return codes
sSuccess - the wrapper points to the next set
sFailure - there is no next set
sInvalidObject - the set is invalid
statusCode AlSet::prevSetD()
Description
This function destructively points the wrapper to the previous set in the set list. If the previous set cannot be found, the wrapper is unaffected.
Return codes
sSuccess - the wrapper points to the previous set
sFailure - there is no previous set
sInvalidObject - the set is invalid
boolean AlSet::isEmpty() const
Description
This method returns TRUE if the set is empty (ie. it has zero members). Otherwise, it returns FALSE.
boolean AlSet::isExclusive() const
Description
This method returns TRUE if the set is exclusive and FALSE if the set is "multiple".
int AlSet::numberOfMembers() const
Description
Returns the number of members belonging to this set. This method returns -1 if the set is invalid.
AlSetMember *AlSet::firstMember() const
Description
Returns a pointer to the AlSetMember that is the first member in the list of members of this set. Returns NULL if this set has no members. Note that this operation is a O(lg n) operation and is provided for convience. If you intend to perform an operation on every element in the set, use an iterator.
statusCode AlSet::applyIteratorToMembers( AlIterator* iter, int& rc )
Description
Apply the given iterator to each member of this set. See the documentation for AlIterator.
Arguments
< iter - the iterator to apply to each set member
> rc - the result of the last application of the iterator
Return codes
sSuccess - applyIteratorToMembers exited normally
sInvalidArgument - 'iter' was NULL
sFailure - applyIteratorToMembers exited abnormally
sInvalidObject - the set is invalid
statusCode AlSet::addMember( const AlSettable *setobj )
Description
Adds the given AlDagNode to this set. If this set is exclusive, then the given AlDagNode must not belong to any other set. The given AlDagNode also must not belong to any exclusive sets. If the given AlDagNode already belongs to this set, then nothing is added.
Arguments
< dagNode - the dag node to be added to the set.
Return codes
sSuccess - dag node was successfully added to the set.
sInsufficientMemory - not enough memory available.
sObjectInSet - the given dag node already belongs to this set
sObjectInAnotherSet - this set is exclusive and the given dag node already belongs to another set.
sObjectInExclusiveSet - the given dag node already belongs to an exclusive set.
sObjectAncestorInSet - an ancestor of the given dag node already belongs to this set.
sObjectDescendentInSet - a descendent of the given dag node already belongs to this set.
sInvalidArgument - 'setobj' was NULL
sInvalidObject - the set was invalid
statusCode AlSet::removeMember( AlSettable *setobj )
Description
Removes the given object from this set. If the given dag node was not found in the set, then nothing is removed.
Arguments
< setobj - the object to remove from this set.
Return codes
sSuccess - if the object was removed successfully
sInvalidArgument - setobj was NULL
sObjectNotAMember - if the object was not found in this set
sInvalidObject - the set is invalid
statusCode AlSet::removeMember( AlSetMember *setMember )
Description
Removes the given object from this set. If the given dag node was not found in the set, then nothing is removed.
Arguments
< setobj - the object to remove from this set.
Return codes
sSuccess - if the object was removed successfully
sInvalidArgument - setMember was invalid
sObjectNotAMember - if the object was not found in this set
sInvalidObject - the set is invalid
AlSetMember *AlSet::hasMember( const AlSettable *setobj ) const
Description
Returns a pointer to the AlSetMember that refers to the given AlDagNode IF the AlDagNode is a member of this set. Otherwise, returns NULL.
Arguments
< AlSettable *setobj - the object to test membership for.
statusCode AlSet::removeFromAllSets( AlSettable *setobj )
Description
Removes this object from all sets in the universe that it may be in.
Arguments
< setobj - the object to remove from all sets
Return codes
sSuccess - object was removed from all sets
aliasdocs@aw.sgi.com
Copyright © 1996, Alias|Wavefront, a Silicon Graphics Company. All rights
reserved.