FCDGeometryPolygons Class Reference
[COLLADA Document Geometry Entity]

A mesh polygon set. More...

#include <FCDGeometryPolygons.h>

Inheritance diagram for FCDGeometryPolygons:

FCDObject FUObject List of all members.

Public Member Functions

 FCDGeometryPolygons (FCDocument *document, FCDGeometryMesh *parent)
 Constructor: do not use directly.
virtual ~FCDGeometryPolygons ()
 Destructor: do not use directly.
FCDGeometryMeshGetParent ()
 Retrieves the geometry that contains this polygons.
const FCDGeometryMeshGetParent () const
 See above.
const UInt32ListGetFaceVertexCounts () const
 Retrieves the list of face-vertex counts.
size_t GetHoleCount () const
 Retrieves the number of holes within the faces of the polygon set.
size_t GetFaceCount () const
 Retrieves the number of faces within the polygon set.
size_t GetFaceOffset () const
 Retrieves the number of faces which appear before this polygon set within the geometric mesh.
size_t GetFaceVertexCount () const
 Retrieves the total number of face-vertex pairs within the polygon set.
size_t GetFaceVertexCount (size_t index) const
 Retrieves the number of face-vertex pairs for a given face.
size_t GetFaceVertexOffset () const
 Retrieves the total number of face-vertex pairs which appear before this polygon set within the geometric mesh.
size_t GetHoleOffset () const
 Retrieves the number of holes which appear before this polygon set.
size_t GetFaceVertexOffset (size_t index) const
 Retrieves the number of face-vertex pairs which appear before a given face within the polygon set.
void SetFaceOffset (size_t offset)
 [INTERNAL] Sets the number of faces in previous polygon sets.
void SetFaceVertexOffset (size_t offset)
 [INTERNAL] Sets the number of face-vertex pairs in previous polygon sets.
void SetHoleOffset (size_t offset)
 [INTERNAL] Sets the number of holes in previous polygon sets.
void AddFace (uint32 degree)
 Creates a new face.
void RemoveFace (size_t index)
 Removes a face.
FCDGeometryPolygonsInputListGetInputs ()
 Retrieves the list of polygon set inputs.
const FCDGeometryPolygonsInputListGetInputs () const
 See above.
size_t GetInputCount () const
 Retrieves the number of polygon set inputs.
FCDGeometryPolygonsInputGetInput (size_t index)
 Retrieves a specific polygon set input.
const FCDGeometryPolygonsInputGetInput (size_t index) const
 See above.
FCDGeometryPolygonsInputAddInput (FCDGeometrySource *source, uint32 offset)
 Creates a new polygon set input.
void ReleaseInput (FCDGeometryPolygonsInput *input)
 Deletes a polygon set input.
const UInt32ListGetHoleFaces () const
 Retrieves the list of entries within the face-vertex count list that are considered holes.
size_t GetHoleCountBefore (size_t index) const
 Retrieves the number of holes within faces of the polygon set that appear before the given face index.
size_t GetHoleCount (size_t index) const
 Retrieves the number of holes within a given face.
FCDGeometryPolygonsInputFindInput (FUDaeGeometryInput::Semantic semantic)
 Retrieves the first polygon set input found that has the given data type.
const FCDGeometryPolygonsInputFindInput (FUDaeGeometryInput::Semantic semantic) const
 See above.
FCDGeometryPolygonsInputFindInput (FCDGeometrySource *source)
 Retrieves the polygon set input that points towards a given data source.
const FCDGeometryPolygonsInputFindInput (const FCDGeometrySource *source) const
 See above.
FCDGeometryPolygonsInputFindInput (const string &sourceId)
 [INTERNAL] Retrieves the polygon set input that points towards a given data source.
void FindInputs (FUDaeGeometryInput::Semantic semantic, FCDGeometryPolygonsInputList &inputs)
 Retrieves all the polygon set inputs that have the given data type.
UInt32ListFindIndicesForIdx (uint32 idx)
 Retrieves the tessellation indices for a given polygon set input offset.
const UInt32ListFindIndicesForIdx (uint32 idx) const
 See above.
UInt32ListFindIndices (FCDGeometrySource *source)
 Retrieves the first tessellation index list for a given data source.
const UInt32ListFindIndices (const FCDGeometrySource *source) const
 See above.
UInt32ListFindIndices (FCDGeometryPolygonsInput *input)
 Retrieves the tessellation indices for a given polygon set input.
const UInt32ListFindIndices (const FCDGeometryPolygonsInput *input) const
 See above.
const fstring & GetMaterialSemantic () const
 Retrieves the symbolic name for the material used on this polygon set.
void SetMaterialSemantic (const fchar *semantic)
 Sets a symbolic name for the material used on this polygon set.
void SetMaterialSemantic (const fstring &semantic)
 See above.
void Triangulate ()
 Triangulates the polygon set.
void Recalculate ()
 [INTERNAL] Recalculates the buffered offset and count values for this polygon set.
FUStatus LoadFromXML (xmlNode *polygonNode)
 [INTERNAL] Reads in the polygon set element from a given COLLADA XML tree node.
xmlNode * WriteToXML (xmlNode *parentNode) const
 [INTERNAL] Writes out the correct polygon set element to the given COLLADA XML tree node.
FCDGeometryPolygonsClone (FCDGeometryMesh *cloneParent)
 [INTERNAL] Creates a copy of this mesh.

Detailed Description

A mesh polygon set.

Each polygon set contains a list of inputs and the tessellation information to make polygons out of the data and indices of the input. FCollada supports triangle lists as well as polygon lists and lists of polygons with holes. This implies that each face has an undeterminate number of vertices. The tessellation information creates polygons, but may also creates holes within the polygons.


Constructor & Destructor Documentation

FCDGeometryPolygons::FCDGeometryPolygons FCDocument document,
FCDGeometryMesh parent
 

Constructor: do not use directly.

Instead, use the FCDGeometryMesh::AddPolygons function to create new polygon sets.

Parameters:
document The COLLADA document which owns this polygon set.
parent The geometric mesh which contains this polygon set.

virtual FCDGeometryPolygons::~FCDGeometryPolygons  )  [virtual]
 

Destructor: do not use directly.

The mesh which contains this polygon set will handle its release.


Member Function Documentation

void FCDGeometryPolygons::AddFace uint32  degree  ) 
 

Creates a new face.

Enough indices to fill the face will be added to the polygon set inputs: you will want to overwrite those, as they will all be set to zero.

Parameters:
degree The degree of the polygon. This number implies the number of indices that will be expected, in order, within each of the input index lists.

FCDGeometryPolygonsInput* FCDGeometryPolygons::AddInput FCDGeometrySource source,
uint32  offset
 

Creates a new polygon set input.

Parameters:
source The data source for the polygon set input.
offset The tessellation indices offset for the polygon set input. If this value is new to the list of polygon inputs, you will need to fill in the indices. Please use the FindIndices function to verify that the offset is new and that indices need to be provided. The offset of zero is reserved for per-vertex data sources.
Returns:
The new polygon set input.

FCDGeometryPolygons* FCDGeometryPolygons::Clone FCDGeometryMesh cloneParent  ) 
 

[INTERNAL] Creates a copy of this mesh.

You should use the FCDGeometry::Clone function instead of this function. You will need to release the cloned entity.

Parameters:
cloneParent The geometric mesh which will contain the cloned polygon set.
Returns:
An identical copy of the polygon set.

UInt32List* FCDGeometryPolygons::FindIndices FCDGeometryPolygonsInput input  ) 
 

Retrieves the tessellation indices for a given polygon set input.

Parameters:
input A given polygon set input.
Returns:
The tessellation indices corresponding to the polygon set input. This pointer will be NULL if the polygon set input is not used within this polygon set.

UInt32List* FCDGeometryPolygons::FindIndices FCDGeometrySource source  ) 
 

Retrieves the first tessellation index list for a given data source.

Parameters:
source A data source.
Returns:
The first tessellation index list corresponding to the data source. This pointer will be NULL if the data source is not used within this polygon set.

UInt32List* FCDGeometryPolygons::FindIndicesForIdx uint32  idx  ) 
 

Retrieves the tessellation indices for a given polygon set input offset.

Deprecated:
Instead, use the FindIndices function.
Parameters:
idx A polygon set input offset.
Returns:
The tessellation indices corresponding to the offset. This pointer will be NULL if there are no polygon set input which uses the given offset.

FCDGeometryPolygonsInput* FCDGeometryPolygons::FindInput const string &  sourceId  ) 
 

[INTERNAL] Retrieves the polygon set input that points towards a given data source.

Parameters:
sourceId The COLLADA id of a geometry data source.
Returns:
The polygon set input. This pointer will be NULL if no polygon set input matches the COLLADA id.

FCDGeometryPolygonsInput* FCDGeometryPolygons::FindInput FCDGeometrySource source  ) 
 

Retrieves the polygon set input that points towards a given data source.

Parameters:
source A geometry data source.
Returns:
The polygon set input. This pointer will be NULL if no polygon set input matches the data source.

FCDGeometryPolygonsInput* FCDGeometryPolygons::FindInput FUDaeGeometryInput::Semantic  semantic  ) 
 

Retrieves the first polygon set input found that has the given data type.

Parameters:
semantic A type of geometry data.
Returns:
The polygon set input. This pointer will be NULL if no polygon set input matches the data type.

void FCDGeometryPolygons::FindInputs FUDaeGeometryInput::Semantic  semantic,
FCDGeometryPolygonsInputList inputs
 

Retrieves all the polygon set inputs that have the given data type.

Parameters:
semantic A type of geometry data.
inputs A list of polygon set inputs to fill in. This list is not emptied by the function and may remain untouched, if no polygon set input matches the given data type.

size_t FCDGeometryPolygons::GetFaceCount  )  const [inline]
 

Retrieves the number of faces within the polygon set.

Returns:
The number of faces within the polygon set.

size_t FCDGeometryPolygons::GetFaceOffset  )  const [inline]
 

Retrieves the number of faces which appear before this polygon set within the geometric mesh.

This value is useful when traversing all the faces of a geometric mesh.

Returns:
The number of faces in previous polygon sets.

size_t FCDGeometryPolygons::GetFaceVertexCount size_t  index  )  const
 

Retrieves the number of face-vertex pairs for a given face.

This value includes face-vertex pairs that create the polygon and its holes.

Parameters:
index A face index.
Returns:
The number of face-vertex pairs for a given face.

size_t FCDGeometryPolygons::GetFaceVertexCount  )  const [inline]
 

Retrieves the total number of face-vertex pairs within the polygon set.

This value is the total of all the values within the face-vertex count list. Do remember that the list of face-vertex pairs includes holes.

Returns:
The total number of face-vertex pairs within the polygon set.

const UInt32List& FCDGeometryPolygons::GetFaceVertexCounts  )  const [inline]
 

Retrieves the list of face-vertex counts.

Each face within the polygon set has one or more entry within this list, depending on the number of holes within that face. Each face-vertex count indicates the number of ordered indices within the polygon set inputs that are used to generate a face or its holes. To find out if a face-vertex count represents a face or its holes, check the hole-faces list retrieved using the GetHoleFaces function. Indirectly, the face-vertex count indicates the degree of the polygon.

See also:
GetHoleFaces

GetHoleCount

Returns:
The list of face-vertex counts.

size_t FCDGeometryPolygons::GetFaceVertexOffset size_t  index  )  const
 

Retrieves the number of face-vertex pairs which appear before a given face within the polygon set.

This value is useful when doing per-vertex mesh operations within the polygon set.

Parameters:
index The index of the face.
Returns:
The number of face-vertex pairs before the given face, within the polygon set.

size_t FCDGeometryPolygons::GetFaceVertexOffset  )  const [inline]
 

Retrieves the total number of face-vertex pairs which appear before this polygon set within the geometric mesh.

This value is useful when traversing all the face-vertex pairs of a geometric mesh.

Returns:
The number of face-vertex pairs in previous polygon sets.

size_t FCDGeometryPolygons::GetHoleCount size_t  index  )  const
 

Retrieves the number of holes within a given face.

Parameters:
index A face index.
Returns:
The number of holes within the given face.

size_t FCDGeometryPolygons::GetHoleCount  )  const [inline]
 

Retrieves the number of holes within the faces of the polygon set.

Returns:
The number of holes within the faces of the polygon set.

size_t FCDGeometryPolygons::GetHoleCountBefore size_t  index  )  const
 

Retrieves the number of holes within faces of the polygon set that appear before the given face index.

This value is useful when trying to access a specific face of a mesh, as holes and faces appear together within the face-vertex degree list.

Parameters:
index A face index.
Returns:
The number of holes within the polygon set that appear before the given face index.

const UInt32List& FCDGeometryPolygons::GetHoleFaces  )  const [inline]
 

Retrieves the list of entries within the face-vertex count list that are considered holes.

COLLADA does not support holes within holes, so each entry within this list implies a hole within the previous face.

See also:
GetFaceVertexCounts
Returns:
The list of hole entries within the face-vertex counts.

size_t FCDGeometryPolygons::GetHoleOffset  )  const [inline]
 

Retrieves the number of holes which appear before this polygon set.

This value is useful when traversing all the face-vertex pairs of a geometric mesh.

FCDGeometryPolygonsInput* FCDGeometryPolygons::GetInput size_t  index  )  [inline]
 

Retrieves a specific polygon set input.

Parameters:
index The index of the polygon set input. This index should not be greater than or equal to the number of polygon set inputs.
Returns:
The specific polygon set input. This pointer will be NULL if the index is out-of-bounds.

size_t FCDGeometryPolygons::GetInputCount  )  const [inline]
 

Retrieves the number of polygon set inputs.

Returns:
The number of polygon set inputs.

FCDGeometryPolygonsInputList& FCDGeometryPolygons::GetInputs  )  [inline]
 

Retrieves the list of polygon set inputs.

See also:
FCDGeometryPolygonsInput
Returns:
The list of polygon set inputs.

const fstring& FCDGeometryPolygons::GetMaterialSemantic  )  const [inline]
 

Retrieves the symbolic name for the material used on this polygon set.

Match this symbolic name within a FCDGeometryInstance to get the correct material instance.

Returns:
A symbolic material name.

FCDGeometryMesh* FCDGeometryPolygons::GetParent  )  [inline]
 

Retrieves the geometry that contains this polygons.

Returns:
The parent geometry.

FUStatus FCDGeometryPolygons::LoadFromXML xmlNode *  polygonNode  ) 
 

[INTERNAL] Reads in the polygon set element from a given COLLADA XML tree node.

COLLADA has multiple polygon set elements. The most common ones are <triangles> and <polylist>.

Parameters:
polygonNode The COLLADA XML tree node.
Returns:
The status of the import. If the status is not successful, it may be dangerous to extract information from the polygon set.

void FCDGeometryPolygons::ReleaseInput FCDGeometryPolygonsInput input  ) 
 

Deletes a polygon set input.

This function releases the memory held by the polygon set input as well as moves the indices to another polygon set input with the same offset, if the offset is re-used.

Parameters:
input The polygon set input to delete.

void FCDGeometryPolygons::RemoveFace size_t  index  ) 
 

Removes a face.

Parameters:
index The index of the face to remove. All the indices associated with this face will also be removed.

void FCDGeometryPolygons::SetFaceOffset size_t  offset  )  [inline]
 

[INTERNAL] Sets the number of faces in previous polygon sets.

Used by the FCDGeometryMesh::Recalculate function.

Parameters:
offset The number of faces in previous polygon sets.

void FCDGeometryPolygons::SetFaceVertexOffset size_t  offset  )  [inline]
 

[INTERNAL] Sets the number of face-vertex pairs in previous polygon sets.

Used by the FCDGeometryMesh::Recalculate function.

Parameters:
offset The number of face-vertex pairs in previous polygon sets.

void FCDGeometryPolygons::SetHoleOffset size_t  offset  )  [inline]
 

[INTERNAL] Sets the number of holes in previous polygon sets.

Used by the FCDGeometryMesh::Recalculate function.

Parameters:
offset The number of holes in previous polygon sets.

void FCDGeometryPolygons::SetMaterialSemantic const fchar *  semantic  )  [inline]
 

Sets a symbolic name for the material used on this polygon set.

This symbolic name will be matched within a FCDGeometryInstance to assign the correct material.

Parameters:
semantic The symbolic material name.

void FCDGeometryPolygons::Triangulate  ) 
 

Triangulates the polygon set.

A simple fanning techique is currently used: holes will not be triangulated correctly.

xmlNode* FCDGeometryPolygons::WriteToXML xmlNode *  parentNode  )  const
 

[INTERNAL] Writes out the correct polygon set element to the given COLLADA XML tree node.

COLLADA has multiple polygon set elements. The most common ones are <triangles> and <polylist>.

Parameters:
parentNode The COLLADA XML parent node in which to insert the geometric mesh.
Returns:
The created XML tree node.


The documentation for this class was generated from the following file:
Generated on Fri May 12 16:44:43 2006 for FCollada by  doxygen 1.4.6-NO