# Ogre::EdgeListBuilder Class Reference

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

`#include <OgreEdgeListBuilder.h>`

List of all members.

## 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 std::vector< const VertexData * > | VertexDataList
typedef std::vector< Geometry > | GeometryList
typedef std::vector< CommonVertex > | CommonVertexList
typedef std::map< Vector3, size_t, vectorLess > | CommonVertexMap
| Map for identifying common vertices.
typedef std::multimap< std::pair< size_t, size_t >, std::pair< size_t, size_t > > | 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 130 of file OgreEdgeListBuilder.h.

## Member Typedef Documentation

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

| Definition at line 207 of file OgreEdgeListBuilder.h.

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

| Map for identifying common vertices. Definition at line 214 of file OgreEdgeListBuilder.h.

typedef std::multimap< std::pair<size_t, size_t>, std::pair<size_t, size_t> > 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 219 of file OgreEdgeListBuilder.h.

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

| Definition at line 206 of file OgreEdgeListBuilder.h.

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

| Definition at line 205 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 215 of file OgreEdgeListBuilder.h.

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

| Definition at line 212 of file OgreEdgeListBuilder.h.

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

| Definition at line 220 of file OgreEdgeListBuilder.h.

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

| Definition at line 209 of file OgreEdgeListBuilder.h.

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

| Definition at line 210 of file OgreEdgeListBuilder.h.

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

| Definition at line 211 of file OgreEdgeListBuilder.h.

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

- OgreEdgeListBuilder.h

Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Feb 12 13:00:21 2006