#include
<kfbxgeometrybase.h>
Use the KFbxGeometryBase class to manage the control points, normals, binormals and tangents of the geometries. The meaning of "control point" is dependant of the geometry object type. For meshes, the "control point" is the physical 3D coordinate of polygon vertices while, for NURBS, it is the the actual control point on the curves defining the surface. This class also allow you to define normals, binormals and tangents regardless of the type of geometric object. However, in reality, applying such definitions to NURBS and patches does not make much sense since these definitions would only exist at the control points and inbetween them, the interpolation would certainly not follow the curve.
Geometric objects are using a system of layered data to extend their construction definition. For example, a typical layer for a Mesh contains Normals, UVs and Materials but client applications can decide to define another set of Normals and UVs and swap them during the rendering phase to produce some different results. The combinations are limitless and it would be impossible to discuss them all. This example has been presented to show one possible context where layers can be used. More information can be found in the KFbxLayerContainer and KFbxLayer classes description.
Definition at line 70 of file kfbxgeometrybase.h.
Public and fast access Properties |
|
KFbxTypedProperty< fbxDouble3 > | BBoxMin |
The minimum value of the control points
bounding box. |
|
KFbxTypedProperty< fbxDouble3 > | BBoxMax |
The maximum value of the control points
bounding box. |
|
void | ComputeBBox () |
Computes the control points Bounding box.
|
|
Control Points, Normals, Binormals and Tangent Management. |
|
virtual void | InitControlPoints (int pCount) |
Allocates memory space for the array of
control points. |
|
void | InitNormals (int pCount=0) |
Allocates memory space for the array of
normals. |
|
void | InitNormals (KFbxGeometryBase *pSrc) |
Allocates memory space for the array of
normals cloned from the pSrc. |
|
void | InitTangents (int pCount=0, const int pLayerIndex=0, const char *pName="") |
Allocates memory space for the array of
tangents on specified layer. |
|
void | InitTangents (KFbxGeometryBase *pSrc, const int pLayerIndex=0) |
Allocates memory space for the array of
tangents cloned from the pSrc on the specified layer. |
|
void | InitBinormals (int pCount=0, const int pLayerIndex=0, const char *pName="") |
Allocates memory space for the array of
binormals. |
|
void | InitBinormals (KFbxGeometryBase *pSrc, const int pLayerIndex=0) |
Allocates memory space for the array of
binormals cloned from the pSrc. |
|
virtual void | SetControlPointAt (const KFbxVector4 &pCtrlPoint, const KFbxVector4 &pNormal, int pIndex, bool pI2DSearch=false) |
Sets the control point and the normal values
at the specified index. |
|
virtual void | SetControlPointAt (const KFbxVector4 &pCtrlPoint, int pIndex) |
Sets the control point at a specified index.
|
|
virtual KFbxVector4 | GetControlPointAt (int pIndex) const |
Gets the control point at the specified
index. |
|
virtual void | SetControlPointNormalAt (const KFbxVector4 &pNormal, int pIndex, bool pI2DSearch=false) |
Sets the control point normal value at the
specified index. |
|
virtual int | GetControlPointsCount () const |
Returns the number of control points.
|
|
virtual KFbxVector4 * | GetControlPoints () const |
Returns a pointer to the array of control
points. |
|
virtual void | SetControlPointCount (int pCount) |
Allocates memory space for the array of
control points. |
|
Off-loading Serialization section |
|
The methods in this section are typically called by
a peripheral (
KFbxPeripheral).
There should be no real interest in calling them directly. The
functions will write/read the memory dump of the data contained in
this class. Each data block written/read will start with an (int)
value representing the number of items in the array. If this value
(v) is not zero, it will be followed by the array content. A block
of data that is (v * sizeof(array item size)) bytes big. The
methods will also call the parent class ones to dump the Layers
content. |
|
virtual bool | ContentWriteTo (KFbxStream &pStream) const |
Writes the content of the geometry object to
the specified stream. |
|
virtual bool | ContentReadFrom (const KFbxStream &pStream) |
Reads the content of the geometry object
from the specified stream. |
|
Public Member Functions |
|
virtual int | MemoryUsage () const |
Calculate the actual amount of memory used
by this geometry object. |
virtual void InitControlPoints | ( | int | pCount | ) | [virtual] |
Allocates memory space for the array of control points.
pCount | The number of control points. |
void InitNormals | ( | int | pCount = 0 |
) |
Allocates memory space for the array of normals.
pCount | The desired size for the normal array. If pCount is specified, the array will be the same size as pCount. If pCount is not specified, the array will be the same length as the array of control points. |
The normals initialized with this function will have the ReferenceMode set to eDIRECT. Also, the array will always be defined on layer 0.
void InitNormals | ( | KFbxGeometryBase * | pSrc | ) |
Allocates memory space for the array of normals cloned from the pSrc.
pSrc | The source geometry from which the normals information is cloned. |
Allocates memory space for the array of tangents on specified layer.
pCount | The desired size of the tangent array. If pCount is specified, the array will be the same size as pCount. If pCount is not specified, the array will be the same length as the array of control points. | |
pLayerIndex | The specified layer index to allocate memory space for the array of tangents. | |
pName | The specified name for the allocated tangents array. |
void InitTangents | ( | KFbxGeometryBase * | pSrc, | |
const int | pLayerIndex = 0 |
|||
) |
Allocates memory space for the array of tangents cloned from the pSrc on the specified layer.
pSrc | The source geometry from which the tangents information is cloned. | |
pLayerIndex | The specified layer index to allocate memory space for cloned array of tangents from the pSrc. |
Allocates memory space for the array of binormals.
pCount | The desired size of the binormal array. If pCount is specified, the array will have the same size as pCount. If pCount is not specified, the array will be the same length as the array of control points. | |
pLayerIndex | The specified layer index to allocate memory space for the array of binormals. | |
pName | The specified name for the allocated binormals array. |
void InitBinormals | ( | KFbxGeometryBase * | pSrc, | |
const int | pLayerIndex = 0 |
|||
) |
Allocates memory space for the array of binormals cloned from the pSrc.
pSrc | The source geometry from which the binormals information is cloned. | |
pLayerIndex | The specified layer index to allocate memory space for cloned array of binormals from the pSrc. |
virtual void SetControlPointAt | ( | const KFbxVector4 & | pCtrlPoint, | |
const KFbxVector4 & | pNormal, | |||
int | pIndex, | |||
bool | pI2DSearch = false |
|||
) | [virtual] |
Sets the control point and the normal values at the specified index.
pCtrlPoint | The value of the control point. | |
pNormal | The value of the normal. | |
pIndex | The specified index of the control point/normal. | |
pI2DSearch | When true AND the normals array reference mode is
eINDEX_TO_DIRECT, search pNormal in the existing array to avoid
inserting if it already exist. NOTE: This feature uses a linear
search algorithm, therefore it can be time consuming if the DIRECT
array of normals contains a huge number of elements. |
virtual void SetControlPointAt | ( | const KFbxVector4 & | pCtrlPoint, | |
int | pIndex | |||
) | [virtual] |
Sets the control point at a specified index.
pCtrlPoint | The value of the control point. | |
pIndex | The specified index of the control point. |
virtual KFbxVector4 GetControlPointAt | ( | int | pIndex | ) | const [virtual] |
Gets the control point at the specified index.
pIndex | The specified index of the control point. |
virtual void SetControlPointNormalAt | ( | const KFbxVector4 & | pNormal, | |
int | pIndex, | |||
bool | pI2DSearch = false |
|||
) | [virtual] |
Sets the control point normal value at the specified index.
pNormal | The value of the normal. | |
pIndex | The specified index of the normal. | |
pI2DSearch | When true AND the normals array reference mode is
eINDEX_TO_DIRECT, search pNormal in the existing array to avoid
inserting it if it already exist. NOTE: this feature uses a linear
search algorithm, therefore it can be time consuming if the DIRECT
array of normals contains a huge number of elements. |
virtual int GetControlPointsCount | ( | ) | const [virtual] |
Returns the number of control points.
Reimplemented in KFbxTrimNurbsSurface.
virtual KFbxVector4* GetControlPoints | ( | ) | const [virtual] |
Returns a pointer to the array of control points.
NULL
if
the array has not been allocated.Reimplemented in KFbxTrimNurbsSurface.
virtual void SetControlPointCount | ( | int | pCount | ) | [virtual] |
Allocates memory space for the array of control points.
pCount | The number of control points. |
void ComputeBBox | ( | ) |
Computes the control points Bounding box.
virtual bool ContentWriteTo | ( | KFbxStream & | pStream | ) | const [virtual] |
Writes the content of the geometry object to the specified stream.
pStream | The destination stream. |
True
if the content is successfully processed by
the receiving stream, false
otherwise.Reimplemented from KFbxObject.
Reimplemented in KFbxPatch.
virtual bool ContentReadFrom | ( | const KFbxStream & | pStream | ) | [virtual] |
Reads the content of the geometry object from the specified stream.
pStream | The source stream. |
True
if the geometry object fills itself with the
received data from the stream successfully, false
otherwise.Reimplemented from KFbxObject.
Reimplemented in KFbxPatch.
virtual int MemoryUsage | ( | ) | const [virtual] |
Calculate the actual amount of memory used by this geometry object.
The minimum value of the control points bounding box.
Definition at line 205 of file kfbxgeometrybase.h.
The maximum value of the control points bounding box.
Definition at line 208 of file kfbxgeometrybase.h.