Ogre::EdgeListBuilder Class Reference
Core » Math

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

`#include <OgreEdgeListBuilder.h>`

## 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 | 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. More...
void | addVertexData (const VertexData *vertexData)
| Add a set of vertex geometry data to the edge builder. More...
EdgeData * | build (void)
| Builds the edge information based on the information built up so far. More...
void | log (Log *l)
| Debugging method. More...

## Protected Types

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

## Protected Member Functions

void | buildTrianglesEdges (const Geometry &geometry)
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. More...
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. More...

## Protected Attributes

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

## 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 169 of file OgreEdgeListBuilder.h.

## Member Typedef Documentation

## CommonVertexList

typedef vector<CommonVertex>::type Ogre::EdgeListBuilder::CommonVertexList

protected

Definition at line 246 of file OgreEdgeListBuilder.h.

## CommonVertexMap

typedef map<Vector3, size_t, vectorLess>::type Ogre::EdgeListBuilder::CommonVertexMap

protected

Map for identifying common vertices.

Definition at line 253 of file OgreEdgeListBuilder.h.

## EdgeMap

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 258 of file OgreEdgeListBuilder.h.

## GeometryList

typedef vector<Geometry>::type Ogre::EdgeListBuilder::GeometryList

protected

Definition at line 245 of file OgreEdgeListBuilder.h.

## VertexDataList

typedef vector<const VertexData*>::type Ogre::EdgeListBuilder::VertexDataList

protected

Definition at line 244 of file OgreEdgeListBuilder.h.

## Constructor & Destructor Documentation

## EdgeListBuilder()

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

## ~EdgeListBuilder()

virtual Ogre::EdgeListBuilder::~EdgeListBuilder | ( |  | ) |

virtual

## Member Function Documentation

## addIndexData()

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)

## addVertexData()

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.

## build()

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.

## buildTrianglesEdges()

void Ogre::EdgeListBuilder::buildTrianglesEdges | ( | const Geometry & | geometry | ) |

protected

## connectOrCreateEdge()

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.

## findOrCreateCommonVertex()

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.

## log()

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

Debugging method.

## Member Data Documentation

## mCommonVertexMap

CommonVertexMap Ogre::EdgeListBuilder::mCommonVertexMap

protected

Definition at line 254 of file OgreEdgeListBuilder.h.

## mEdgeData

EdgeData* Ogre::EdgeListBuilder::mEdgeData

protected

Definition at line 251 of file OgreEdgeListBuilder.h.

## mEdgeMap

EdgeMap Ogre::EdgeListBuilder::mEdgeMap

protected

Definition at line 259 of file OgreEdgeListBuilder.h.

## mGeometryList

GeometryList Ogre::EdgeListBuilder::mGeometryList

protected

Definition at line 248 of file OgreEdgeListBuilder.h.

## mVertexDataList

VertexDataList Ogre::EdgeListBuilder::mVertexDataList

protected

Definition at line 249 of file OgreEdgeListBuilder.h.

## mVertices

CommonVertexList Ogre::EdgeListBuilder::mVertices

protected

Definition at line 250 of file OgreEdgeListBuilder.h.

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

- OgreEdgeListBuilder.h

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.