KFbxRenamingStrategy Class Reference

#include <kfbxrenamingstrategy.h>
Inheritance diagram for KFbxRenamingStrategy:
Inheritance graph
[legend]

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 name clashing, remove illegal characters, manage namespaces, and manage backward compatibility.

Definition at line 61 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 KRenamingStrategy Clone ()
  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 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.

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.

Member Enumeration Documentation

enum EMode
  • eTO_FBX
    • eFROM_FBX
    • eMODE_COUNT

Definition at line 70 of file kfbxrenamingstrategy.h.

enum EClashType
  • eNAMECLASH_AUTO
    • eNAMECLASH_TYPE1
    • eNAMECLASH_TYPE2

Definition at line 82 of file kfbxrenamingstrategy.h.


Constructor & Destructor Documentation

KFbxRenamingStrategy ( EMode  pMod,
bool  pOnCreationRun = false  
)

Constructor.

Parameters:
pMod 
pOnCreationRun 

virtual ~KFbxRenamingStrategy (  )  [virtual]

Destructor.


Member Function Documentation

void SetClashSoverType ( EClashType  pType  ) 

Setup the strategy to perform this algorithm.

Parameters:
pType 

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

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

Sets the current scene namespace symbol.

Parameters:
pNameSpaceSymbol  namespace symbol.

Definition at line 139 of file kfbxrenamingstrategy.h.

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

Sets the wanted scene namespace symbol.

Parameters:
pNameSpaceSymbol  namespace symbol.

Definition at line 144 of file kfbxrenamingstrategy.h.

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 149 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 154 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 159 of file kfbxrenamingstrategy.h.

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