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 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;
statusCode	setExclusive( const boolean on ); int	numberOfMembers() const; 	*firstMember() const; statusCode	applyIteratorToMembers( AlIterator* iter, int& );

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. 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 a 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, and AlSurfaceCV.

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

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

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 (that is, 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" (that is, 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’.

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

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

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

Returns TRUE if the set is empty (ie. it has zero members). Otherwise, it returns FALSE.

boolean AlSet::isExclusive() const

Description

Returns TRUE if the set is exclusive and FALSE if the set is "multiple".

statusCode AlSet::setExclusive( const boolean exclusive )

Description:

Makes the current set exclusive or multiple. If ’exclusive’ is TRUE then the set is made exclusive.

Arguments

< exclusive - TRUE or FALSE

Return Codes

sSuccess - the set has been made exclusive

sFailure - the method failed

sInvalidObject - the set is invalid

sInvalidParameter - attempting to make a set exclusive that has members in another set

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 convenience. If you intend to do an operation on every element in the set, use an iterator.

statusCode AlSet::applyIteratorToMembers( AlIterator* iter, int& rc )

Description

Applies 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