FCDGeometryMesh Class Reference
[COLLADA Document Geometry Entity]

A COLLADA geometric mesh. More...

#include <FCDGeometryMesh.h>

Inheritance diagram for FCDGeometryMesh:

FCDObject FUObject List of all members.

Public Member Functions

 FCDGeometryMesh (FCDocument *document, FCDGeometry *parent)
 Contructor: do not use directly.
virtual ~FCDGeometryMesh ()
 Destructor: do not use directly.
size_t GetFaceCount () const
 Retrieves the number of faces within the geometric mesh.
size_t GetHoleCount () const
 Retrieves the number of holes within the faces of the geometric mesh.
size_t GetFaceVertexCount () const
 Retrieves the total number of per-face vertices in the mesh.
bool IsDoubleSided () const
 Retrieves whether the mesh should be treated as double-sided.
const string & GetDaeId () const
 Retrieves the COLLADA id of the mesh.
size_t GetPolygonsCount () const
 Retrieves the number of independent polygon groups.
FCDGeometryPolygonsGetPolygons (size_t index)
 Retrieves a specific polygon group.
const FCDGeometryPolygonsGetPolygons (size_t index) const
 See above.
FCDGeometryPolygonsAddPolygons ()
 Creates a new polygon group.
FCDGeometrySourceListGetVertexSources ()
 [INTERNAL] Retrieves the list of per-vertex data sources.
const FCDGeometrySourceListGetVertexSources () const
 See above.
size_t GetVertexSourceCount () const
 Retrieves the number of per-vertex data sources.
FCDGeometrySourceGetVertexSource (size_t index)
 Retrieves a specific per-vertex data source.
const FCDGeometrySourceGetVertexSource (size_t index) const
 See above.
FCDGeometrySourceAddVertexSource ()
 Creates a new per-vertex data source for this geometric mesh.
FCDGeometrySourceFindSourceById (const string &id)
 [INTERNAL] Retrieves the data source that matches the given COLLADA id.
const FCDGeometrySourceFindSourceById (const string &id) const
 See above.
FCDGeometrySourceGetPositionSource ()
 Retrieves the per-vertex data that specifically contains the vertex positions.
const FCDGeometrySourceGetPositionSource () const
 See above.
size_t GetSourceCount () const
 Retrieves the number of data sources contained within this geometric mesh.
FCDGeometrySourceGetSource (size_t index)
 Retrieves a specific data source.
const FCDGeometrySourceGetSource (size_t index) const
 See above.
FCDGeometrySourceAddSource ()
 Creates a new data source for this geometric mesh.
void Triangulate ()
 Triangulates the mesh.
void Recalculate ()
 [INTERNAL] Forces the recalculation of the hole count, vertex count, face-vertex counts and their offsets.
FCDGeometryMeshClone (FloatList &newPositions, uint32 newPositionsStride, FloatList &newNormals, uint32 newNormalsStride)
 [INTERNAL] Creates a copy of this mesh.
FUStatus LoadFromXML (xmlNode *meshNode)
 [INTERNAL] Reads in the <mesh> element from a given COLLADA XML tree node.
xmlNode * WriteToXML (xmlNode *parentNode) const
 [INTERNAL] Writes out the <mesh> element to the given COLLADA XML tree node.

Detailed Description

A COLLADA geometric mesh.

A COLLADA geometric mesh is a list of vertices tied together in polygons. A set of per-vertex data is used to determine the vertices of the mesh. This data usually includes a single list: of vertex positions, but it may also contain per-vertex colors, per-vertex normals or per-vertex texture coordinates. The other data sources declare per-vertex-face data.

The faces of a mesh may be split across different groups, as they may have different materials assigned to them. The FCDGeometryPolygons objects contains one such group of faces.


Constructor & Destructor Documentation

FCDGeometryMesh::FCDGeometryMesh FCDocument document,
FCDGeometry parent
 

Contructor: do not use directly.

Use FCDGeometry::AddMesh instead.

Parameters:
document The COLLADA document which owns this mesh.
parent The geometry entity which contains this mesh.

virtual FCDGeometryMesh::~FCDGeometryMesh  )  [virtual]
 

Destructor: do not use directly.

All geometric meshes are released with the geometry that they belong to.


Member Function Documentation

FCDGeometryPolygons* FCDGeometryMesh::AddPolygons  ) 
 

Creates a new polygon group.

Each polygon group is represented within a FCDGeometryPolygons object. The new polygon group will be assigned all the existing per-vertex data sources. No material will be assigned to the new polygon group.

Returns:
The new polygon group. This pointer should never be NULL.

FCDGeometrySource* FCDGeometryMesh::AddSource  ) 
 

Creates a new data source for this geometric mesh.

The new data source will not be added to any of the existing polygon groups.

Returns:
The new per-vertex data source. This pointer should never be NULL.

FCDGeometrySource* FCDGeometryMesh::AddVertexSource  ) 
 

Creates a new per-vertex data source for this geometric mesh.

The per-vertex data source will be added to both the per-vertex data source list and the data source list. The new per-vertex data source will automatically be added to all the existing polygon groups.

Returns:
The new per-vertex data source. This pointer should never be NULL.

FCDGeometryMesh* FCDGeometryMesh::Clone FloatList newPositions,
uint32  newPositionsStride,
FloatList newNormals,
uint32  newNormalsStride
 

[INTERNAL] Creates a copy of this mesh.

You may use the FCDGeometry::Clone function instead of this function. Creates a full copy of the geometry, with the vertices overwritten by the given data: this is used when importing COLLADA 1.3 skin controllers. You will need to release the cloned entity.

See also:
FCDGeometry::Clone.
Parameters:
newPositions The list of vertex position that will overwrite the current mesh vertex positions. This list may be empty.
newPositionsStride The stride, in bytes, of the newPositions list. For an empty newPositions list, this value is discarded.
newNormals The list of vertex normals that will overwrite the current mesh vertex normals. This list may be empty.
newNormalsStride The stride, in bytes, of the newNormals list. For an empty newNormals list, this value is discarded.
Returns:
The cloned geometry entity. You will need to release this pointer.

FCDGeometrySource* FCDGeometryMesh::FindSourceById const string &  id  ) 
 

[INTERNAL] Retrieves the data source that matches the given COLLADA id.

Parameters:
id A valid COLLADA id.
Returns:
The data source. This pointer will be NULL if no matching data source was found.

const string& FCDGeometryMesh::GetDaeId  )  const
 

Retrieves the COLLADA id of the mesh.

This is a shortcut to the parent geometry's COLLADA id.

Returns:
The COLLADA id of the mesh.

size_t FCDGeometryMesh::GetFaceCount  )  const [inline]
 

Retrieves the number of faces within the geometric mesh.

Returns:
The number of faces within the geometric mesh.

size_t FCDGeometryMesh::GetFaceVertexCount  )  const [inline]
 

Retrieves the total number of per-face vertices in the mesh.

This function makes no assumption about the uniqueness of the per-face vertices.

Returns:
The total number of per-face vertices in the mesh.

size_t FCDGeometryMesh::GetHoleCount  )  const [inline]
 

Retrieves the number of holes within the faces of the geometric mesh.

As one face may contain multiple holes, this value may be larger than the number of faces.

Returns:
The number of holes within the faces of the geometric mesh.

FCDGeometryPolygons* FCDGeometryMesh::GetPolygons size_t  index  )  [inline]
 

Retrieves a specific polygon group.

Each polygon group is represented within a FCDGeometryPolygons object. An independent polygon group is usually created to assign a different material to different parts of the mesh or to assign partial texture coordinates and texture tangents to different parts of the mesh.

Parameters:
index The index of the polygon group. This index should be less than the number of independent polygon groups returned by the GetPolygonsCount function.
Returns:
The polygon group. This pointer will be NULL if the index is out-of-bounds.

size_t FCDGeometryMesh::GetPolygonsCount  )  const [inline]
 

Retrieves the number of independent polygon groups.

Each polygon group is represented within a FCDGeometryPolygons object. An independent polygon group is usually created to assign a different material to different parts of the mesh or to assign partial texture coordinates and texture tangents to different parts of the mesh.

Returns:
The number of independent polygon groups.

FCDGeometrySource* FCDGeometryMesh::GetPositionSource  ) 
 

Retrieves the per-vertex data that specifically contains the vertex positions.

If there are more than one per-vertex data source that contains vertex positions, the first one is returned.

Returns:
A per-vertex data source that contains vertex positions. This pointer will be NULL in the unlikely possibility that there are no per-vertex data source that contains vertex positions.

FCDGeometrySource* FCDGeometryMesh::GetSource size_t  index  )  [inline]
 

Retrieves a specific data source.

Parameters:
index The index of the data source. This index should be less than the number of data sources returns by the GetSourceCount function.
Returns:
The data source. This pointer will be NULL if the index is out-of-bounds.

size_t FCDGeometryMesh::GetSourceCount  )  const [inline]
 

Retrieves the number of data sources contained within this geometric mesh.

Returns:
The number of data sources within the mesh.

FCDGeometrySource* FCDGeometryMesh::GetVertexSource size_t  index  )  [inline]
 

Retrieves a specific per-vertex data source.

All the per-vertex data sources are also included in the list of data sources.

Parameters:
index The index of the per-vertex data source. This index should be less than the number of per-vertex data sources returns by the GetVertexSourceCount function.
Returns:
The per-vertex data source. This pointer will be NULL if the index is out-of-bounds.

size_t FCDGeometryMesh::GetVertexSourceCount  )  const [inline]
 

Retrieves the number of per-vertex data sources.

This number should always be lesser or equal to the number of data sources, as each per-vertex data source is also included within the list of data sources.

Returns:
The number of per-vertex data sources.

FCDGeometrySourceList& FCDGeometryMesh::GetVertexSources  )  [inline]
 

[INTERNAL] Retrieves the list of per-vertex data sources.

There should usually be one per-vertex data source that contains positions. All the sources within this list are also present within the data source list.

Returns:
The list of per-vertex data sources.

bool FCDGeometryMesh::IsDoubleSided  )  const [inline]
 

Retrieves whether the mesh should be treated as double-sided.

This flag does not belong to COLLADA but is exported at the geometric-level by ColladaMaya.

Returns:
Whether the mesh is double-sided.

FUStatus FCDGeometryMesh::LoadFromXML xmlNode *  meshNode  ) 
 

[INTERNAL] Reads in the <mesh> element from a given COLLADA XML tree node.

Parameters:
meshNode 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 geometric mesh.

void FCDGeometryMesh::Recalculate  ) 
 

[INTERNAL] Forces the recalculation of the hole count, vertex count, face-vertex counts and their offsets.

Since the counts and offsets are buffered at the geometric mesh object level, this function allows the polygon groups to force the recalculation of the buffered values, when they are modified.

void FCDGeometryMesh::Triangulate  ) 
 

Triangulates the mesh.

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

xmlNode* FCDGeometryMesh::WriteToXML xmlNode *  parentNode  )  const
 

[INTERNAL] Writes out the <mesh> element to the given COLLADA XML tree node.

Parameters:
parentNode The COLLADA XML parent node in which to insert the geometric mesh.
Returns:
The created <mesh> element 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