# Ogre::EdgeListBuilder Class Reference
Math

General utility class for building edge lists for geometry. More...

`#include <OgreEdgeListBuilder.h>`

List of all members.

## Classes

struct | CommonVertex
| A vertex can actually represent several vertices in the final model, because vertices along texture seams etc will have been duplicated. More...
struct | Geometry
| A set of indexed geometry data. More...
struct | geometryLess
| Comparator for sorting geometries by vertex set. More...
struct | vectorLess
| Comparator for unique vertex list. More...

## Public Member Functions

| EdgeListBuilder ()
virtual | ~EdgeListBuilder ()
void | addVertexData (const VertexData *vertexData)
| Add a set of vertex geometry data to the edge builder.
void | addIndexData (const IndexData *indexData, size_t vertexSet=0, RenderOperation::OperationType opType=RenderOperation::OT_TRIANGLE_LIST)
| Add a set of index geometry data to the edge builder.
EdgeData * | build (void)
| Builds the edge information based on the information built up so far.
void | log (Log *l)
| Debugging method.

## Protected Types

typedef vector< const VertexData * >::type | VertexDataList
typedef vector< Geometry >::type | GeometryList
typedef vector< CommonVertex > ::type | CommonVertexList
typedef map< Vector3, size_t, vectorLess >::type | CommonVertexMap
| Map for identifying common vertices.
typedef multimap< std::pair < size_t, size_t >, std::pair < size_t, size_t > >::type | EdgeMap
| Edge map, used to connect edges.

## Protected Member Functions

void | buildTrianglesEdges (const Geometry &geometry)
size_t | findOrCreateCommonVertex (const Vector3 &vec, size_t vertexSet, size_t indexSet, size_t originalIndex)
| Finds an existing common vertex, or inserts a new one.
void | connectOrCreateEdge (size_t vertexSet, size_t triangleIndex, size_t vertIndex0, size_t vertIndex1, size_t sharedVertIndex0, size_t sharedVertIndex1)
| Connect existing edge or create a new edge - utility method during building.

## Protected Attributes

GeometryList | mGeometryList
VertexDataList | mVertexDataList
CommonVertexList | mVertices
EdgeData * | mEdgeData
CommonVertexMap | mCommonVertexMap
EdgeMap | mEdgeMap

## Detailed Description

General utility class for building edge lists for geometry.

Remarks:
  You can add multiple sets of vertex and index data to build and edge list. Edges will be built between the various sets as well as within sets; this allows you to use a model which is built from multiple SubMeshes each using separate index and (optionally) vertex data and still get the same connectivity information. It's important to note that the indexes for the edge will be constrained to a single vertex buffer though (this is required in order to render the edge).

Definition at line 163 of file OgreEdgeListBuilder.h.

## Member Typedef Documentation

typedef vector<CommonVertex>::type Ogre::EdgeListBuilder::CommonVertexList`[protected]`

Definition at line 240 of file OgreEdgeListBuilder.h.

typedef map<Vector3, size_t, vectorLess>::type Ogre::EdgeListBuilder::CommonVertexMap`[protected]`

Map for identifying common vertices.

Definition at line 247 of file OgreEdgeListBuilder.h.

typedef multimap< std::pair<size_t, size_t>, std::pair<size_t, size_t> >::type Ogre::EdgeListBuilder::EdgeMap`[protected]`

Edge map, used to connect edges.

Note we allow many triangles on an edge, after connected an existing edge, we will remove it and never used again.

Definition at line 252 of file OgreEdgeListBuilder.h.

typedef vector<Geometry>::type Ogre::EdgeListBuilder::GeometryList`[protected]`

Definition at line 239 of file OgreEdgeListBuilder.h.

typedef vector<const VertexData*>::type Ogre::EdgeListBuilder::VertexDataList`[protected]`

Definition at line 238 of file OgreEdgeListBuilder.h.

## Constructor & Destructor Documentation

Ogre::EdgeListBuilder::EdgeListBuilder | ( |  | ) |

virtual Ogre::EdgeListBuilder::~EdgeListBuilder | ( |  | ) | `[virtual]`

## Member Function Documentation

void Ogre::EdgeListBuilder::addIndexData | ( | const IndexData * | indexData,
|  | size_t | vertexSet = `0`,
|  | RenderOperation::OperationType | opType = `RenderOperation::OT_TRIANGLE_LIST`
| ) |  |

Add a set of index geometry data to the edge builder.

Remarks:
  You must add at least one set of index data to the builder before invoking the build method.

Parameters:

  indexData | The index information which describes the triangles.
  vertexSet | The vertex data set this index data refers to; you only need to alter this if you have added multiple sets of vertices
  opType | The operation type used to render these indexes. Only triangle types are supported (no point or line types)

void Ogre::EdgeListBuilder::addVertexData | ( | const VertexData * | vertexData | ) |

Add a set of vertex geometry data to the edge builder.

Remarks:
  You must add at least one set of vertex data to the builder before invoking the build method.

EdgeData* Ogre::EdgeListBuilder::build | ( | void |  | ) |

Builds the edge information based on the information built up so far.

Remarks:
  The caller takes responsibility for deleting the returned structure.

void Ogre::EdgeListBuilder::buildTrianglesEdges | ( | const Geometry & | geometry | ) | `[protected]`

void Ogre::EdgeListBuilder::connectOrCreateEdge | ( | size_t | vertexSet,
|  | size_t | triangleIndex,
|  | size_t | vertIndex0,
|  | size_t | vertIndex1,
|  | size_t | sharedVertIndex0,
|  | size_t | sharedVertIndex1
| ) |  | `[protected]`

Connect existing edge or create a new edge - utility method during building.

size_t Ogre::EdgeListBuilder::findOrCreateCommonVertex | ( | const Vector3 & | vec,
|  | size_t | vertexSet,
|  | size_t | indexSet,
|  | size_t | originalIndex
| ) |  | `[protected]`

Finds an existing common vertex, or inserts a new one.

void Ogre::EdgeListBuilder::log | ( | Log * | l | ) |

Debugging method.

## Member Data Documentation

CommonVertexMap Ogre::EdgeListBuilder::mCommonVertexMap`[protected]`

Definition at line 248 of file OgreEdgeListBuilder.h.

EdgeData* Ogre::EdgeListBuilder::mEdgeData`[protected]`

Definition at line 245 of file OgreEdgeListBuilder.h.

EdgeMap Ogre::EdgeListBuilder::mEdgeMap`[protected]`

Definition at line 253 of file OgreEdgeListBuilder.h.

GeometryList Ogre::EdgeListBuilder::mGeometryList`[protected]`

Definition at line 242 of file OgreEdgeListBuilder.h.

VertexDataList Ogre::EdgeListBuilder::mVertexDataList`[protected]`

Definition at line 243 of file OgreEdgeListBuilder.h.

CommonVertexList Ogre::EdgeListBuilder::mVertices`[protected]`

Definition at line 244 of file OgreEdgeListBuilder.h.

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

- OgreEdgeListBuilder.h

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Sun May 8 2011 20:28:11