KFbxProperty Class Reference

#include <kfbxproperty.h>

Inherits KFbxPlug.

Inherited by KFbxTypedProperty, KFbxTypedProperty< bool >, KFbxTypedProperty< double >, KFbxTypedProperty< fbxReference >, KFbxTypedProperty< fbxVectorTemplate3bxVectorTemplate3< double > >, and KFbxTypedProperty< int >.

Inheritance diagram for KFbxProperty:

Inheritance graph
List of all members.

Detailed Description

Class to hold user properties.

Definition at line 68 of file kfbxproperty.h.

Property Initialization.

enum  EFlags
 Property attribute flags. More...
void ModifyFlag (EFlags pFlag, bool pValue)
 Change the attributes of the property.
bool GetFlag (EFlags pFlag)
 Get the property attribute state.

Constructor and Destructors.

static KFbxProperty Create (KFbxObject *pObject, char const *pName, KFbxDataType const &pDataType=KFbxDataType(), char const *pLabel="")
 Create a dynamic property.
static KFbxProperty Create (KFbxObject *pObject, KFbxProperty &pFromProperty)
 Create a dynamic property from an other property.
static KFbxProperty Create (KFbxProperty const &pCompoundProperty, char const *pName, KFbxDataType const &pDataType=KFbxDataType(), char const *pLabel="")
 Create a dynamic property.
KFbxProperty const & StaticInit (KFbxObject *pObject, char const *pName, KFbxDataType const &pDataType, char const *pLabel)
 Static Property Creation.
void Destroy (bool pRecursive=true, bool pDependents=false)
 Destroy a dynamic property.
 KFbxProperty ()
 Static Property Constructors.
 KFbxProperty (KFbxProperty const &pProperty)
 Copy constructor for properties.
 ~KFbxProperty ()
 Static Property destructor.

Property Identification.

KFbxDataType GetPropertyDataType () const
 Get the property datatype definition.
KString GetName () const
 Get the property internal name.
KString GetLabel (bool pReturnNameIfEmpty=true)
 Get the property label.
void SetLabel (KString pLabel)
 Set a label to the property.
KFbxObjectGetFbxObject ()
 Get the object that contains the property.
void SetUserTag (int pTag)
 Get the property datatype definition.
int GetUserTag ()
 Get the property datatype definition.

Value management.

bool Set (void const *pValue, EFbxType pValueType)
 set value function
bool Get (void *pValue, EFbxType pValueType) const
 get value function
template<class T>
bool Set (T const &pValue)
template<class T>
Get (T const *pFBX_TYPE) const

Property Limits.

Property limits are provided for convenience if some applications desire to bound the range of possible values for a given type property.

Note that these limits are meaningless for the boolean type. It is the responsibility of the calling application to implement the necessary instructions to limit the property.

void SetMinLimit (double pMin)
 Set the minimum limit value of the property.
double GetMinLimit ()
 Get the minimum limit value of the property.
void SetMaxLimit (double pMax)
 Set the maximum limit value of the property.
double GetMaxLimit ()
 Get the maximum limit value of the property.
void SetLimits (double pMin, double pMax)
 Set the minimum and maximum limit value of the property.

Enum and property list

int AddEnumValue (char const *pStringValue)
 Add a string value at the end of the list.
void InsertEnumValue (int pIndex, char const *pStringValue)
 Insert a string value at the specified index.
int GetEnumCount ()
 Get the number of elements in the list.
void SetEnumValue (int pIndex, char const *pStringValue)
 Set a string value for the specified index.
void RemoveEnumValue (int pIndex)
 Remove the string value at the specified index.
char * GetEnumValue (int pIndex)
 Get a string value for the specified index.

Array Management

KFbxProperty operator[] (int pIndex)

FCurve Management

KFCurveNodeCreateKFCurveNode (const char *pTakeName=NULL)
 Create a KFCurveNode on a take.
KFCurveNodeGetKFCurveNode (bool pCreateAsNeeded=false, const char *pTakeName=NULL)
 Get the KFCurveNode from a take.

General Property Connection and Relationship Management

int GetSrcPropertyCount ()
KFbxProperty GetSrcProperty (int pIndex=0)
KFbxProperty FindSrcProperty (const char *pName, int pStartIndex=0)
bool ConnectSrcProperty (KFbxProperty const &pProperty)
bool IsConnectedSrcProperty (KFbxProperty const &pProperty)
bool DisconnectSrcProperty (KFbxProperty const &pProperty)
int GetDstPropertyCount ()
KFbxProperty GetDstProperty (int pIndex=0)
KFbxProperty FindDstProperty (const char *pName, int pStartIndex=0)
bool ConnectDstProperty (KFbxProperty const &pProperty)
bool IsConnectedDstProperty (KFbxProperty const &pProperty)
bool DisconnectDstProperty (KFbxProperty const &pProperty)

Public Types

enum  EUserPropertyType

Public Member Functions

KFbxPropertyoperator= (KFbxProperty const &pKProperty)
 Operators.
bool CopyValue (KFbxProperty const &pProp)
 Copy value of a property.
virtual void SetUserDataPtr (void *pUserData)
 Store a pointer to an application-specific memory region.
virtual void * GetUserDataPtr ()
 Retrieve the application-specific pointer stored in this KFbxObject.


Member Enumeration Documentation

enum EFlags

Property attribute flags.

  • eNO_FLAG No special attributes set.
  • eANIMATABLE An animation FCurve can be attached to this property.
  • eUSER User defined property.
  • ePUBLISHED This property has been published for user connection ( only valid for MotionBuilder ).

Definition at line 178 of file kfbxproperty.h.


Constructor & Destructor Documentation

KFbxProperty (  ) 

Static Property Constructors.

KFbxProperty ( KFbxProperty const &  pProperty  ) 

Copy constructor for properties.

~KFbxProperty (  ) 

Static Property destructor.


Member Function Documentation

static KFbxProperty Create ( KFbxObject pObject,
char const *  pName,
KFbxDataType const &  pDataType = KFbxDataType(),
char const *  pLabel = "" 
) [static]

Create a dynamic property.

Parameters:
pObject 
pName 
pDataType 
pLabel 

static KFbxProperty Create ( KFbxObject pObject,
KFbxProperty pFromProperty 
) [static]

Create a dynamic property from an other property.

Parameters:
pObject 
pFromProperty 

static KFbxProperty Create ( KFbxProperty const &  pCompoundProperty,
char const *  pName,
KFbxDataType const &  pDataType = KFbxDataType(),
char const *  pLabel = "" 
) [static]

Create a dynamic property.

Parameters:
pCompoundProperty 
pName 
pDataType 
pLabel 

KFbxProperty const& StaticInit ( KFbxObject pObject,
char const *  pName,
KFbxDataType const &  pDataType,
char const *  pLabel 
)

Static Property Creation.

Parameters:
pObject 
pName 
pDataType 
pLabel 
Remarks:
Can only be used in the constuctor of an KFbxObject. For dynamic construction of property use the create function

Referenced by KFbxTypedProperty< fbxVectorTemplate3bxVectorTemplate3< double > >::StaticInit().

void Destroy ( bool  pRecursive = true,
bool  pDependents = false 
) [virtual]

Destroy a dynamic property.

Reimplemented from KFbxPlug.

KFbxDataType GetPropertyDataType (  )  const

Get the property datatype definition.

Returns:
The properties KFbxDataType

Referenced by KFbxStreamOptions::SetOption().

KString GetName (  )  const

Get the property internal name.

Returns:
Property internal name string.

KString GetLabel ( bool  pReturnNameIfEmpty = true  ) 

Get the property label.

Parameters:
pReturnNameIfEmpty If true, allow this method to return the internal name.
Returns:
The property label if set, or the property internal name if the pReturnNameIfEmpty flag is set to true and the label has not been defined.
Remarks:
Some applications may choose to ignore the label field and work uniquely with the internal name. Therefore, it should not be taken for granted that a label exists. Also, remember that the label does not get saved in the FBX file. It only exist while the property object is in memory.

void SetLabel ( KString  pLabel  ) 

Set a label to the property.

Parameters:
pLabel Label string.

KFbxObject* GetFbxObject (  ) 

Get the object that contains the property.

Returns:
the property object owner or null if the property is an orphan.

void SetUserTag ( int  pTag  ) 

Get the property datatype definition.

Returns:
The properties KFbxDataType

int GetUserTag (  ) 

Get the property datatype definition.

Returns:
The properties KFbxDataType

void ModifyFlag ( EFlags  pFlag,
bool  pValue 
)

Change the attributes of the property.

Parameters:
pFlag Property attribute identifier.
pValue New state.

Referenced by KFbxTypedProperty< fbxVectorTemplate3bxVectorTemplate3< double > >::StaticInit().

bool GetFlag ( EFlags  pFlag  ) 

Get the property attribute state.

Parameters:
pFlag Property attribute identifier.
Returns:
The currently set property attribute state.

KFbxProperty& operator= ( KFbxProperty const &  pKProperty  ) 

Operators.

bool CopyValue ( KFbxProperty const &  pProp  ) 

Copy value of a property.

Parameters:
pProp Property to get value from.
Returns:
true if value has been copied, false if not.

bool Set ( void const *  pValue,
EFbxType  pValueType 
)

set value function

Returns:
true if it was succesfull and type were compatible.

Referenced by KFbxSet(), KFbxStreamOptionsDxfReader::SetCreateRootNode(), KFbxStreamOptions::SetOption(), and KFbxStreamOptionsDxfReader::SetWeldVertices().

bool Get ( void *  pValue,
EFbxType  pValueType 
) const

get value function

Returns:
true if it was succesfull and type were compatible.

Referenced by KFbxGet().

void SetMinLimit ( double  pMin  ) 

Set the minimum limit value of the property.

Parameters:
pMin Minimum value allowed.

double GetMinLimit (  ) 

Get the minimum limit value of the property.

Returns:
Currently set minimum limit value.

void SetMaxLimit ( double  pMax  ) 

Set the maximum limit value of the property.

Parameters:
pMax Maximum value allowed.

double GetMaxLimit (  ) 

Get the maximum limit value of the property.

Returns:
Currently set maximum limit value.

void SetLimits ( double  pMin,
double  pMax 
)

Set the minimum and maximum limit value of the property.

Parameters:
pMin Minimum value allowed.
pMax Maximum value allowed.

int AddEnumValue ( char const *  pStringValue  ) 

Add a string value at the end of the list.

Parameters:
pStringValue Value of the string to be added.
Returns:
The index in the list where the string was added.
Remarks:
This function is only valid when the property type is eENUM. Empty strings are not allowed.

void InsertEnumValue ( int  pIndex,
char const *  pStringValue 
)

Insert a string value at the specified index.

Parameters:
pIndex Zero bound index.
pStringValue Value of the string for the specified index.
Remarks:
This function is only valid when the property type is eENUM. pIndex must be in the range [0, ListValueGetCount()]. Empty strings are not allowed.

int GetEnumCount (  ) 

Get the number of elements in the list.

Returns:
The number of elements in the list.
Remarks:
This function will return -1 if the property type is not eENUM.

void SetEnumValue ( int  pIndex,
char const *  pStringValue 
)

Set a string value for the specified index.

Parameters:
pIndex Zero bound index.
pStringValue Value of the string for the specified index.
Remarks:
This function is only valid when the property type is eENUM. The function will assign the specified string to the specified index. A string value must exists at the specified index in order to be changed. Empty strings are not allowed.

void RemoveEnumValue ( int  pIndex  ) 

Remove the string value at the specified index.

Parameters:
pIndex of the string value to be removed.

char* GetEnumValue ( int  pIndex  ) 

Get a string value for the specified index.

Parameters:
pIndex Zero bound index.
pStringValue Value of the string for the specified index.
Remarks:
This function is only valid when the property type is eENUM.

KFCurveNode* CreateKFCurveNode ( const char *  pTakeName = NULL  ) 

Create a KFCurveNode on a take.

Parameters:
pTakeName Name of the take to create the KFCurveNode on

KFCurveNode* GetKFCurveNode ( bool  pCreateAsNeeded = false,
const char *  pTakeName = NULL 
)

Get the KFCurveNode from a take.

Parameters:
pTakeName Name of the take to get the KFCurveNode from
pCreateAsNeeded Create the KFCurveNode if not found.
Returns:
Pointer to the KFCurveNode of the proprety on the given take.

virtual void SetUserDataPtr ( void *  pUserData  )  [virtual]

Store a pointer to an application-specific memory region.

Parameters:
pUserData A pointer to be carry over by the KFbxObject.
Remarks:
The FBX SDK make no use of this pointer, it's the application responsability to allocate/free the memory referenced by this pointer.

Reimplemented from KFbxPlug.

virtual void* GetUserDataPtr (  )  [virtual]

Retrieve the application-specific pointer stored in this KFbxObject.

Returns:
Return the pointer previously stored by SetUserData(), or NULL if the pointer was not set.

Reimplemented from KFbxPlug.