This reference page is linked to from the following overview topics: Naming Scene Entities.
Creates unique names.
Use this class to generate unique names for various scene entities such as materials, layers, etc. The generated names consist of a root string ("Layer") and a numeric suffix (001, 002, etc), as in "Layer001", "Layer002", etc. This class is most useful when client code has a list of root strings that can be used to initialize the name maker before asking it to create new names. Although this class can be used to create node names that are unique within the current scene, method Interface::MakeNameUnique() delivers equivalent results to this class with identical performance. Clients can use the Interface::NewNameMaker() factory method to create an instance of this class. All methods of this class are implemented by the system.
#include <maxapi.h>
Public Member Functions |
|
virtual void | MakeUniqueName (MSTR &name)=0 |
Creates a unique version of a given name
Note that gaps in the numeric suffixes are not filled in. |
|
virtual void | AddName (MSTR &name)=0 |
Sets the root name used by the name maker
for generating new unique names. |
|
virtual BOOL | NameExists (MSTR &name)=0 |
Verifies if a root name exists already.
|
|
virtual | ~NameMaker () |
virtual ~NameMaker | ( | ) | [inline, virtual] |
{}
virtual void MakeUniqueName | ( | MSTR & | name | ) | [pure virtual] |
Creates a unique version of a given name Note that gaps in the numeric suffixes are not filled in.
For example if "name001" and "name003" already exist, the next unique name that has the root "name" will be "name004" as opposed to "name002". The number of digits used in the numeric suffix can be set via Interface13::SetNameSuffixLength().
[in,out] | name | The name that is to be made unique |
virtual void AddName | ( | MSTR & | name | ) | [pure virtual] |
Sets the root name used by the name maker for generating new unique names.
[in] | name | The name to be added. Numeric suffixes are stripped off before the name is added to the name maker. |
virtual BOOL NameExists | ( | MSTR & | name | ) | [pure virtual] |
Verifies if a root name exists already.
name | [in] name The root name to look for. |