Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::EdgeListBuilder Class Reference

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

#include <OgreEdgeListBuilder.h>

List of all members.

Public Methods

 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.

EdgeDatabuild (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< const
IndexData * > 
IndexDataList
typedef std::vector< CommonVertexCommonVertexList
typedef std::vector< RenderOperation::OperationTypeOperationTypeList

Protected Methods

void buildTrianglesEdges (size_t indexSet, size_t vertexSet)
void connectEdges (void)
EdgeData::EdgefindEdge (size_t sharedIndex1, size_t sharedIndex2)
size_t findOrCreateCommonVertex (const Vector3 &vec, size_t vertexSet)
 Finds an existing common vertex, or inserts a new one.


Protected Attributes

IndexDataList mIndexDataList
OperationTypeList mOperationTypeList
std::vector< size_t > mIndexDataVertexDataSetList
VertexDataList mVertexDataList
CommonVertexList mVertices
EdgeDatamEdgeData


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


Member Typedef Documentation

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

Definition at line 173 of file OgreEdgeListBuilder.h.

typedef std::vector<const IndexData*> Ogre::EdgeListBuilder::IndexDataList [protected]
 

Definition at line 172 of file OgreEdgeListBuilder.h.

typedef std::vector<RenderOperation::OperationType> Ogre::EdgeListBuilder::OperationTypeList [protected]
 

Definition at line 174 of file OgreEdgeListBuilder.h.

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

Definition at line 171 of file OgreEdgeListBuilder.h.


Constructor & Destructor Documentation

Ogre::EdgeListBuilder::EdgeListBuilder  
 

Definition at line 73 of file OgreEdgeListBuilder.cpp.

Ogre::EdgeListBuilder::~EdgeListBuilder   [virtual]
 

Definition at line 77 of file OgreEdgeListBuilder.cpp.


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)

Definition at line 86 of file OgreEdgeListBuilder.cpp.

References mIndexDataList, mIndexDataVertexDataSetList, and mOperationTypeList.

Referenced by Ogre::Mesh::buildEdgeList().

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.

Definition at line 81 of file OgreEdgeListBuilder.cpp.

References mVertexDataList.

Referenced by Ogre::Mesh::buildEdgeList().

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.

Definition at line 94 of file OgreEdgeListBuilder.cpp.

References buildTrianglesEdges(), connectEdges(), Ogre::EdgeData::edgeGroups, mEdgeData, mIndexDataList, mIndexDataVertexDataSetList, and mVertexDataList.

Referenced by Ogre::Mesh::buildEdgeList().

void Ogre::EdgeListBuilder::buildTrianglesEdges size_t    indexSet,
size_t    vertexSet
[protected]
 

Definition at line 170 of file OgreEdgeListBuilder.cpp.

References Ogre::VertexElement::baseVertexPointerToElement(), Ogre::EdgeData::Edge::degenerate, Ogre::EdgeData::edgeGroups, Ogre::VertexDeclaration::findElementBySemantic(), findOrCreateCommonVertex(), Ogre::VertexBufferBinding::getBuffer(), Ogre::VertexElement::getSource(), Ogre::IndexData::indexBuffer, Ogre::IndexData::indexCount, Ogre::EdgeData::Triangle::indexSet, mEdgeData, mIndexDataList, mOperationTypeList, mVertexDataList, Ogre::EdgeData::Triangle::normal, Ogre::Real, Ogre::EdgeData::Edge::sharedVertIndex, Ogre::EdgeData::Triangle::sharedVertIndex, Ogre::EdgeData::triangles, Ogre::EdgeData::Edge::triIndex, Ogre::VertexData::vertexBufferBinding, Ogre::VertexData::vertexDeclaration, Ogre::EdgeData::Triangle::vertexSet, Ogre::EdgeData::Edge::vertIndex, Ogre::EdgeData::Triangle::vertIndex, Ogre::VES_POSITION, Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.

Referenced by build().

void Ogre::EdgeListBuilder::connectEdges void    [protected]
 

Definition at line 361 of file OgreEdgeListBuilder.cpp.

References Ogre::EdgeData::Edge::degenerate, findEdge(), mEdgeData, Ogre::EdgeData::Triangle::sharedVertIndex, Ogre::EdgeData::triangles, and Ogre::EdgeData::Edge::triIndex.

Referenced by build().

EdgeData::Edge * Ogre::EdgeListBuilder::findEdge size_t    sharedIndex1,
size_t    sharedIndex2
[protected]
 

Definition at line 405 of file OgreEdgeListBuilder.cpp.

References Ogre::EdgeData::edgeGroups, mEdgeData, and Ogre::EdgeData::Edge::sharedVertIndex.

Referenced by connectEdges().

size_t Ogre::EdgeListBuilder::findOrCreateCommonVertex const Vector3   vec,
size_t    vertexSet
[protected]
 

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

Definition at line 334 of file OgreEdgeListBuilder.cpp.

References Ogre::EdgeListBuilder::CommonVertex::index, mVertices, Ogre::EdgeListBuilder::CommonVertex::position, Ogre::EdgeListBuilder::CommonVertex::vertexSet, Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.

Referenced by buildTrianglesEdges().

void Ogre::EdgeListBuilder::log Log   l
 

Debugging method.

Definition at line 486 of file OgreEdgeListBuilder.cpp.

References Ogre::VertexElement::baseVertexPointerToElement(), Ogre::VertexDeclaration::findElementBySemantic(), Ogre::VertexBufferBinding::getBuffer(), Ogre::VertexElement::getSource(), Ogre::EdgeListBuilder::CommonVertex::index, Ogre::IndexData::indexBuffer, Ogre::IndexData::indexCount, Ogre::Log::logMessage(), mIndexDataList, mIndexDataVertexDataSetList, mOperationTypeList, mVertexDataList, mVertices, Ogre::EdgeListBuilder::CommonVertex::position, Ogre::Real, Ogre::VertexData::vertexBufferBinding, Ogre::VertexData::vertexCount, Ogre::VertexData::vertexDeclaration, Ogre::EdgeListBuilder::CommonVertex::vertexSet, and Ogre::VES_POSITION.


Member Data Documentation

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

Definition at line 181 of file OgreEdgeListBuilder.h.

Referenced by build(), buildTrianglesEdges(), connectEdges(), and findEdge().

IndexDataList Ogre::EdgeListBuilder::mIndexDataList [protected]
 

Definition at line 176 of file OgreEdgeListBuilder.h.

Referenced by addIndexData(), build(), buildTrianglesEdges(), and log().

std::vector<size_t> Ogre::EdgeListBuilder::mIndexDataVertexDataSetList [protected]
 

Definition at line 178 of file OgreEdgeListBuilder.h.

Referenced by addIndexData(), build(), and log().

OperationTypeList Ogre::EdgeListBuilder::mOperationTypeList [protected]
 

Definition at line 177 of file OgreEdgeListBuilder.h.

Referenced by addIndexData(), buildTrianglesEdges(), and log().

VertexDataList Ogre::EdgeListBuilder::mVertexDataList [protected]
 

Definition at line 179 of file OgreEdgeListBuilder.h.

Referenced by addVertexData(), build(), buildTrianglesEdges(), and log().

CommonVertexList Ogre::EdgeListBuilder::mVertices [protected]
 

Definition at line 180 of file OgreEdgeListBuilder.h.

Referenced by findOrCreateCommonVertex(), and log().


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

Copyright © 2002-2003 by The OGRE Team
Last modified Fri May 14 23:26:02 2004