Public Member Functions | Protected Member Functions | Friends

FBModelVertexData Class Reference

This reference page is linked to from the following overview topics: Updated Objects, Viewport Picking, Selection, and Manipulation.


Search for all occurrences

Detailed Description

Definition at line 972 of file fbmodel.h.

#include <fbmodel.h>

Inheritance diagram for FBModelVertexData:
Inheritance graph
[legend]

List of all members.

Public Member Functions

bool IsDeformable ()
 Return true if the model is deformable.
bool IsDrawable ()
 Queries if this model should be drawn, e.g., in custom render callback.
int GetVertexCount ()
 Return the Vertex Count.
void PushZDepthClipOverride ()
 Disables Z-Depth clip plane if this model is selected using Z-Depth HideFront selection tool.
void PopZDepthClipOverride ()
 Re-enables Z-Depth clip plane if it had been disabled via PushZDepthClipOverride().
Sub Patch Management. Each sub patch contain same type of primitives mapped with same material.
int GetSubPatchCount ()
 Return number of sub patches.
int GetSubPatchMaterialId (int pSubPatchIndex)
 Return the mapped material for this sub patch.
FBMaterialGetSubPatchMaterial (int pSubPatchIndex)
 Return the mapped material for this sub patch.
FBGeometryPrimitiveType GetSubPatchPrimitiveType (int pSubPatchIndex, bool *pIsOptimized=NULL)
 Return the primitive type for this sub patch.
int GetSubPatchIndexOffset (int pSubPatchIndex)
 Return the start offset of the indexes for this sub patch (see GetIndexArray()).
int GetSubPatchIndexSize (int pSubPatchIndex)
 Return the size of the indexes for this sub patch (see GetIndexArray()).
void DrawSubPatch (int pSubPatchIndex, bool pWireFrame=false)
 Draw Sub Patch.
Sub Regions Management. Each Sub Regions are composed by one or several patches which

are composed with same material.

int GetSubRegionCount ()
 Return number of sub regions (mapping with different materials)
FBMaterialGetSubRegionMaterial (int pSubRegionIndex)
 Return sub region's material.
void DrawSubRegion (int pSubRegionIndex, bool pWireFrame=false)
 Draw Sub Region.
Vertex Array Management
void EnableOGLVertexData (bool pAfterdeform=true)
 Enable (Setup) OpenGL Vertex Array (Pos & Normal)
void DisableOGLVertexData ()
 Disable OpenGL Vertex Array (Pos & Normal)
void VertexArrayMappingRequest ()
 Request deformed vertex array mapping on CPU.
void VertexArrayMappingRelease ()
 Release deformed vertex array mapping on CPU.
const int * GetVertexArrayDuplicationMap (unsigned int &pDuplicatedVertexCound)
 The FBModel::TessellatedMesh could contain per-face mapping UVset/Normal or other layer elements.
int * GetIndexArray ()
 Return Index Array.
unsigned int GetIndexArrayVBOId ()
 Return Index Array VBO Id.
FBGeometryArrayElementType GetVertexArrayType (FBGeometryArrayID pArrayId, bool pAfterDeform=true)
 Return Vertex Array Format.
void * GetVertexArray (FBGeometryArrayID pArrayId, bool pAfterDeform=true)
 Return Vertex Array Pointer.
unsigned int GetVertexArrayVBOId (FBGeometryArrayID pArrayId, bool pAfterDeform=true)
 Return Vertex Buffer Object (VBO) Id for the request array.
void * GetVertexArrayVBOOffset (FBGeometryArrayID pArrayId, bool pAfterDeform=true)
 Return Vertex Buffer Object (VBO) offset for the request array.
UVset Array Management
void EnableOGLUVSet (FBTextureMapping pTextureMapping=kFBTextureMappingUV, const char *pUVSet=NULL)
 Enable (Setup) OpenGL UV Set Array.
void DisableOGLUVSet ()
 Disable OpenGL UV Set Array.
FBGeometryArrayElementType GetUVSetArrayFormat (FBTextureMapping pTextureMapping=kFBTextureMappingUV, const char *pUVSet=NULL)
 Return UV Array Format.
void * GetUVSetArray (FBTextureMapping pTextureMapping=kFBTextureMappingUV, const char *pUVSet=NULL)
 Return UV Array Pointer.
unsigned int GetUVSetVBOId (FBTextureMapping pTextureMapping=kFBTextureMappingUV, const char *pUVSet=NULL)
 Return UVSet Buffer Object (VBO) Id.
void * GetUVSetVBOOffset (FBTextureMapping pTextureMapping=kFBTextureMappingUV, const char *pUVSet=NULL)
 Return UVSet Buffer Object (VBO) offset.

Protected Member Functions

 FBModelVertexData (FBModel *pModel)

Friends

class DataFBModel

Constructor & Destructor Documentation

FBModelVertexData ( FBModel pModel) [protected]

Member Function Documentation

bool IsDeformable ( )

Return true if the model is deformable.

bool IsDrawable ( )

Queries if this model should be drawn, e.g., in custom render callback.

Returns false if e.g., deformed vertex data has not been computed for this frame(thus not ready to be drawn), or if model should be hidden when Z-Depth selection tool is active.

int GetVertexCount ( )

Return the Vertex Count.

int GetSubPatchCount ( )

Return number of sub patches.

int GetSubPatchMaterialId ( int  pSubPatchIndex)

Return the mapped material for this sub patch.

FBMaterial* GetSubPatchMaterial ( int  pSubPatchIndex)

Return the mapped material for this sub patch.

FBGeometryPrimitiveType GetSubPatchPrimitiveType ( int  pSubPatchIndex,
bool *  pIsOptimized = NULL 
)

Return the primitive type for this sub patch.

Most of the time, kFBGeometry_TRIANGLES will return.

Parameters:
pSubPatchIndexIndex of sub patch to be queried.
pIsOptimizedOut parameter, return true if this sub patch is optimized for fast rendering, custom shader & render should use the optimized subpatch only
Returns:
The primitive type of the queried sub patch.
int GetSubPatchIndexOffset ( int  pSubPatchIndex)

Return the start offset of the indexes for this sub patch (see GetIndexArray()).

int GetSubPatchIndexSize ( int  pSubPatchIndex)

Return the size of the indexes for this sub patch (see GetIndexArray()).

void DrawSubPatch ( int  pSubPatchIndex,
bool  pWireFrame = false 
)

Draw Sub Patch.

Must be called between Enable/DisableOGLVertexData function calls.

Parameters:
pSubPatchIndexIndex of sub region to be drawn.
pWireFramedraw wire frame if true.
int GetSubRegionCount ( )

Return number of sub regions (mapping with different materials)

FBMaterial* GetSubRegionMaterial ( int  pSubRegionIndex)

Return sub region's material.

Parameters:
pSubRegionIndexIndex of the sub region.
void DrawSubRegion ( int  pSubRegionIndex,
bool  pWireFrame = false 
)

Draw Sub Region.

Must be called between Enable/DisableOGLVertexData function calls.

Parameters:
pSubRegionIndexIndex of sub region to be drawn.
pWireFramedraw wire frame if true.
void PushZDepthClipOverride ( )

Disables Z-Depth clip plane if this model is selected using Z-Depth HideFront selection tool.

Call this function before drawing each model in custom render callback, so that the selected model is unaffected by the Z-Depth clip plane, and hence is visible when Z-Depth HideFront selection tool is active. Be sure to call PopZDepthClipOverride() after drawing each model.

void PopZDepthClipOverride ( )

Re-enables Z-Depth clip plane if it had been disabled via PushZDepthClipOverride().

Call this function after drawing each model in custom render callback, so that Z-Depth clip plane is re-enabled if it was earlier disabled via PushZDepthClipOverride().

void EnableOGLVertexData ( bool  pAfterdeform = true)

Enable (Setup) OpenGL Vertex Array (Pos & Normal)

void DisableOGLVertexData ( )

Disable OpenGL Vertex Array (Pos & Normal)

void VertexArrayMappingRequest ( )

Request deformed vertex array mapping on CPU.

Model's deformation computation could be executed on GPU, and thus the deformed vertex data will reside in GPU memory only by default. Calling this function VertexArrayMappingRequest() will ensure the deformed vertex array to be always mapped to CPU memory.

Note:
: this function should be called at least once before GetVertexArray(pArrayId, true) to give engine chance to process request properly.
void VertexArrayMappingRelease ( )

Release deformed vertex array mapping on CPU.

call this function if plugin don't need CPU access of the deformed vertex array to be mapped on CPU memory anymore, hence allow the application flexbility to choose higher performance approach.

const int* GetVertexArrayDuplicationMap ( unsigned int &  pDuplicatedVertexCound)

The FBModel::TessellatedMesh could contain per-face mapping UVset/Normal or other layer elements.

In order to build a valid VBO buffer for accelerated rendering, those control points with multiple attribute data must be duplicated. This function return the duplicated vertexes' ID mapping from FBModel::ModelVertexData vertex array to its FBModel::TessellatedMesh vertex array. Note those duplicated vertexs are always appended after the original vertex array.

Parameters:
pDuplicatedVertexCoundreturn the count of those duplicated vertexs.
Returns:
A pointer to the original vertex ID mapping for those duplicated vertexs.
int* GetIndexArray ( )

Return Index Array.

unsigned int GetIndexArrayVBOId ( )

Return Index Array VBO Id.

FBGeometryArrayElementType GetVertexArrayType ( FBGeometryArrayID  pArrayId,
bool  pAfterDeform = true 
)

Return Vertex Array Format.

Parameters:
pArrayIdvertex array type to return.
pAfterDeformreturn deformed vertex array type if the model is deformable, pAfterDeform is true and deformation is occurred in CPU, otherwise return original.
Returns:
VertexArray Format.
Note:
Use VertexArrayMappingRequest() to toggle CPU / GPU skinning per model when necessary.
void* GetVertexArray ( FBGeometryArrayID  pArrayId,
bool  pAfterDeform = true 
)

Return Vertex Array Pointer.

Parameters:
pArrayIdvertex array type to return.
pAfterDeformreturn deformed vertex array if the model is deformable, pAfterDeform is true and deformation is occurred in CPU, otherwise return original.
Returns:
VertexArray Pointer. Deformed position & normal vertex arrays could be NULL if not request mapping vertex array.
Note:
Use VertexArrayMappingRequest() to toggle CPU / GPU skinning per model when necessary.
unsigned int GetVertexArrayVBOId ( FBGeometryArrayID  pArrayId,
bool  pAfterDeform = true 
)

Return Vertex Buffer Object (VBO) Id for the request array.

Parameters:
pArrayIdvertex array type to return.
pAfterDeformreturn deformed vertex array VBO Id if the model is deformable, pAfterDeform is true and deformation is occurred in CPU, otherwise return original.
Returns:
VertexArray VBO Id. Deformed position & normal vertex VBOId could be 0 is model use CPU skinning.
Note:
Use VertexArrayMappingRequest() to toggle CPU / GPU skinning per model when necessary.
void* GetVertexArrayVBOOffset ( FBGeometryArrayID  pArrayId,
bool  pAfterDeform = true 
)

Return Vertex Buffer Object (VBO) offset for the request array.

Parameters:
pArrayIdvertex array type to return.
pAfterDeformreturn deformed vertex array VBO offset if the model is deformable, pAfterDeform is true and deformation is occurred in CPU, otherwise return original.
Returns:
VertexArray VBO offset.
Note:
Use VertexArrayMappingRequest() to toggle CPU / GPU skinning per model when necessary.
void EnableOGLUVSet ( FBTextureMapping  pTextureMapping = kFBTextureMappingUV,
const char *  pUVSet = NULL 
)

Enable (Setup) OpenGL UV Set Array.

void DisableOGLUVSet ( )

Disable OpenGL UV Set Array.

FBGeometryArrayElementType GetUVSetArrayFormat ( FBTextureMapping  pTextureMapping = kFBTextureMappingUV,
const char *  pUVSet = NULL 
)

Return UV Array Format.

Parameters:
pTextureMappingTexture Mapping Mode.
pUVSetUVSet name if pTextureMapping is kFBTextureMappingUV, otherwise ignore.
Returns:
UVSet Array Format.
void* GetUVSetArray ( FBTextureMapping  pTextureMapping = kFBTextureMappingUV,
const char *  pUVSet = NULL 
)

Return UV Array Pointer.

Parameters:
pTextureMappingTexture Mapping Mode.
pUVSetUVSet name if pTextureMapping is kFBTextureMappingUV, otherwise ignore.
Returns:
UVSet Array Pointer.
unsigned int GetUVSetVBOId ( FBTextureMapping  pTextureMapping = kFBTextureMappingUV,
const char *  pUVSet = NULL 
)

Return UVSet Buffer Object (VBO) Id.

Parameters:
pTextureMappingTexture Mapping Mode.
pUVSetUVSet name if pTextureMapping is kFBTextureMappingUV, otherwise ignore.
Returns:
UVSet VBO Id.
void* GetUVSetVBOOffset ( FBTextureMapping  pTextureMapping = kFBTextureMappingUV,
const char *  pUVSet = NULL 
)

Return UVSet Buffer Object (VBO) offset.

Parameters:
pTextureMappingTexture Mapping Mode.
pUVSetUVSet name if pTextureMapping is kFBTextureMappingUV, otherwise ignore.
Returns:
UVSet VBO Offset.

Friends And Related Function Documentation

friend class DataFBModel [friend]

Definition at line 977 of file fbmodel.h.


The documentation for this class was generated from the following file:

FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData
FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData