## Public API Reference

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

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

# csTriangleVerticesCost Class Reference
[Geometry utilities]

A class which holds vertices and connectivity information for a triangle mesh. More...

`#include <csgeom/trimeshlod.h>`

List of all members.

## Public Member Functions

void | CalculateCost (csTriangleLODAlgo *lodalgo)
| Calculate the cost of all vertices.
| csTriangleVerticesCost (csTriangleMesh *mesh, csVector3 *verts, int num_verts)
| Build vertex table for a triangle mesh.
void | Dump ()
| Dump connectivity information@@ TEMPORARY.
int | GetMinimalCostVertex (float &min_cost)
| Return the vertex id with minimal cost.
csTriangleVertexCost & | GetVertex (int idx)
int | GetVertexCount () const
csTriangleVertexCost * | GetVertices () const
csTriangleVerticesSorted * | SortVertices ()
| Sort all vertices so that the lowest cost vertex is first.
void | UpdateVertices (csVector3 *verts)
| Update vertex table for a given set of vertices (with the same number as at init).

## Detailed Description

A class which holds vertices and connectivity information for a triangle mesh.

This is a general vertices structure but it is mostly useful for LOD generation since every vertex contains information which helps selecting the best vertices for collapsing.

Definition at line 129 of file trimeshlod.h.

## Constructor & Destructor Documentation

csTriangleVerticesCost::csTriangleVerticesCost | ( | csTriangleMesh * | mesh,
|  | csVector3 * | verts,
|  | int | num_verts
| ) |

Build vertex table for a triangle mesh.

Parameters:

  | mesh | is the triangle mesh from which to calculate connectivity information.
  | verts | is an array of vertices that will be used to fill the cost vertex table.
  | num_verts | is the size of that table.

## Member Function Documentation

void csTriangleVerticesCost::CalculateCost | ( | csTriangleLODAlgo * | lodalgo | ) |

| Calculate the cost of all vertices.

void csTriangleVerticesCost::Dump | ( |  | ) |

| Dump connectivity information@@ TEMPORARY.

int csTriangleVerticesCost::GetMinimalCostVertex | ( | float & | min_cost | ) |

| Return the vertex id with minimal cost.

csTriangleVerticesSorted* csTriangleVerticesCost::SortVertices | ( |  | ) |

| Sort all vertices so that the lowest cost vertex is first.

void csTriangleVerticesCost::UpdateVertices | ( | csVector3 * | verts | ) |

| Update vertex table for a given set of vertices (with the same number as at init).

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

- csgeom/trimeshlod.h