- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# FCDGeometryMesh Class Reference
[COLLADA Document Geometry Entity]

A COLLADA geometric mesh. More...

`#include <FCDGeometryMesh.h>`

Inheritance diagram for FCDGeometryMesh:

List of all members.

## Public Member Functions
| FCDGeometryMesh (FCDocument *document, FCDGeometry *parent)
| Contructor: do not use directly.
virtual | ~FCDGeometryMesh ()
| Destructor.
bool | Link ()
| [INTERNAL] Links a convex mesh to its source geometry (in convexHullOf).
FCDGeometry * | GetParent ()
| Retrieve the parent of this geometric spline: the geometry entity.
const FCDGeometry * | GetParent () const
| See above.
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 | IsConvex () const
| Retrieves whether the mesh is defined as convex or not.
void | SetConvex (bool _isConvex)
| Sets whether the mesh should be defined as convex.
bool | GetConvexify () const
| Retrieves the attribute determining if the mesh needs to be made convex.
void | SetConvexify (bool _convexify)
| Raise a flag that the mesh needs to be made convex and the host application should take care of it.
const fm::string & | GetConvexHullOf () const
| Retrieves the name of the concave mesh we need to convexify.
FCDGeometryMesh * | FindConvexHullOfMesh ()
| Retrieves the convex hull of this mesh.
const FCDGeometryMesh * | FindConvexHullOfMesh () const
| See above.
void | SetConvexHullOf (FCDGeometry *_geom)
| Sets the name of the geometry of which this mesh is the convex hull of.
void | SetConvexHullOf (const fm::string &id)
| [INTERNAL] Set the convec hull name directly.
const fm::string & | GetDaeId () const
| Retrieves the COLLADA id of the mesh.
size_t | GetPolygonsCount () const
| Retrieves the number of independent polygon groups.
FCDGeometryPolygons * | GetPolygons (size_t index)
| Retrieves a specific polygon group.
const FCDGeometryPolygons * | GetPolygons (size_t index) const
| See above.
FCDGeometryPolygons * | AddPolygons ()
| Creates a new polygon group.
bool | IsTriangles () const
| Retrieves if the mesh consists of only triangles.
void | FindPolygonsByMaterial (const fstring &semantic, FCDGeometryPolygonsList &sets)
| Retrieves the polygons sets which use the given material semantic.
| DEPRECATED (3.05A, GetVertexSourceCount and GetVertexSource(index)) void GetVertexSources() const
| Retrieves the list of per-vertex data sources.
size_t | GetVertexSourceCount () const
| Retrieves the number of per-vertex data sources.
FCDGeometrySource * | GetVertexSource (size_t index)
| Retrieves a specific per-vertex data source.
const FCDGeometrySource * | GetVertexSource (size_t index) const
| See above.
FCDGeometrySource * | AddVertexSource (FUDaeGeometryInput::Semantic type=FUDaeGeometryInput::UNKNOWN)
| Creates a new per-vertex data source for this geometric mesh.
void | AddVertexSource (FCDGeometrySource *source)
| Sets a source as per-vertex data.
void | RemoveVertexSource (FCDGeometrySource *source)
| Transforms a source of per-vertex data into a source of per-vertex-face data.
bool | IsVertexSource (const FCDGeometrySource *source) const
| Retrieves whether a given geometry source is a per-vertex source of this mesh.
FCDGeometrySource * | FindSourceById (const fm::string &id)
| [INTERNAL] Retrieves the data source that matches the given COLLADA id.
const FCDGeometrySource * | FindSourceById (const fm::string &id) const
| See above.
FCDGeometrySource * | FindSourceByType (FUDaeGeometryInput::Semantic type)
| Retrieves the first data source that matches the given geometry data type.
const FCDGeometrySource * | FindSourceByType (FUDaeGeometryInput::Semantic type) const
| See above.
FCDGeometrySource * | FindSourceByName (const fstring &name)
| Retrieves the first data source that matches the given name.
const FCDGeometrySource * | FindSourceByName (const fstring &name) const
| See above.
void | FindSourcesByType (FUDaeGeometryInput::Semantic type, FCDGeometrySourceList &sources)
| Retrieves the list of data sources that matches the given geometry data type.
void | FindSourcesByType (FUDaeGeometryInput::Semantic type, FCDGeometrySourceConstList &sources) const
| See above.
FCDGeometrySource * | GetPositionSource ()
| Retrieves the per-vertex data that specifically contains the vertex positions.
const FCDGeometrySource * | GetPositionSource () const
| See above.
| DEPRECATED (3.05A, GetSourceCount and GetSource(index)) void GetSources() const
| Retrieves the list of all data sources.
size_t | GetSourceCount () const
| Retrieves the number of data sources contained within this geometric mesh.
FCDGeometrySource * | GetSource (size_t index)
| Retrieves a specific data source.
const FCDGeometrySource * | GetSource (size_t index) const
| See above.
FCDGeometrySource * | AddSource (FUDaeGeometryInput::Semantic type=FUDaeGeometryInput::UNKNOWN)
| Creates a new data source for this geometric mesh.
FCDGeometryMesh * | Clone (FCDGeometryMesh *clone=NULL) const
| Copies the mesh into a clone.
void | Recalculate ()
| [INTERNAL] Forces the recalculation of the hole count, vertex count, face-vertex counts and their offsets.

## 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.

## 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 | ( | FUDaeGeometryInput::Semantic | type = `FUDaeGeometryInput::UNKNOWN` | ) |

  | Creates a new data source for this geometric mesh. The new data source will not be added to any of the existing polygon groups. Parameters:
  | type | The type of data that will be contained within the source. Defaults to UNKNOWN, so that you may provide the source type later.
Returns: The new per-vertex data source. This pointer should never be NULL.

void FCDGeometryMesh::AddVertexSource | ( | FCDGeometrySource * | source | ) |

  | Sets a source as per-vertex data. Parameters:
  | source | A source that will now contain per-vertex data.

FCDGeometrySource* FCDGeometryMesh::AddVertexSource | ( | FUDaeGeometryInput::Semantic | type = `FUDaeGeometryInput::UNKNOWN` | ) |

  | 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. Parameters:
  | type | The type of data that will be contained within the source. Defaults to UNKNOWN, so that you may provide the source type later.
Returns: The new per-vertex data source. This pointer should never be NULL.

FCDGeometryMesh* FCDGeometryMesh::Clone | ( | FCDGeometryMesh * | clone = `NULL` | ) | const

  | Copies the mesh into a clone. The clone may reside in another document. Parameters:
  | clone | The empty clone. If this pointer is NULL, a new mesh will be created and you will need to release the returned pointer manually.
Returns: The clone.

FCDGeometryMesh::DEPRECATED | ( | 3. | 05A,
|  | GetSourceCount and | GetSource(index)
| ) | const`[inline]`

| Retrieves the list of all data sources. Some of the sources within this list are also present within the vertex data source list. Returns: The list of all data sources.

FCDGeometryMesh::DEPRECATED | ( | 3. | 05A,
|  | GetVertexSourceCount and | GetVertexSource(index)
| ) | const`[inline]`

| 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.

FCDGeometryMesh* FCDGeometryMesh::FindConvexHullOfMesh | ( |  | ) | `[inline]`

| Retrieves the convex hull of this mesh. Returns: The convex hull geometry created using this mesh. This pointer will be NULL if no convex hull was created using this mesh.

void FCDGeometryMesh::FindPolygonsByMaterial | ( | const fstring & | semantic,
|  | FCDGeometryPolygonsList & | sets
| ) |

  | Retrieves the polygons sets which use the given material semantic. Useful when processing material instances. Parameters:
  | semantic | The material semantic to find.
  | sets | A list of polygon sets to fill in. This list is not cleared.

FCDGeometrySource* FCDGeometryMesh::FindSourceById | ( | const fm::string & | id | ) | `[inline]`

  | [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.

FCDGeometrySource* FCDGeometryMesh::FindSourceByName | ( | const fstring & | name | ) | `[inline]`

  | Retrieves the first data source that matches the given name. Parameters:
  | name | A valid COLLADA name.
Returns: The first data source that matches the name. This pointer will be NULL if no matching data source was found.

FCDGeometrySource* FCDGeometryMesh::FindSourceByType | ( | FUDaeGeometryInput::Semantic | type | ) | `[inline]`

  | Retrieves the first data source that matches the given geometry data type. Parameters:
  | type | A geometry data type.
Returns: The first data source that matches the data type. This pointer will be NULL if no matching data source was found.

void FCDGeometryMesh::FindSourcesByType | ( | FUDaeGeometryInput::Semantic | type,
|  | FCDGeometrySourceList & | sources
| ) | `[inline]`

  | Retrieves the list of data sources that matches the given geometry data type. Parameters:
  | type | A geometry data type.
  | sources | A list of data sources to fill in with the matching data sources. This list is not cleared and no check for uniqueness is done.

const fm::string& FCDGeometryMesh::GetConvexHullOf | ( |  | ) | const`[inline]`

| Retrieves the name of the concave mesh we need to convexify. Returns: The name of the geometry containing the mesh to convexify.

bool FCDGeometryMesh::GetConvexify | ( |  | ) | const`[inline]`

| Retrieves the attribute determining if the mesh needs to be made convex. Returns: The flag determining if the mesh needs to be made convex.

const fm::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.

FCDGeometry* FCDGeometryMesh::GetParent | ( |  | ) | `[inline]`

| Retrieve the parent of this geometric spline: the geometry entity. Returns: The geometry entity that this spline belongs to.

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 | ( |  | ) | `[inline]`

| 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. Deprecated: Use FindSourceByType instead. 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.

bool FCDGeometryMesh::IsConvex | ( |  | ) | const`[inline]`

| Retrieves whether the mesh is defined as convex or not. Returns: Whether the mesh is defined as convex.

bool FCDGeometryMesh::IsTriangles | ( |  | ) | const

| Retrieves if the mesh consists of only triangles. Returns: The boolean value.

bool FCDGeometryMesh::IsVertexSource | ( | const FCDGeometrySource * | source | ) | const`[inline]`

  | Retrieves whether a given geometry source is a per-vertex source of this mesh. Parameters:
  | source | A source contained within this mesh.
Returns: Whether the source is a per-vertex source of the mesh.

bool FCDGeometryMesh::Link | ( |  | ) |

| [INTERNAL] Links a convex mesh to its source geometry (in convexHullOf). The geometry's mesh is copied into the current one and convexified. This function is used at the end of the import of a document to verify that the geometry was found. Returns: The status of the linkage.

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::RemoveVertexSource | ( | FCDGeometrySource * | source | ) |

  | Transforms a source of per-vertex data into a source of per-vertex-face data. Note: the offsets of the inputs is not changed and no data is released. Parameters:
  | source | A source that will now contain per-vertex data.

void FCDGeometryMesh::SetConvex | ( | bool | _isConvex | ) | `[inline]`

  | Sets whether the mesh should be defined as convex. Parameters:
  | _isConvex | Whether the mesh is convex.

void FCDGeometryMesh::SetConvexHullOf | ( | const fm::string & | id | ) | `[inline]`

  | [INTERNAL] Set the convec hull name directly. Parameters:
  | id | The name id.

void FCDGeometryMesh::SetConvexHullOf | ( | FCDGeometry * | _geom | ) |

  | Sets the name of the geometry of which this mesh is the convex hull of. Parameters:
  | _geom | The geometry of which this mesh is the convex hull of.

void FCDGeometryMesh::SetConvexify | ( | bool | _convexify | ) | `[inline]`

  | Raise a flag that the mesh needs to be made convex and the host application should take care of it. In the future, we could compute ourselves the convex hull of the mesh. A good algorithm could be the "Quickhull". Parameters:
  | _convexify | Whether the mesh needs to be made convex.

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

- FCDocument/FCDGeometryMesh.h