FCDGeometryPolygons Class Reference
[COLLADA Document Geometry Entity]

A mesh polygon set. More...

#include <FCDGeometryPolygons.h>

Inheritance diagram for FCDGeometryPolygons:

FCDObject FUParameterizable FUTrackable FUObject List of all members.

Public Types

enum  PrimitiveType {
  LINES,
  LINE_STRIPS,
  POLYGONS,
  TRIANGLE_FANS,
  TRIANGLE_STRIPS,
  POINTS
}
 The types of primitives. More...

Public Member Functions

 FCDGeometryPolygons (FCDocument *document, FCDGeometryMesh *parent)
 Constructor: do not use directly.
virtual ~FCDGeometryPolygons ()
 Destructor.
FCDGeometryMeshGetParent ()
 Retrieves the geometry that contains this polygons.
const FCDGeometryMeshGetParent () const
 See above.
FCDExtraGetExtra ()
 Retrieves the extra information tree for this entity instance.
const FCDExtraGetExtra () const
 See above.
PrimitiveType GetPrimitiveType () const
 Retrieves the primitive type for this polygons set.
void SetPrimitiveType (PrimitiveType type)
 Sets the primitive type for this polygons set.
const uint32 * GetFaceVertexCounts () const
 Retrieves the list of face-vertex counts. See above.
void AddFaceVertexCount (uint32 count)
 Adds a new count to the face-vertex count list.
size_t GetFaceVertexCountCount () const
 Retrieves the number of face-vertex counts within the polygon set.
void SetFaceVertexCountCount (size_t count)
 Sets the number of face-vertex counts within the polygon set.
 DEPRECATED (3.05, TestPolyType) bool IsTriangles() const
 [DEPRECATED] Retrieves if the polygons is a list of polygons (returns false), or a list of triangles (returns true).
int32 TestPolyType () const
 Tests if the polygon can be aproximated with a constant face count Returns: 3 if all faces are triangles, 4 if all faces are triangles, else -1.
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.
virtual void AddFace (uint32 degree)
 Creates a new face.
virtual void RemoveFace (size_t index)
 Removes a face.
 DEPRECATED (3.05A, GetInputCount and GetInput(index)) void GetInputs()
 Retrieves the list of polygon set inputs.
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.
size_t GetHoleFaceCount () const
 Retrieves the number of hole entries within the face-vertex count list.
void SetHoleFaceCount (size_t count)
 Sets the number of hole entries within the face-vertex count list.
bool IsHoleFaceHole (size_t index)
 Checks whether a given face-vertex count entries represents a hole.
const uint32 * GetHoleFaces () const
 Retrieves the list of entries within the face-vertex count list that are considered holes. See above.
void AddHole (uint32 index)
 Adds a new hole identifier.
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 (const FCDGeometrySource *source)
 Retrieves the polygon set input that points towards a given data source.
const FCDGeometryPolygonsInputFindInput (const FCDGeometrySource *source) const
 See above.
FCDGeometryPolygonsInputFindInput (const fm::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.
void FindInputs (FUDaeGeometryInput::Semantic semantic, FCDGeometryPolygonsInputConstList &inputs) const
 See above.
const fstringGetMaterialSemantic () 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.
virtual void Recalculate ()
 [INTERNAL] Recalculates the buffered offset and count values for this polygon set.
virtual FCDGeometryPolygonsClone (FCDGeometryPolygons *clone, const FCDGeometrySourceCloneMap &cloneMap) const
 [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.


Member Enumeration Documentation

enum FCDGeometryPolygons::PrimitiveType
 

The types of primitives.

Enumerator:
LINES  A list of lines.

Only one element is contained in the face-vertex count list. It represents the total number of line vertices. The total number of lines is equal to half the total number of line vertices.

LINE_STRIPS  A list of continuous lines.

Each element in the face-vertex count list represents the number of consecutive line vertices before restarting.

POLYGONS  A list of polygons.

All the polygons may be triangles. This is the most common primitive type. The polygons may have holes. Each element in the face-vertex count list represent the number of vertices for one polygon.

TRIANGLE_FANS  A list of triangle fans.

Each element in the face-vertex count list represents the number of vertices for one fan. A triangle fan is defined by re-using the first vertex for every triangle. Advancing pairs are then used in order to generate adjacent triangles such that if there are 5 vertices, then 3 triangles are created: {0,1,2}, {0,2,3} and {0,3,4}.

TRIANGLE_STRIPS  A list of continuous triangles.

Each element in the face-vertex count list represents the number of vertices for one strip. A triangle strip is defined by re-using two advancing vertices from the previous triangle for the next triangle. If there are 5 vertices in the strip, then 3 triangles are created: {0,1,2}, {1,2,3}, {2,3,4}. Note that vertex winding must also be taken into consideration and every even triangle in the strip has its vertices swapped from the above pattern.

POINTS  A list of Camera-facing sprites.

The face-vertex count list will contain one element that represents the total number of points. Two non-COLLADA geometry sources (POINT_SIZE and POINT_ROTATION) are specific to this type.


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.


Member Function Documentation

virtual void FCDGeometryPolygons::AddFace uint32  degree  )  [virtual]
 

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.

void FCDGeometryPolygons::AddFaceVertexCount uint32  count  ) 
 

Adds a new count to the face-vertex count list.

This function only modifies the face-vertex count list. To also add indices to the inputs for the new face, use the AddFace function.

Parameters:
count The number of vertices in the new face.

void FCDGeometryPolygons::AddHole uint32  index  ) 
 

Adds a new hole identifier.

The face-vertex count entry should already exist and the identifier will be place in increasing order within the current list of entries within the face-vertex count list.

Parameters:
index The index of the hole within the face-vertex count list.

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.

virtual FCDGeometryPolygons* FCDGeometryPolygons::Clone FCDGeometryPolygons clone,
const FCDGeometrySourceCloneMap cloneMap
const [virtual]
 

[INTERNAL] Creates a copy of this mesh.

You should use the FCDGeometry::Clone function instead of this function.

Parameters:
clone The clone polygon set.
cloneMap A match-map of the original geometry sources to the clone geometry sources for the mesh.
Returns:
The clone polygon set.

FCDGeometryPolygons::DEPRECATED 3.  05A,
GetInputCount and   GetInput(index)
[inline]
 

Retrieves the list of polygon set inputs.

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

FCDGeometryPolygons::DEPRECATED 3.  05,
TestPolyType 
const
 

[DEPRECATED] Retrieves if the polygons is a list of polygons (returns false), or a list of triangles (returns true).

Returns:
The boolean answer.

FCDGeometryPolygonsInput* FCDGeometryPolygons::FindInput const fm::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 const FCDGeometrySource source  )  [inline]
 

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

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
[inline]
 

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.

FCDExtra* FCDGeometryPolygons::GetExtra  ) 
 

Retrieves the extra information tree for this entity instance.

The prefered way to save extra information in FCollada is at the entity level. Use this extra information tree to store any information you want exported and imported back.

Returns:
The extra information tree.

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.

size_t FCDGeometryPolygons::GetFaceVertexCountCount  )  const [inline]
 

Retrieves the number of face-vertex counts within the polygon set.

This value also represents the total the number of faces and holes within the polygon set.

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

const uint32* FCDGeometryPolygons::GetFaceVertexCounts  )  const [inline]
 

Retrieves the list of face-vertex counts. See above.

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.

size_t FCDGeometryPolygons::GetHoleFaceCount  )  const [inline]
 

Retrieves the number of hole entries within the face-vertex count list.

Returns:
The number of hole entries within the face-vertex count list.

const uint32* FCDGeometryPolygons::GetHoleFaces  )  const [inline]
 

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

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.

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.

PrimitiveType FCDGeometryPolygons::GetPrimitiveType  )  const [inline]
 

Retrieves the primitive type for this polygons set.

Returns:
The primitive type.

bool FCDGeometryPolygons::IsHoleFaceHole size_t  index  ) 
 

Checks whether a given face-vertex count entries represents a hole.

Parameters:
index The index of the face-vertex count entry.
Returns:
Whether this face-vertex count entry is a hole.

virtual void FCDGeometryPolygons::RemoveFace size_t  index  )  [virtual]
 

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::SetFaceVertexCountCount size_t  count  ) 
 

Sets the number of face-vertex counts within the polygon set.

Any additional face-vertex count will not be initialized and any removed face-vertex count will not remove the equivalent indices within the polygon set inputs.

Parameters:
count The new number of face-vertex counts within the polygon set.

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::SetHoleFaceCount size_t  count  ) 
 

Sets the number of hole entries within the face-vertex count list.

Any additional hole entries will need to be initialized by the application. Reducing the number of hole entries without taking special care to remove these entries from the face-vertex count list will result in new, unwanted, faces.

Parameters:
count The number of hole entries within the face-vertex count list.

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 in the FCDMaterialInstance contained within a FCDGeometryInstance to assign the correct material.

Parameters:
semantic The symbolic material name.

void FCDGeometryPolygons::SetPrimitiveType PrimitiveType  type  )  [inline]
 

Sets the primitive type for this polygons set.

Important note: no attempt is made at fixing up the indices. You should only do this operation of empty polygons set.

Parameters:
type The new primitive type.


The documentation for this class was generated from the following file:
Generated on Thu Feb 14 16:58:38 2008 for FCollada by  doxygen 1.4.6-NO