KFbxRenamingStrategy Class Reference

#include <kfbxrenamingstrategy.h>

Inherits KRenamingStrategy.

Inheritance diagram for KFbxRenamingStrategy:

Inheritance graph
List of all members.

Detailed Description

This class contains the description of the FBX renaming strategy.

The KFbxRenamingStrategy object can be setup to rename all the objects in a scene. It can remove nameclashing, remove illegal characters, manage namespaces, and manage backward compatibility.

Definition at line 65 of file kfbxrenamingstrategy.h.

Public Types

enum  EMode
 
  • eTO_FBX
    • eFROM_FBX
    • eMODE_COUNT
More...
enum  EClashType
 
  • eNAMECLASH_AUTO
    • eNAMECLASH_TYPE1
    • eNAMECLASH_TYPE2
More...

Public Member Functions

 KFbxRenamingStrategy (EMode pMod, bool pOnCreationRun=false)
 Constructor.
virtual ~KFbxRenamingStrategy ()
 Destructor.
void SetClashSoverType (EClashType pType)
 Setup the strategy to perform this algorithm.
virtual bool Rename (KName &pName)
 Rename.
virtual void Clear ()
 Empty all memories about given names.
virtual KRenamingStrategyClone ()
 Spawn mechanism.
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 nameclashing.
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)
 Recusively renames all the unparented namespaced objects (Prefix mode) starting from this node.
virtual bool RemoveImportNameSpaceClash (KFbxNode *pNode)
 Recusively removes all the unparented namespaced "key" starting from this node.

Static Public Member Functions

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


Member Enumeration Documentation

enum EMode

  • eTO_FBX
    • eFROM_FBX
    • eMODE_COUNT

Definition at line 74 of file kfbxrenamingstrategy.h.

enum EClashType

  • eNAMECLASH_AUTO
    • eNAMECLASH_TYPE1
    • eNAMECLASH_TYPE2

Definition at line 86 of file kfbxrenamingstrategy.h.


Constructor & Destructor Documentation

KFbxRenamingStrategy ( EMode  pMod,
bool  pOnCreationRun = false 
)

Constructor.

virtual ~KFbxRenamingStrategy (  )  [virtual]

Destructor.


Member Function Documentation

void SetClashSoverType ( EClashType  pType  ) 

Setup the strategy to perform this algorithm.

virtual bool Rename ( KName pName  )  [virtual]

Rename.

Parameters:
pName New name.
Returns:
true if successful, false otherwise.

Implements KRenamingStrategy.

virtual void Clear (  )  [virtual]

Empty all memories about given names.

Implements KRenamingStrategy.

virtual KRenamingStrategy* Clone (  )  [virtual]

Spawn mechanism.

Create a dynamic renaming strategy instance of the same type.

Returns:
new KRenamingStrategy

Implements KRenamingStrategy.

static char* NoPrefixName ( char const *  pName  )  [static]

Returns a name with its prefix removed.

Parameters:
pName A name containning 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 128 of file kfbxrenamingstrategy.h.

virtual void SetInNameSpaceSymbol ( KString  pNameSpaceSymbol  )  [inline, virtual]

Sets the current scene namespace symbol.

Parameters:
pNameSpaceSymbol namespace symbol.

Definition at line 133 of file kfbxrenamingstrategy.h.

virtual void SetOutNameSpaceSymbol ( KString  pNameSpaceSymbol  )  [inline, virtual]

Sets the wanted scene namespace symbol.

Parameters:
pNameSpaceSymbol namespace symbol.

Definition at line 138 of file kfbxrenamingstrategy.h.

virtual void SetCaseSensibility ( bool  pIsCaseSensitive  )  [inline, virtual]

Sets case sensitivity for nameclashing.

Parameters:
pIsCaseSensitive Set to true to make the nameclashing case sensitive.

Definition at line 143 of file kfbxrenamingstrategy.h.

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 148 of file kfbxrenamingstrategy.h.

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 153 of file kfbxrenamingstrategy.h.

virtual bool RenameUnparentNameSpace ( KFbxNode pNode,
bool  pIsRoot = false 
) [virtual]

Recusively 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]

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