KFbxGeometry Class Reference

#include <kfbxgeometry.h>
Inheritance diagram for KFbxGeometry:
Inheritance graph
[legend]

List of all members.


Detailed Description

The base class of geometric objects that support control point deformations (e.g.

KFbxMesh, KFbxNurb, and KFbxPatch). The KFbxGeometry provides support for the following kinds of deformations.

Most of the methods of KFbxGeometry are wrappers to simplify the access/manipulation of the connections to the deformers. For example, calling the GetDeformerCount() method is the same thing as calling:
 geometry.GetSrcObjectCount(KFbxDeformer::ClassId)

The shapes data manipulation is some what more complex than the other deformations and it is strongly advised to use the interfaces in this class rather than trying to directly manipulate the connections.

Definition at line 83 of file kfbxgeometry.h.


Error Management

enum   EError {
   eINDEX_OUT_OF_RANGE,
   eNULL_PARAMETER,
   eSHAPE_ALREADY_ADDED,
   eSHAPE_INVALID_NAME,
   eSHAPE_NAME_CLASH,
   eSHAPE_NO_CURVE_FOUND,
   eUNKNOWN_ERROR,
   eERROR_COUNT
}
  Error identifiers. More...
KError GetError ()
  Retrieves the error object.
EError  GetLastErrorID () const
  Returns the last error code.
const char *  GetLastErrorString () const
  Returns the last error string.

Public Types

enum   ESurfaceMode {
   eRAW,
   eLOW_NO_NORMALS,
   eLOW,
   eHIGH_NO_NORMALS,
   eHIGH
}
  NURBS and Patches surface modes. More...

Public Member Functions

virtual EAttributeType  GetAttributeType () const
  Returns the node attribute type.
virtual KFbxObject Clone (KFbxObject *pContainer, KFbxObject::ECloneType pCloneType) const
  Creates a clone of this object.
Deformer Management
int  AddDeformer (KFbxDeformer *pDeformer)
  Adds a deformer to this geometry (as mentioned in the description of this class, adding a deformer is a synonym for "connect a deformer").
KFbxDeformer RemoveDeformer (int pIndex)
  Remove a deformer.
int  GetDeformerCount () const
  Returns the number of deformers.
KFbxDeformer GetDeformer (int pIndex) const
  Returns the deformer at the specified index.
int  GetDeformerCount (KFbxDeformer::EDeformerType pType) const
  Returns the number of deformers of a specified type.
KFbxDeformer GetDeformer (int pIndex, KFbxDeformer::EDeformerType pType) const
  Returns the deformer of a specified type at the specified index.
Geometry Weighted Map(s) Management
KFbxGeometryWeightedMap GetSourceGeometryWeightedMap ()
  Returns the source geometry weighted map that is connected to this geometry.
int  GetDestinationGeometryWeightedMapCount () const
  Returns the number of destination geometry weighted map(s) that are connected to this geometry.
KFbxGeometryWeightedMap GetDestinationGeometryWeightedMap (int pIndex)
  Returns the destination geometry weighted map at a specified index.
Shape(s) Management
virtual int  AddShape (KFbxShape *pShape, char const *pShapeName)
  Add a shape and the shape's associated name to this geometry.
virtual void  ClearShape ()
  Removes all the shapes without destroying them.
virtual int  GetShapeCount () const
  Returns the number of shapes.
virtual KFbxShape GetShape (int pIndex)
  Returns the shape found at the specified index.
virtual KFbxShape const *  GetShape (int pIndex) const
  Returns the shape found at the specified index.
virtual char const *  GetShapeName (int pIndex) const
  Returns the shape name found at the specified index.
virtual K_DEPRECATED KFCurve GetShapeChannel (char const *pShapeName, bool pCreateAsNeeded=false, char const *pTakeName=NULL)
  Get the shape animation curve.
virtual KFbxAnimCurve GetShapeChannel (char const *pShapeName, KFbxAnimLayer *pLayer, bool pCreateAsNeeded=false)
  Get the shape animation curve.
virtual KFCurve GetShapeChannel (int pIndex, bool pCreateAsNeeded=false, char const *pTakeName=NULL)
  Get the shape animation curve.
virtual KFbxAnimCurve GetShapeChannel (int pIndex, KFbxAnimLayer *pLayer, bool pCreateAsNeeded=false)
  Get the shape animation curve.
Pivot Management
The geometry pivot is used to specify additional translation, rotation, and scaling information applied to all control points when the model is exported.

KFbxXMatrix GetPivot (KFbxXMatrix &pXMatrix) const
  Returns the pivot matrix.
void  SetPivot (KFbxXMatrix &pXMatrix)
  Sets the pivot matrix.
void  ApplyPivot ()
  Applies the pivot matrix to all vertices/normals of the geometry.
Default Animation Values
These functions provides direct access to default animation values that are specific to a geometry.

These functions only work if the geometry has been associated with a node.

void  SetDefaultShape (int pIndex, double pPercent)
  Sets the default deformation for a specified shape.
void  SetDefaultShape (char const *pShapeName, double pPercent)
  Sets the default deformation for a specified shape.
double  GetDefaultShape (int pIndex) const
  Returns the default deformation value for the specified shape.
double  GetDefaultShape (char const *pShapeName) const
  Returns the default deformation value for the specified shape.

Member Enumeration Documentation

NURBS and Patches surface modes.

This information is never directly used inside the FBX SDK. Applications can use these values if they wish to carry the "rendering" details of the NURBS and Patches. The FBX SDK guarantee that the value (member of the KFbxNurb, KFbxNurbSurface and KFbxPatch classes) is stored to FBX files and retrieved from them.

Remarks:
The enum has been defined in this class to avoid symbols duplication.
Enumerator:
eRAW 
eLOW_NO_NORMALS 
eLOW 
eHIGH_NO_NORMALS 
eHIGH 

Definition at line 270 of file kfbxgeometry.h.

enum EError

Error identifiers.

Enumerator:
eINDEX_OUT_OF_RANGE  The index used to access an item is out of range.
eNULL_PARAMETER  Requested pointer to shape object is NULL.
eSHAPE_ALREADY_ADDED  The specified shape has already been added to this object.
eSHAPE_INVALID_NAME  The provided name argument is empty.
eSHAPE_NAME_CLASH  The provided name is already used by another shape.
eSHAPE_NO_CURVE_FOUND  The shape's animation curve could not be found.
eUNKNOWN_ERROR  Generic error message.
eERROR_COUNT 

Definition at line 359 of file kfbxgeometry.h.


Member Function Documentation

virtual EAttributeType GetAttributeType (  )  const [virtual]

Returns the node attribute type.

This method is derived in the more high level classes (KFbxMesh, KFbxNurbs, etc...) and returns the actual type of the geometry object.

Returns:
eUNIDENTIFIED

Reimplemented from KFbxLayerContainer.

Reimplemented in KFbxMesh, KFbxNurb, KFbxNurbsCurve, KFbxNurbsSurface, KFbxPatch, KFbxSubdiv, KFbxBoundary, and KFbxTrimNurbsSurface.

int AddDeformer ( KFbxDeformer pDeformer  ) 

Adds a deformer to this geometry (as mentioned in the description of this class, adding a deformer is a synonym for "connect a deformer").

Parameters:
pDeformer  Pointer to the deformer to be added.
Returns:
Index of the added deformer.

KFbxDeformer* RemoveDeformer ( int  pIndex  ) 

Remove a deformer.

Parameters:
pIndex  Index of deformer to remove.
Returns:
Pointer to the removed deformer (or NULL if pIndex is out of range). If pIndex is out of range KFbxGeometry::GetLastErrorID() returns eINDEX_OUT_OF_RANGE.

int GetDeformerCount (  )  const

Returns the number of deformers.

Returns:
The number of deformers that have been connected to this geometry.

KFbxDeformer* GetDeformer ( int  pIndex  )  const

Returns the deformer at the specified index.

Parameters:
pIndex  The specified deformer index.
Returns:
Pointer to the deformer (or NULL if pIndex is out of range). If pIndex is out of range, KFbxGeometry::GetLastErrorID() returns eINDEX_OUT_OF_RANGE.

int GetDeformerCount ( KFbxDeformer::EDeformerType  pType  )  const

Returns the number of deformers of a specified type.

Parameters:
pType  The specified deformer type.
Returns:
The number of deformers of the specified type.

KFbxDeformer* GetDeformer ( int  pIndex,
KFbxDeformer::EDeformerType  pType  
) const

Returns the deformer of a specified type at the specified index.

Parameters:
pIndex  The specified deformer index.
pType  The specified deformer type.
Returns:
Pointer to the deformer (or NULL if pIndex is out of range). If pIndex is out of range, KFbxGeometry::GetLastErrorID() returns eINDEX_OUT_OF_RANGE.

KFbxGeometryWeightedMap* GetSourceGeometryWeightedMap (  ) 

Returns the source geometry weighted map that is connected to this geometry.

Returns:
Pointer to the source geometry weighted map that is connected to this geometry if any.

int GetDestinationGeometryWeightedMapCount (  )  const

Returns the number of destination geometry weighted map(s) that are connected to this geometry.

Returns:
The number of destination geometry weighted map(s) that are connected to this geometry.

KFbxGeometryWeightedMap* GetDestinationGeometryWeightedMap ( int  pIndex  ) 

Returns the destination geometry weighted map at a specified index.

Parameters:
pIndex  The specified index.
Returns:
Pointer to the destination geometry weighted map at the specified index (if any).

virtual int AddShape ( KFbxShape pShape,
char const *  pShapeName  
) [virtual]

Add a shape and the shape's associated name to this geometry.

Parameters:
pShape  Pointer to the shape object to be added.
pShapeName  Name of the shape.
Returns:
Index of the added shape, -1 if operation fails. If the operation fails, KFbxGeometry::GetLastErrorID() can return one of the following:
  • eNULL_PARAMETER: Pointer to shape is NULL.
  • eSHAPE_ALREADY_ADDED: Shape has already been added.
  • eSHAPE_INVALID_NAME: The name provided is empty.
  • eSHAPE_NAME_CLASH: The name provided is already used by another shape.
Remarks:
The name provided is stripped from the surrounding white space before it is compared to the other shape names. It is recommended not to prefix the shape name with its enclosing node name because MotionBuilder is known to strip this prefix and not restore it.

Reimplemented in KFbxTrimNurbsSurface.

virtual void ClearShape (  )  [virtual]

Removes all the shapes without destroying them.

If shapes aren't explicitly destroyed before calling this function, they will be destroyed along with the SDK manager that created them.

Reimplemented in KFbxTrimNurbsSurface.

virtual int GetShapeCount (  )  const [virtual]

Returns the number of shapes.

Returns:
The number of shapes that have been added to this geometry.

Reimplemented in KFbxTrimNurbsSurface.

virtual KFbxShape* GetShape ( int  pIndex  )  [virtual]

Returns the shape found at the specified index.

Parameters:
pIndex  The specified index.
Returns:
Pointer to the shape (or NULL if pIndex is out of range). If pIndex is out of range, KFbxGeometry::GetLastErrorID() returns eINDEX_OUT_OF_RANGE.

Reimplemented in KFbxTrimNurbsSurface.

virtual KFbxShape const* GetShape ( int  pIndex  )  const [virtual]

Returns the shape found at the specified index.

Parameters:
pIndex  The specified index.
Returns:
Pointer to the shape (or NULL if pIndex is out of range). If pIndex is out of range, KFbxGeometry::GetLastErrorID() returns eINDEX_OUT_OF_RANGE.

Reimplemented in KFbxTrimNurbsSurface.

virtual char const* GetShapeName ( int  pIndex  )  const [virtual]

Returns the shape name found at the specified index.

Parameters:
pIndex  The specified index.
Returns:
Shape name (or NULL if pIndex is out of range). If pIndex is out of range, KFbxGeometry::GetLastErrorID() returns eINDEX_OUT_OF_RANGE.

Reimplemented in KFbxTrimNurbsSurface.

virtual K_DEPRECATED KFCurve* GetShapeChannel ( char const *  pShapeName,
bool  pCreateAsNeeded = false,
char const *  pTakeName = NULL  
) [virtual]

Get the shape animation curve.

This method is deprecated and should not be used anymore. Instead call the equivalent using the KFbxAnimLayer.

Parameters:
pShapeName 
pCreateAsNeeded 
pTakeName 

virtual KFbxAnimCurve* GetShapeChannel ( char const *  pShapeName,
KFbxAnimLayer pLayer,
bool  pCreateAsNeeded = false  
) [virtual]

Get the shape animation curve.

The shape channel is an animatable property with a value range from 0 to 100 (with 100 being full shape deformation). The default value is 0.

Parameters:
pShapeName  The shape name.
pCreateAsNeeded  If true, creates the animation curve if it is not already present.
pLayer  The animation layer from which we want to get the requested animation curve.
Returns:
Animation curve (or NULL if an error occurred). If an error occurs, KFbxGeometry::GetLastErrorID() returns one of the following:
  • eINDEX_OUT_OF_RANGE: Shape index is out of range.
  • eSHAPE_NO_CURVE_FOUND: Shape curve could not be found.
Remarks:
If pLayer is left at NULL, the method will use the first layer of the Animation stack.

virtual KFCurve* GetShapeChannel ( int  pIndex,
bool  pCreateAsNeeded = false,
char const *  pTakeName = NULL  
) [virtual]

Get the shape animation curve.

This method is deprecated and should not be used anymore. Instead call the equivalent using the KFbxAnimLayer.

Parameters:
pIndex 
pCreateAsNeeded 
pTakeName 

Reimplemented in KFbxTrimNurbsSurface.

virtual KFbxAnimCurve* GetShapeChannel ( int  pIndex,
KFbxAnimLayer pLayer,
bool  pCreateAsNeeded = false  
) [virtual]

Get the shape animation curve.

The shape channel is an animatable property with a value range from 0 to 100 (with 100 being full shape deformation). The default value is 0.

Parameters:
pIndex  The shape index.
pCreateAsNeeded  If true, creates the animation curve if it is not already present.
pLayer  Animation layer from which we want to get the requested animation curve.
Returns:
Animation curve (or NULL if an error occurred). If an error occurs, KFbxGeometry::GetLastErrorID() returns one of the following:
  • eINDEX_OUT_OF_RANGE: Shape index is out of range.
  • eSHAPE_NO_CURVE_FOUND: Shape curve could not be found.
Remarks:
If pLayer is left NULL, use the first layer of the Animation stack.

Reimplemented in KFbxTrimNurbsSurface.

KFbxXMatrix& GetPivot ( KFbxXMatrix pXMatrix  )  const

Returns the pivot matrix.

Parameters:
pXMatrix  Placeholder for the returned matrix.
Returns:
Reference to the passed argument.

void SetPivot ( KFbxXMatrix pXMatrix  ) 

Sets the pivot matrix.

Parameters:
pXMatrix  The transformation matrix that is assigned to the pivot matrix.

void ApplyPivot (  ) 

Applies the pivot matrix to all vertices/normals of the geometry.

void SetDefaultShape ( int  pIndex,
double  pPercent  
)

Sets the default deformation for a specified shape.

The default shape property has a value range from 0 to 100 (with 100 being full shape deformation). The default value is 0.

Parameters:
pIndex  The shape index.
pPercent  Deformation percentage (on a scale ranging from 0 to 100).
Remarks:
This function has no effect if pIndex is out of range.

void SetDefaultShape ( char const *  pShapeName,
double  pPercent  
)

Sets the default deformation for a specified shape.

The default shape property has a value range from 0 to 100 (with 100 being full shape deformation). The default value is 0.

Parameters:
pShapeName  The shape name.
pPercent  Deformation percentage (on a scale ranging from 0 to 100).
Remarks:
This function has no effect if pShapeName is invalid.

double GetDefaultShape ( int  pIndex  )  const

Returns the default deformation value for the specified shape.

The default shape property has a value range from 0 to 100 (with 100 being full shape deformation). The default value is 0.

Parameters:
pIndex  The shape index.
Returns:
The deformation value for the specified shape, or 0 if pIndex is out of range.

double GetDefaultShape ( char const *  pShapeName  )  const

Returns the default deformation value for the specified shape.

The default shape property has a value range from 0 to 100 (with 100 being full shape deformation). The default value is 0.

Parameters:
pShapeName  The shape name.
Returns:
The deformation value for the specified shape, or 0 if pShapeName is invalid.

KError& GetError (  ) 

Retrieves the error object.

Returns:
Reference to the error object.

EError GetLastErrorID (  )  const

Returns the last error code.

Returns:
The last error code.

const char* GetLastErrorString (  )  const

Returns the last error string.

Returns:
Text description of the last error.

virtual KFbxObject* Clone ( KFbxObject pContainer,
KFbxObject::ECloneType  pCloneType  
) const [virtual]

Creates a clone of this object.

Parameters:
pContainer  The object, typically a document or a scene, that contains the new clone(can be NULL).
pCloneType  The type of clone to be created.
Returns:
The new clone, or NULL (if the specified clone type is not supported).

Reimplemented from KFbxNodeAttribute.

Reimplemented in KFbxMesh, and KFbxProceduralGeometry.

KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry
KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry KFbxGeometry