Public Member Functions | Public Attributes

GenericNamedSelSetList Class Reference

Search for all occurrences

Detailed Description

See also:
Class BitArray.
Description:
This class is available in release 3.0 and later only.

This class is a tool for manipulating lists of named selection sets. This class is used by modifiers such as the edit mesh, mesh select, spline select and edit patch.

All methods of this class are implemented by the system.
Data Members:
Tab<MSTR*> names;

A table of names, one for each selection set.

Tab<BitArray*> sets;

The bit array pointers for the selection sets.

Tab<DWORD> ids;

A table of Ids, one for each selection set.

#include <namesel.h>

Inheritance diagram for GenericNamedSelSetList:
Inheritance graph
[legend]

List of all members.

Public Member Functions

CoreExport  ~GenericNamedSelSetList ()
CoreExport BitArray GetSet (MSTR &name)
CoreExport BitArray GetSet (DWORD id)
CoreExport BitArray GetSetByIndex (int index)
int  Count ()
CoreExport void  AppendSet (BitArray &nset, DWORD id=0, MSTR &name=MSTR(""))
CoreExport void  InsertSet (int pos, BitArray &nset, DWORD id=0, MSTR &name=MSTR(""))
CoreExport int  InsertSet (BitArray &nset, DWORD id=0, MSTR &name=MSTR(""))
CoreExport BOOL  RemoveSet (MSTR &name)
CoreExport BOOL  RemoveSet (DWORD id)
CoreExport IOResult  Load (ILoad *iload)
CoreExport IOResult  Save (ISave *isave)
CoreExport void  SetSize (int size)
CoreExport GenericNamedSelSetList operator= (GenericNamedSelSetList &from)
CoreExport void  DeleteSetElements (BitArray &set, int m=1)
CoreExport void  DeleteSet (int i)
CoreExport BOOL  RenameSet (MSTR &oldName, MSTR &newName)
CoreExport void  Alphabetize ()
BitArray operator[] (int i)

Public Attributes

Tab< MSTR * >  names
Tab< BitArray * >  sets
Tab< DWORD >  ids

Constructor & Destructor Documentation

CoreExport ~GenericNamedSelSetList ( )
Remarks:
Destructor. The names and sets are deleted.

Member Function Documentation

CoreExport BitArray* GetSet ( MSTR name )
Remarks:
Returns a pointer to the bit array corresponding to the specified name. If the set is not found NULL is returned.
Parameters:
MSTR name

The name of the selection set to retrieve.
CoreExport BitArray* GetSet ( DWORD  id )
Remarks:
Returns a poniter to the bit array corresponding to the specified ID. If the set is not found NULL is returned.
Parameters:
DWORD id

The id of the selection set to retrieve.
CoreExport BitArray* GetSetByIndex ( int  index )
Remarks:
Returns a pointer to the bit array corresponding to the specified index in the list. If the set is not found NULL is returned.
Parameters:
int index

The zero based index of the selection set to retrieve (>= 0 and < sets.Count()).
int Count ( ) [inline]
Remarks:
Returns the number of selection sets.
{return sets.Count();}
CoreExport void AppendSet ( BitArray nset,
DWORD  id = 0,
MSTR name = MSTR("") 
)
Remarks:
Appends the named selection set data to the list of sets maintained by this class.
Parameters:
BitArray &nset

The selection set data to append.

DWORD id=0

An ID for the selection set.

MSTR name=_M("")

The name for the selection set.
CoreExport void InsertSet ( int  pos,
BitArray nset,
DWORD  id = 0,
MSTR name = MSTR("") 
)
Remarks:
Inserts the named selection set data into the list of sets maintained by this class.
Parameters:
int pos

The position in the list where this named selection set should be inserted. If pos >= Count(), AppendSet() is automatically used instead.

BitArray &nset

The selection set data to insert.

DWORD id=0

An ID for the selection set.

MSTR &name=MSTR("")

The name for the selection set.
CoreExport int InsertSet ( BitArray nset,
DWORD  id = 0,
MSTR name = MSTR("") 
)
Remarks:
This method is similar to InsertSet() above, however instead of accepting an explicit location this method inserts the new set alphabetically in the list. (Of course, this requires an alphabetized list to work properly, although there's no problem if the list is not alphabetized.)
Parameters:
BitArray &nset

The selection set data to insert.

DWORD id=0

An ID for the selection set.

MSTR &name=MSTR("")

The name for the selection set.
Returns:
The position where the set was inserted.
CoreExport BOOL RemoveSet ( MSTR name )
Remarks:
Removes the selection set whose name is passed.
Parameters:
MSTR name

The name of the selection set to remove.
Returns:
TRUE on success; otherwise FALSE.
CoreExport BOOL RemoveSet ( DWORD  id )
Remarks:
Removes the selection set whose ID is passed.
Parameters:
DWORD id

The id of the selection set to retrieve.
Returns:
TRUE on success; otherwise FALSE.
CoreExport IOResult Load ( ILoad iload )
Remarks:
This method is used internally to load the selection sets from disk.
CoreExport IOResult Save ( ISave isave )
Remarks:
This method is used internally to save the selection sets to disk.
CoreExport void SetSize ( int  size )
Remarks:
Resizes the selectin set bit arrays to the specified number of bits. The old selection set data is preserved.
Parameters:
int size

The new size for the bit arrays in bits.
CoreExport GenericNamedSelSetList& operator= ( GenericNamedSelSetList from )
Remarks:
Assignment operator. This list of sets is emptied and then copied from the list passed.
Parameters:
GenericNamedSelSetList& from

The list of selection sets to copy.
CoreExport void DeleteSetElements ( BitArray set,
int  m = 1 
)
Remarks:
This method is not currently used. What it does however, is go through all of the named selection sets and deletes array elements according to which bits are set in the given bit array. It could be used to keep the named selection set bit arrays in line with the vertex array (for example).
CoreExport void DeleteSet ( int  i )
Remarks:
Deletes the named selection set whose index is passed.
Parameters:
int i

The zero based index of the set to delete (>=0 and < sets.Count()).
CoreExport BOOL RenameSet ( MSTR oldName,
MSTR newName 
)
Remarks:
This locates the named selection set oldName and renames it to newName.
Parameters:
MSTR &oldName

The old name of the set.

MSTR &newName

The new name for the set.
Returns:
TRUE if the operation succeeded; otherwise FALSE. It will only fail if the oldName set is not present.
CoreExport void Alphabetize ( )
Remarks:
Alphabetizes the list of names.
BitArray& operator[] ( int  i ) [inline]
Remarks:
Returns a reference to the 'i-th' selection set.
Parameters:
int i

The zero based index of the selection set to return.
{return *sets[i];}

Member Data Documentation

Tab<DWORD> ids

GenericNamedSelSetList GenericNamedSelSetList GenericNamedSelSetList GenericNamedSelSetList GenericNamedSelSetList GenericNamedSelSetList GenericNamedSelSetList GenericNamedSelSetList GenericNamedSelSetList GenericNamedSelSetList
GenericNamedSelSetList GenericNamedSelSetList GenericNamedSelSetList GenericNamedSelSetList GenericNamedSelSetList GenericNamedSelSetList GenericNamedSelSetList GenericNamedSelSetList GenericNamedSelSetList GenericNamedSelSetList