Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

KFbxRenamingStrategy Class Reference

This reference page is linked to from the following overview topics: List of Python FBX classes.


Search for all occurrences

Detailed Description

The KFbxRenamingStrategy 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 KFbxSceneRenamer instead of this class to simplify the usage.

See also:
KFbxSceneRenamer

Definition at line 61 of file kfbxrenamingstrategy.h.

#include <kfbxrenamingstrategy.h>

Inheritance diagram for KFbxRenamingStrategy:
Inheritance graph
[legend]

List of all members.

Classes

struct   NameCell

Public Types

enum   EMode { eTO_FBX, eFROM_FBX, eMODE_COUNT }
 

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

More...
enum   EClashType { eNAMECLASH_AUTO, eNAMECLASH_TYPE1, eNAMECLASH_TYPE2 }
 
  • eNAMECLASH_AUTO
    • eNAMECLASH_TYPE1
    • eNAMECLASH_TYPE2
More...

Public Member Functions

  KFbxRenamingStrategy (EMode pMod, bool pOnCreationRun=false)
  Constructor.
virtual  ~KFbxRenamingStrategy ()
  Destructor.
virtual bool  Rename (KName &pName)
  Rename a name if necessary.
virtual void  Clear ()
  Resets internal state regarding assigned names.
virtual KRenamingStrategy Clone ()
  Create a dynamic renaming strategy instance of the same type as the child class.
void  SetClashSoverType (EClashType pType)
  Setup the strategy to perform this algorithm.
virtual char *  GetNameSpace ()
  Get the namespace of the last renamed object.
virtual void  SetInNameSpaceSymbol (KString pNameSpaceSymbol)
  Sets the current scene namespace symbol.
virtual void  SetOutNameSpaceSymbol (KString pNameSpaceSymbol)
  Sets the wanted scene namespace symbol.
virtual void  SetCaseSensibility (bool pIsCaseSensitive)
  Sets case sensitivity for name clashing.
virtual void  SetReplaceNonAlphaNum (bool pReplaceNonAlphaNum)
  Sets the flag for character acceptance during renaming.
virtual void  SetFirstNotNum (bool pFirstNotNum)
  Sets the flag for first character acceptance during renaming.
virtual bool  RenameUnparentNameSpace (KFbxNode *pNode, bool pIsRoot=false)
  Recursively renames all the unparented namespaced objects (Prefix mode) starting from this node.
virtual bool  RemoveImportNameSpaceClash (KFbxNode *pNode)
  Recursively removes all the unparented namespaced "key" starting from this node.
virtual void  GetParentsNameSpaceList (KFbxNode *pNode, KArrayTemplate< KString * > &pNameSpaceList)
virtual bool  PropagateNameSpaceChange (KFbxNode *pNode, KString OldNS, KString NewNS)

Static Public Member Functions

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

Protected Member Functions

virtual bool  RenameToFBX (KName &pName)
virtual bool  RenameFromFBX (KName &pName)
virtual KString ReplaceNonAlphaNum (KString &pName, char *pReplace, bool pIgnoreNameSpace)

Protected Attributes

EMode  mMode
EClashType  mType
KCharPtrSet  mStringNameArray
KArrayTemplate< NameCell * >  mExistingNsList
bool  mOnCreationRun
bool  mCaseSensitive
bool  mReplaceNonAlphaNum
bool  mFirstNotNum
KString  mNameSpace
KString  mInNameSpaceSymbol
KString  mOutNameSpaceSymbol

Member Enumeration Documentation

enum EMode

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

  • eTO_FBX Convert to FBX format from another format.
  • eFROM_FBX Convert from FBX format to another format.
  • eMODE_COUNT
Enumerator:
eTO_FBX 
eFROM_FBX 
eMODE_COUNT 

Definition at line 69 of file kfbxrenamingstrategy.h.

  • eNAMECLASH_AUTO
    • eNAMECLASH_TYPE1
    • eNAMECLASH_TYPE2
Enumerator:
eNAMECLASH_AUTO 
eNAMECLASH_TYPE1 
eNAMECLASH_TYPE2 

Definition at line 115 of file kfbxrenamingstrategy.h.


Constructor & Destructor Documentation

KFbxRenamingStrategy ( EMode  pMod,
bool  pOnCreationRun = false 
)

Constructor.

Parameters:
pMod The mode describing the convention direction, from FBX format or to FBX format.
pOnCreationRun
virtual ~KFbxRenamingStrategy ( ) [virtual]

Destructor.


Member Function Documentation

virtual bool Rename ( KName pName ) [virtual]

Rename a name if necessary.

Parameters:
pName The name to be renamed.
Returns:
Return true on success, false otherwise.

Implements KRenamingStrategy.

virtual void Clear ( ) [virtual]

Resets internal state regarding assigned names.

Implements KRenamingStrategy.

virtual KRenamingStrategy* Clone ( ) [virtual]

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

Returns:
New instance.

Implements KRenamingStrategy.

void SetClashSoverType ( EClashType  pType )

Setup the strategy to perform this algorithm.

Parameters:
pType
static char* NoPrefixName ( char const *  pName ) [static]

Returns a name with its prefix removed.

Parameters:
pName A name containing a prefix.
Returns:
The part of pName following the "::"
static char* NoPrefixName ( KString pName ) [static]

Returns a name with its prefix removed.

Parameters:
pName A name containing a prefix.
Returns:
The part of pName following the "::"
virtual char* GetNameSpace ( ) [inline, virtual]

Get the namespace of the last renamed object.

Returns:
Char pointer to the namespace.

Definition at line 142 of file kfbxrenamingstrategy.h.

{ return mNameSpace.Buffer(); } 
virtual void SetInNameSpaceSymbol ( KString  pNameSpaceSymbol ) [inline, virtual]

Sets the current scene namespace symbol.

Parameters:
pNameSpaceSymbol namespace symbol.

Definition at line 147 of file kfbxrenamingstrategy.h.

{mInNameSpaceSymbol = pNameSpaceSymbol;}
virtual void SetOutNameSpaceSymbol ( KString  pNameSpaceSymbol ) [inline, virtual]

Sets the wanted scene namespace symbol.

Parameters:
pNameSpaceSymbol namespace symbol.

Definition at line 152 of file kfbxrenamingstrategy.h.

{mOutNameSpaceSymbol = pNameSpaceSymbol;}    
virtual void SetCaseSensibility ( bool  pIsCaseSensitive ) [inline, virtual]

Sets case sensitivity for name clashing.

Parameters:
pIsCaseSensitive Set to true to make the name clashing case sensitive.

Definition at line 157 of file kfbxrenamingstrategy.h.

{mCaseSensitive = pIsCaseSensitive ;}
virtual void SetReplaceNonAlphaNum ( bool  pReplaceNonAlphaNum ) [inline, virtual]

Sets the flag for character acceptance during renaming.

Parameters:
pReplaceNonAlphaNum Set to true to replace illegal characters with an underscore ("_").

Definition at line 162 of file kfbxrenamingstrategy.h.

{mReplaceNonAlphaNum = pReplaceNonAlphaNum;}
virtual void SetFirstNotNum ( bool  pFirstNotNum ) [inline, virtual]

Sets the flag for first character acceptance during renaming.

Parameters:
pFirstNotNum Set to true to add an underscore to the name if the first character is a number.

Definition at line 167 of file kfbxrenamingstrategy.h.

{mFirstNotNum = pFirstNotNum;}
virtual bool RenameUnparentNameSpace ( KFbxNode pNode,
bool  pIsRoot = false 
) [virtual]

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

Parameters:
pNode Parent node.
pIsRoot The root node.
Remarks:
This function adds "_NSclash" when it encounters an unparented namespaced object.
virtual bool RemoveImportNameSpaceClash ( KFbxNode pNode ) [virtual]

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

Parameters:
pNode Parent node.
Remarks:
This function removes "_NSclash" when encountered. This is the opposite from RenameUnparentNameSpace.
virtual void GetParentsNameSpaceList ( KFbxNode pNode,
KArrayTemplate< KString * > &  pNameSpaceList 
) [virtual]
virtual bool PropagateNameSpaceChange ( KFbxNode pNode,
KString  OldNS,
KString  NewNS 
) [virtual]
virtual bool RenameToFBX ( KName pName ) [protected, virtual]
virtual bool RenameFromFBX ( KName pName ) [protected, virtual]
virtual KString& ReplaceNonAlphaNum ( KString pName,
char *  pReplace,
bool  pIgnoreNameSpace 
) [protected, virtual]

Member Data Documentation

EMode mMode [protected]
EClashType mType [protected]
bool mOnCreationRun [protected]
bool mCaseSensitive [protected]
bool mReplaceNonAlphaNum [protected]
bool mFirstNotNum [protected]
KString mNameSpace [protected]

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

KFbxRenamingStrategy KFbxRenamingStrategy KFbxRenamingStrategy KFbxRenamingStrategy KFbxRenamingStrategy KFbxRenamingStrategy KFbxRenamingStrategy KFbxRenamingStrategy KFbxRenamingStrategy KFbxRenamingStrategy
KFbxRenamingStrategy KFbxRenamingStrategy KFbxRenamingStrategy KFbxRenamingStrategy KFbxRenamingStrategy KFbxRenamingStrategy KFbxRenamingStrategy KFbxRenamingStrategy KFbxRenamingStrategy KFbxRenamingStrategy