FbxRenamingStrategy Class Reference

#include <fbxrenamingstrategy.h>

Class Description

The FbxRenamingStrategy object can be set to rename all the objects in a scene.

It can remove name clashing, remove illegal characters, manage namespaces and manage backward compatibility. It is better to choose FbxSceneRenamer instead of this class to simplify the usage.

See also
FbxSceneRenamer

Definition at line 114 of file fbxrenamingstrategy.h.

+ Inheritance diagram for FbxRenamingStrategy:

Public Types

enum  EDirection { eToFBX, eFromFBX }
 The mode describing the convention direction, from FBX format or to FBX format. More...
 
enum  EClashType { eNameClashAuto, eNameClashType1, eNameClashType2 }
 

Public Member Functions

 FbxRenamingStrategy (EDirection pMod, bool pOnCreationRun=false)
 Constructor. More...
 
virtual ~FbxRenamingStrategy ()
 Destructor. More...
 
virtual bool Rename (FbxNameHandler &pName)
 Rename a name if necessary. More...
 
virtual void Clear ()
 Resets internal state regarding assigned names. More...
 
virtual FbxRenamingStrategyInterfaceClone ()
 Create a dynamic renaming strategy instance of the same type as the child class. More...
 
void SetClashSoverType (EClashType pType)
 Setup the strategy to perform this algorithm. More...
 
virtual char * GetNameSpace ()
 Get the namespace of the last renamed object. More...
 
virtual void SetInNameSpaceSymbol (FbxString pNameSpaceSymbol)
 Sets the current scene namespace symbol. More...
 
virtual void SetOutNameSpaceSymbol (FbxString pNameSpaceSymbol)
 Sets the wanted scene namespace symbol. More...
 
virtual void SetCaseSensibility (bool pIsCaseSensitive)
 Sets case sensitivity for name clashing. More...
 
virtual void SetReplaceNonAlphaNum (bool pReplaceNonAlphaNum)
 Sets the flag for character acceptance during renaming. More...
 
virtual void SetFirstNotNum (bool pFirstNotNum)
 Sets the flag for first character acceptance during renaming. More...
 
virtual bool RenameUnparentNameSpace (FbxNode *pNode, bool pIsRoot=false)
 Recursively renames all the unparented namespaced objects (Prefix mode) starting from this node. More...
 
virtual bool RemoveImportNameSpaceClash (FbxNode *pNode)
 Recursively removes all the unparented namespaced "key" starting from this node. More...
 
virtual void GetParentsNameSpaceList (FbxNode *pNode, FbxArray< FbxString * > &pNameSpaceList)
 Recursively get all the namespace starting from this node's parent. More...
 
virtual bool PropagateNameSpaceChange (FbxNode *pNode, FbxString OldNS, FbxString NewNS)
 Recursively replace the namespace starting from this node to its children. More...
 
- Public Member Functions inherited from FbxRenamingStrategyInterface
 FbxRenamingStrategyInterface ()
 Constructor. More...
 
virtual ~FbxRenamingStrategyInterface ()
 Destructor. More...
 

Static Public Member Functions

static char * NoPrefixName (const char *pName)
 Returns a name with its prefix removed. More...
 
static char * NoPrefixName (FbxString &pName)
 Returns a name with its prefix removed. More...
 

Member Enumeration Documentation

enum EDirection

The mode describing the convention direction, from FBX format or to FBX format.

  • eToFBX Convert to FBX format from another format.
  • eFromFBX Convert from FBX format to another format.
Enumerator
eToFBX 
eFromFBX 

Definition at line 121 of file fbxrenamingstrategy.h.

enum EClashType
  • eNameClashAuto
  • eNameClashType1
  • eNameClashType2
Enumerator
eNameClashAuto 
eNameClashType1 
eNameClashType2 

Definition at line 155 of file fbxrenamingstrategy.h.

Constructor & Destructor Documentation

FbxRenamingStrategy ( EDirection  pMod,
bool  pOnCreationRun = false 
)

Constructor.

Parameters
pModThe mode describing the convention direction, from FBX format or to FBX format.
pOnCreationRun
virtual ~FbxRenamingStrategy ( )
virtual

Destructor.

Member Function Documentation

virtual bool Rename ( FbxNameHandler pName)
virtual

Rename a name if necessary.

Parameters
pNameThe name to be renamed.
Returns
Return true on success, false otherwise.

Implements FbxRenamingStrategyInterface.

virtual void Clear ( )
virtual

Resets internal state regarding assigned names.

Implements FbxRenamingStrategyInterface.

virtual FbxRenamingStrategyInterface* Clone ( )
virtual

Create a dynamic renaming strategy instance of the same type as the child class.

Returns
New instance.

Implements FbxRenamingStrategyInterface.

void SetClashSoverType ( EClashType  pType)

Setup the strategy to perform this algorithm.

Parameters
pType
static char* NoPrefixName ( const char *  pName)
static

Returns a name with its prefix removed.

Parameters
pNameA name containing a prefix.
Returns
The part of pName following the "::"
static char* NoPrefixName ( FbxString pName)
static

Returns a name with its prefix removed.

Parameters
pNameA name containing a prefix.
Returns
The part of pName following the "::"
virtual char* GetNameSpace ( )
inlinevirtual

Get the namespace of the last renamed object.

Returns
Char pointer to the namespace.

Definition at line 182 of file fbxrenamingstrategy.h.

182 { return mNameSpace.Buffer(); }
virtual void SetInNameSpaceSymbol ( FbxString  pNameSpaceSymbol)
inlinevirtual

Sets the current scene namespace symbol.

Parameters
pNameSpaceSymbolnamespace symbol.

Definition at line 187 of file fbxrenamingstrategy.h.

187 {mInNameSpaceSymbol = pNameSpaceSymbol;}
virtual void SetOutNameSpaceSymbol ( FbxString  pNameSpaceSymbol)
inlinevirtual

Sets the wanted scene namespace symbol.

Parameters
pNameSpaceSymbolnamespace symbol.

Definition at line 192 of file fbxrenamingstrategy.h.

192 {mOutNameSpaceSymbol = pNameSpaceSymbol;}
virtual void SetCaseSensibility ( bool  pIsCaseSensitive)
inlinevirtual

Sets case sensitivity for name clashing.

Parameters
pIsCaseSensitiveSet to true to make the name clashing case sensitive.

Definition at line 197 of file fbxrenamingstrategy.h.

197 {mCaseSensitive = pIsCaseSensitive ;}
virtual void SetReplaceNonAlphaNum ( bool  pReplaceNonAlphaNum)
inlinevirtual

Sets the flag for character acceptance during renaming.

Parameters
pReplaceNonAlphaNumSet to true to replace illegal characters with an underscore ("_").

Definition at line 202 of file fbxrenamingstrategy.h.

202 {mReplaceNonAlphaNum = pReplaceNonAlphaNum;}
virtual void SetFirstNotNum ( bool  pFirstNotNum)
inlinevirtual

Sets the flag for first character acceptance during renaming.

Parameters
pFirstNotNumSet to true to add an underscore to the name if the first character is a number.

Definition at line 207 of file fbxrenamingstrategy.h.

207 {mFirstNotNum = pFirstNotNum;}
virtual bool RenameUnparentNameSpace ( FbxNode pNode,
bool  pIsRoot = false 
)
virtual

Recursively renames all the unparented namespaced objects (Prefix mode) starting from this node.

Parameters
pNodeParent node.
pIsRootThe root node.
Remarks
This function adds "_NSclash" when it encounters an unparented namespaced object.
virtual bool RemoveImportNameSpaceClash ( FbxNode pNode)
virtual

Recursively removes all the unparented namespaced "key" starting from this node.

Parameters
pNodeParent node.
Remarks
This function removes "_NSclash" when encountered. This is the opposite from RenameUnparentNameSpace.
virtual void GetParentsNameSpaceList ( FbxNode pNode,
FbxArray< FbxString * > &  pNameSpaceList 
)
virtual

Recursively get all the namespace starting from this node's parent.

Parameters
pNodeParent node.
pNameSpaceListoutput the namespace list from pNode's parent to the root node.
virtual bool PropagateNameSpaceChange ( FbxNode pNode,
FbxString  OldNS,
FbxString  NewNS 
)
virtual

Recursively replace the namespace starting from this node to its children.

Parameters
pNodeCurrent node.
OldNSThe old namespace to be replaced with the NewNs.
NewNSThe new namespace to replace OldNs.

The documentation for this class was generated from the following file: