Ogre::PMWorker Class Reference

Processes requests. More...

`#include <OgreQueuedProgressiveMeshGenerator.h>`

Inheritance diagram for Ogre::PMWorker:
[legend]

## Public Member Functions

| PMWorker ()
virtual | ~PMWorker ()
void | addRequestToQueue (PMGenRequest *request)
void | clearPendingLodRequests ()
void | operator delete (void *ptr)
void | operator delete (void *ptr, void *)
void | operator delete (void *ptr, const char *, int, const char *)
void | operator delete[] (void *ptr)
void | operator delete[] (void *ptr, const char *, int, const char *)
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info More...
void * | operator new (size_t sz)
void * | operator new (size_t sz, void *ptr)
| placement operator new More...
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info More...
void * | operator new[] (size_t sz)

## Static Public Member Functions

static PMWorker & | getSingleton (void)
| Override standard Singleton retrieval. More...
static PMWorker * | getSingletonPtr (void)
| Override standard Singleton retrieval. More...

## Static Protected Attributes

static PMWorker * | msSingleton

## Private Types

typedef multimap< Real, PMVertex * >::type | CollapseCostHeap
typedef vector< PMCollapsedEdge >::type | CollapsedEdges
typedef vector< PMIndexBufferInfo >::type | IndexBufferInfoList
typedef vector< PMTriangle >::type | TriangleList
typedef HashSet< PMVertex *, PMVertexHash, PMVertexEqual > | UniqueVertexSet
typedef VectorSet< PMEdge, 8 > | VEdges
typedef vector< PMVertex >::type | VertexList
typedef vector< PMVertex * >::type | VertexLookupList
typedef VectorSet< PMTriangle *, 7 > | VTriangles

## Private Member Functions

void | addEdge (PMVertex *v, const PMEdge &edge)
void | addIndexBuffer (PMGenRequest::IndexBuffer &indexBuffer, bool useSharedVertexLookup, unsigned short submeshID)
void | addIndexData (IndexData *indexData, bool useSharedVertexLookup, unsigned short submeshID)
template<typename IndexType >
void | addIndexDataImpl (IndexType *iPos, const IndexType *iEnd, VertexLookupList &lookup, unsigned short submeshID)
void | addTriangleToEdges (PMTriangle *triangle)
void | addVertexBuffer (const PMGenRequest::VertexBuffer &vertexBuffer, bool useSharedVertexLookup)
void | addVertexData (VertexData *vertexData, bool useSharedVertexLookup)
void | assertOutdatedCollapseCost (PMVertex *vertex)
void | assertValidMesh ()
void | assertValidVertex (PMVertex *v)
void | bakeLods ()
void | buildRequest (LodConfig &lodConfigs)
size_t | calcLodVertexCount (const LodLevel &lodConfig)
virtual bool | canHandleRequest (const Request *req, const WorkQueue *srcQ)
| Return whether this handler can process a given request. More...
void | cleanupMemory ()
void | collapse (PMVertex *vertex)
void | computeCosts ()
Real | computeEdgeCollapseCost (PMVertex *src, PMEdge *dstEdge)
void | computeLods (LodConfig &lodConfigs)
void | computeVertexCollapseCost (PMVertex *vertex)
size_t | findDstID (unsigned int srcID, unsigned short submeshID)
PMTriangle * | findSideTriangle (const PMVertex *v1, const PMVertex *v2)
virtual void | generateAutoconfiguredLodLevels (MeshPtr &mesh)
| Generates the LOD levels for a mesh without configuring it. More...
void | generateLodLevels (LodConfig &lodConfig)
| Generates the LOD levels for a mesh. More...
virtual void | getAutoconfig (MeshPtr &inMesh, LodConfig &outLodConfig)
| Fills LOD Config with a config, which works on any mesh. More...
PMEdge * | getPointer (VEdges::iterator it)
int | getTriangleID (PMTriangle *triangle)
WorkQueue::Response * | handleRequest (const WorkQueue::Request *req, const WorkQueue *srcQ)
| The handler method every subclass must implement. More...
bool | hasSrcID (unsigned int srcID, unsigned short submeshID)
void | initialize ()
bool | isBorderVertex (const PMVertex *vertex) const
bool | isDuplicateTriangle (PMTriangle *triangle, PMTriangle *triangle2)
PMTriangle * | isDuplicateTriangle (PMTriangle *triangle)
void | printTriangle (PMTriangle *triangle, stringstream &str)
void | removeEdge (PMVertex *v, const PMEdge &edge)
void | removeTriangleFromEdges (PMTriangle *triangle, PMVertex *skip=NULL)
void | replaceVertexID (PMTriangle *triangle, unsigned int oldID, unsigned int newID, PMVertex *dst)
void | tuneContainerSize ()
void | updateVertexCollapseCost (PMVertex *src)

## Private Attributes

ushort | mChannelID
CollapseCostHeap | mCollapseCostHeap
Real | mCollapseCostLimit
IndexBufferInfoList | mIndexBufferInfoList
MeshPtr | mMesh
Real | mMeshBoundingSphereRadius
String | mMeshName
| The name of the mesh being processed. More...
PMGenRequest * | mRequest
VertexLookupList | mSharedVertexLookup
TriangleList | mTriangleList
UniqueVertexSet | mUniqueVertexSet
VertexList | mVertexList
VertexLookupList | mVertexLookup
CollapsedEdges | tmpCollapsedEdges

## Detailed Description

Processes requests.

Definition at line 73 of file OgreQueuedProgressiveMeshGenerator.h.

## Member Typedef Documentation

## CollapseCostHeap

typedef multimap<Real, PMVertex*>::type Ogre::ProgressiveMeshGenerator::CollapseCostHeap

protected inherited

Definition at line 117 of file OgreProgressiveMeshGenerator.h.

## CollapsedEdges

typedef vector<PMCollapsedEdge>::type Ogre::ProgressiveMeshGenerator::CollapsedEdges

protected inherited

Definition at line 123 of file OgreProgressiveMeshGenerator.h.

## IndexBufferInfoList

typedef vector<PMIndexBufferInfo>::type Ogre::ProgressiveMeshGenerator::IndexBufferInfoList

protected inherited

Definition at line 124 of file OgreProgressiveMeshGenerator.h.

## TriangleList

typedef vector<PMTriangle>::type Ogre::ProgressiveMeshGenerator::TriangleList

protected inherited

Definition at line 115 of file OgreProgressiveMeshGenerator.h.

## UniqueVertexSet

typedef HashSet<PMVertex*, PMVertexHash, PMVertexEqual> Ogre::ProgressiveMeshGenerator::UniqueVertexSet

protected inherited

Definition at line 116 of file OgreProgressiveMeshGenerator.h.

## VEdges

typedef VectorSet<PMEdge, 8> Ogre::ProgressiveMeshGenerator::VEdges

protected inherited

Definition at line 120 of file OgreProgressiveMeshGenerator.h.

## VertexList

typedef vector<PMVertex>::type Ogre::ProgressiveMeshGenerator::VertexList

protected inherited

Definition at line 112 of file OgreProgressiveMeshGenerator.h.

## VertexLookupList

typedef vector<PMVertex*>::type Ogre::ProgressiveMeshGenerator::VertexLookupList

protected inherited

Definition at line 118 of file OgreProgressiveMeshGenerator.h.

## VTriangles

typedef VectorSet<PMTriangle*, 7> Ogre::ProgressiveMeshGenerator::VTriangles

protected inherited

Definition at line 121 of file OgreProgressiveMeshGenerator.h.

## Constructor & Destructor Documentation

## PMWorker()

Ogre::PMWorker::PMWorker | ( |  | ) |

## ~PMWorker()

virtual Ogre::PMWorker::~PMWorker | ( |  | ) |

virtual

## Member Function Documentation

## addEdge()

void Ogre::ProgressiveMeshGenerator::addEdge | ( | PMVertex * | v,
|  | const PMEdge & | edge
| ) |  |

protected inherited

## addIndexBuffer()

void Ogre::PMWorker::addIndexBuffer | ( | PMGenRequest::IndexBuffer & | indexBuffer,
|  | bool | useSharedVertexLookup,
|  | unsigned short | submeshID
| ) |  |

private

## addIndexData()

void Ogre::ProgressiveMeshGenerator::addIndexData | ( | IndexData * | indexData,
|  | bool | useSharedVertexLookup,
|  | unsigned short | submeshID
| ) |  |

protected inherited

## addIndexDataImpl()

template<typename IndexType >

void Ogre::ProgressiveMeshGenerator::addIndexDataImpl | ( | IndexType * | iPos,
|  | const IndexType * | iEnd,
|  | VertexLookupList & | lookup,
|  | unsigned short | submeshID
| ) |  |

protected inherited

## addRequestToQueue()

void Ogre::PMWorker::addRequestToQueue | ( | PMGenRequest * | request | ) |

## addTriangleToEdges()

void Ogre::ProgressiveMeshGenerator::addTriangleToEdges | ( | PMTriangle * | triangle | ) |

protected inherited

## addVertexBuffer()

void Ogre::PMWorker::addVertexBuffer | ( | const PMGenRequest::VertexBuffer & | vertexBuffer,
|  | bool | useSharedVertexLookup
| ) |  |

private

## addVertexData()

void Ogre::ProgressiveMeshGenerator::addVertexData | ( | VertexData * | vertexData,
|  | bool | useSharedVertexLookup
| ) |  |

protected inherited

## assertOutdatedCollapseCost()

void Ogre::ProgressiveMeshGenerator::assertOutdatedCollapseCost | ( | PMVertex * | vertex | ) |

protected inherited

## assertValidMesh()

void Ogre::ProgressiveMeshGenerator::assertValidMesh | ( |  | ) |

protected inherited

## assertValidVertex()

void Ogre::ProgressiveMeshGenerator::assertValidVertex | ( | PMVertex * | v | ) |

protected inherited

## bakeLods()

void Ogre::PMWorker::bakeLods | ( |  | ) |

private virtual

Reimplemented from Ogre::ProgressiveMeshGenerator.

## buildRequest()

void Ogre::PMWorker::buildRequest | ( | LodConfig & | lodConfigs | ) |

private

## calcLodVertexCount()

size_t Ogre::ProgressiveMeshGenerator::calcLodVertexCount | ( | const LodLevel & | lodConfig | ) |

protected inherited

## canHandleRequest()

virtual bool Ogre::WorkQueue::RequestHandler::canHandleRequest | ( | const Request * | req,
|  | const WorkQueue * | srcQ
| ) |  |

virtual inherited

Return whether this handler can process a given request.

Remarks
  Defaults to true, but if you wish to add several handlers each of which deal with different types of request, you can override this method.

Reimplemented in Ogre::Terrain, Ogre::TerrainGroup, Ogre::ResourceBackgroundQueue, Ogre::Page, and Ogre::TerrainLodManager.

Definition at line 173 of file OgreWorkQueue.h.

References Ogre::WorkQueue::Request::getAborted().

## cleanupMemory()

void Ogre::ProgressiveMeshGenerator::cleanupMemory | ( |  | ) |

protected inherited

## clearPendingLodRequests()

void Ogre::PMWorker::clearPendingLodRequests | ( |  | ) |

## collapse()

void Ogre::ProgressiveMeshGenerator::collapse | ( | PMVertex * | vertex | ) |

protected inherited

## computeCosts()

void Ogre::ProgressiveMeshGenerator::computeCosts | ( |  | ) |

protected inherited

## computeEdgeCollapseCost()

Real Ogre::ProgressiveMeshGenerator::computeEdgeCollapseCost | ( | PMVertex * | src,
|  | PMEdge * | dstEdge
| ) |  |

protected inherited

## computeLods()

void Ogre::ProgressiveMeshGenerator::computeLods | ( | LodConfig & | lodConfigs | ) |

protected inherited

## computeVertexCollapseCost()

void Ogre::ProgressiveMeshGenerator::computeVertexCollapseCost | ( | PMVertex * | vertex | ) |

protected inherited

## findDstID()

size_t Ogre::ProgressiveMeshGenerator::findDstID | ( | unsigned int | srcID,
|  | unsigned short | submeshID
| ) |  |

protected inherited

## findSideTriangle()

PMTriangle* Ogre::ProgressiveMeshGenerator::findSideTriangle | ( | const PMVertex * | v1,
|  | const PMVertex * | v2
| ) |  |

protected inherited

## generateAutoconfiguredLodLevels()

virtual void Ogre::ProgressiveMeshGeneratorBase::generateAutoconfiguredLodLevels | ( | MeshPtr & | mesh | ) |

virtual inherited

Generates the LOD levels for a mesh without configuring it.

Parameters

  mesh | Generate the LOD for this mesh.

## generateLodLevels()

void Ogre::ProgressiveMeshGenerator::generateLodLevels | ( | LodConfig & | lodConfig | ) |

virtual inherited

Generates the LOD levels for a mesh.

Parameters

  lodConfig | Specification of the requested LOD levels.

Implements Ogre::ProgressiveMeshGeneratorBase.

## getAutoconfig()

virtual void Ogre::ProgressiveMeshGeneratorBase::getAutoconfig | ( | MeshPtr & | inMesh,
|  | LodConfig & | outLodConfig
| ) |  |

virtual inherited

Fills LOD Config with a config, which works on any mesh.

Parameters

  inMesh | Optimize for this mesh.
  outLodConfig | LOD configuration storing the output.

## getPointer()

PMEdge* Ogre::ProgressiveMeshGenerator::getPointer | ( | VEdges::iterator | it | ) |

protected inherited

## getSingleton()

static PMWorker& Ogre::PMWorker::getSingleton | ( | void |  | ) |

static

Override standard Singleton retrieval.

Remarks
  Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.

  This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

## getSingletonPtr()

static PMWorker* Ogre::PMWorker::getSingletonPtr | ( | void |  | ) |

static

Override standard Singleton retrieval.

Remarks
  Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.

  This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

## getTriangleID()

int Ogre::ProgressiveMeshGenerator::getTriangleID | ( | PMTriangle * | triangle | ) |

protected inherited

## handleRequest()

WorkQueue::Response* Ogre::PMWorker::handleRequest | ( | const WorkQueue::Request * | req,
|  | const WorkQueue * | srcQ
| ) |  |

private virtual

The handler method every subclass must implement.

If a failure is encountered, return a Response with a failure result rather than raise an exception.

Parameters

  req | The Request structure, which is effectively owned by the handler during this call. It must be attached to the returned Response regardless of success or failure.
  srcQ | The work queue that this request originated from

Returns
  Pointer to a Response object - the caller is responsible for deleting the object.

Implements Ogre::WorkQueue::RequestHandler.

## hasSrcID()

bool Ogre::ProgressiveMeshGenerator::hasSrcID | ( | unsigned int | srcID,
|  | unsigned short | submeshID
| ) |  |

protected inherited

## initialize()

void Ogre::PMWorker::initialize | ( |  | ) |

private

## isBorderVertex()

bool Ogre::ProgressiveMeshGenerator::isBorderVertex | ( | const PMVertex * | vertex | ) | const

protected inherited

## isDuplicateTriangle() [1/2]

bool Ogre::ProgressiveMeshGenerator::isDuplicateTriangle | ( | PMTriangle * | triangle,
|  | PMTriangle * | triangle2
| ) |  |

protected inherited

## isDuplicateTriangle() [2/2]

PMTriangle* Ogre::ProgressiveMeshGenerator::isDuplicateTriangle | ( | PMTriangle * | triangle | ) |

protected inherited

## operator delete() [1/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) |

inherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

## operator delete() [2/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | void * |
| ) |  |

inherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

## operator delete() [3/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  |

inherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

## operator delete[]() [1/2]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) |

inherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

## operator delete[]() [2/2]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  |

inherited

Definition at line 119 of file OgreMemoryAllocatedObject.h.

## operator new() [1/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  |

inherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

## operator new() [2/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) |

inherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

## operator new() [3/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | void * | ptr
| ) |  |

inherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

## operator new[]() [1/2]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  |

inherited

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

## operator new[]() [2/2]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) |

inherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.

## printTriangle()

void Ogre::ProgressiveMeshGenerator::printTriangle | ( | PMTriangle * | triangle,
|  | stringstream & | str
| ) |  |

protected inherited

## removeEdge()

void Ogre::ProgressiveMeshGenerator::removeEdge | ( | PMVertex * | v,
|  | const PMEdge & | edge
| ) |  |

protected inherited

## removeTriangleFromEdges()

void Ogre::ProgressiveMeshGenerator::removeTriangleFromEdges | ( | PMTriangle * | triangle,
|  | PMVertex * | skip = `NULL`
| ) |  |

protected inherited

## replaceVertexID()

void Ogre::ProgressiveMeshGenerator::replaceVertexID | ( | PMTriangle * | triangle,
|  | unsigned int | oldID,
|  | unsigned int | newID,
|  | PMVertex * | dst
| ) |  |

protected inherited

## tuneContainerSize()

void Ogre::PMWorker::tuneContainerSize | ( |  | ) |

private

## updateVertexCollapseCost()

void Ogre::ProgressiveMeshGenerator::updateVertexCollapseCost | ( | PMVertex * | src | ) |

protected inherited

## Member Data Documentation

## mChannelID

ushort Ogre::PMWorker::mChannelID

private

Definition at line 120 of file OgreQueuedProgressiveMeshGenerator.h.

## mCollapseCostHeap

CollapseCostHeap Ogre::ProgressiveMeshGenerator::mCollapseCostHeap

protected inherited

Definition at line 197 of file OgreProgressiveMeshGenerator.h.

## mCollapseCostLimit

Real Ogre::ProgressiveMeshGenerator::mCollapseCostLimit

protected inherited

Definition at line 212 of file OgreProgressiveMeshGenerator.h.

## mIndexBufferInfoList

IndexBufferInfoList Ogre::ProgressiveMeshGenerator::mIndexBufferInfoList

protected inherited

Definition at line 199 of file OgreProgressiveMeshGenerator.h.

## mMesh

MeshPtr Ogre::ProgressiveMeshGenerator::mMesh

protected inherited

Definition at line 201 of file OgreProgressiveMeshGenerator.h.

## mMeshBoundingSphereRadius

Real Ogre::ProgressiveMeshGenerator::mMeshBoundingSphereRadius

protected inherited

Definition at line 211 of file OgreProgressiveMeshGenerator.h.

## mMeshName

String Ogre::ProgressiveMeshGenerator::mMeshName

protected inherited

The name of the mesh being processed.

This is separate from mMesh in order to allow for access from background threads.

Definition at line 209 of file OgreProgressiveMeshGenerator.h.

## mRequest

PMGenRequest* Ogre::PMWorker::mRequest

private

Definition at line 119 of file OgreQueuedProgressiveMeshGenerator.h.

## mSharedVertexLookup

VertexLookupList Ogre::ProgressiveMeshGenerator::mSharedVertexLookup

protected inherited

Definition at line 192 of file OgreProgressiveMeshGenerator.h.

## msSingleton

PMWorker * Ogre::Singleton< PMWorker >::msSingleton

static protected inherited

Definition at line 75 of file OgreSingleton.h.

## mTriangleList

TriangleList Ogre::ProgressiveMeshGenerator::mTriangleList

protected inherited

Definition at line 195 of file OgreProgressiveMeshGenerator.h.

## mUniqueVertexSet

UniqueVertexSet Ogre::ProgressiveMeshGenerator::mUniqueVertexSet

protected inherited

Definition at line 196 of file OgreProgressiveMeshGenerator.h.

## mVertexList

VertexList Ogre::ProgressiveMeshGenerator::mVertexList

protected inherited

Definition at line 194 of file OgreProgressiveMeshGenerator.h.

## mVertexLookup

VertexLookupList Ogre::ProgressiveMeshGenerator::mVertexLookup

protected inherited

Definition at line 193 of file OgreProgressiveMeshGenerator.h.

## tmpCollapsedEdges

CollapsedEdges Ogre::ProgressiveMeshGenerator::tmpCollapsedEdges

protected inherited

Definition at line 198 of file OgreProgressiveMeshGenerator.h.

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

- OgreQueuedProgressiveMeshGenerator.h

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