Bookshelf Contents Previous Next Glossary Index Search

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;
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 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, 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

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 (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'.

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".

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

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

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 - the object was removed successfully

sInvalidArgument - setobj was NULL

sObjectNotAMember - 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 - the object was removed successfully

sInvalidArgument - setMember was invalid

sObjectNotAMember - 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 - the object was removed from all sets



Bookshelf Contents Previous Next Glossary Index Search

[email protected]
Copyright © 1998, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved.