Public Member Functions | Static Public Member Functions | Static Protected Attributes | Private Types | Private Member Functions | Private Attributes
Ogre::PMWorker Class Reference

Processes requests. More...

#include <OgreQueuedProgressiveMeshGenerator.h>

Inheritance diagram for Ogre::PMWorker:
Inheritance graph
[legend]

List of all members.

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
void * operator new (size_t sz)
void * operator new (size_t sz, void *ptr)
 placement operator new
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info
void * operator new[] (size_t sz)

Static Public Member Functions

static PMWorkergetSingleton (void)
 Override standard Singleton retrieval.
static PMWorkergetSingletonPtr (void)
 Override standard Singleton retrieval.

Static Protected Attributes

static PMWorkermsSingleton

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.
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)
PMTrianglefindSideTriangle (const PMVertex *v1, const PMVertex *v2)
virtual void generateAutoconfiguredLodLevels (MeshPtr &mesh)
 Generates the LOD levels for a mesh without configuring it.
void generateLodLevels (LodConfig &lodConfig)
virtual void getAutoconfig (MeshPtr &inMesh, LodConfig &outLodConfig)
 Fills LOD Config with a config, which works on any mesh.
PMEdgegetPointer (VEdges::iterator it)
int getTriangleID (PMTriangle *triangle)
WorkQueue::ResponsehandleRequest (const WorkQueue::Request *req, const WorkQueue *srcQ)
 The handler method every subclass must implement.
bool hasSrcID (unsigned int srcID, unsigned short submeshID)
void initialize ()
bool isBorderVertex (const PMVertex *vertex) const
bool isDuplicateTriangle (PMTriangle *triangle, PMTriangle *triangle2)
PMTriangleisDuplicateTriangle (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.
PMGenRequestmRequest
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

Definition at line 118 of file OgreProgressiveMeshGenerator.h.

Definition at line 124 of file OgreProgressiveMeshGenerator.h.

Definition at line 125 of file OgreProgressiveMeshGenerator.h.

typedef vector<PMTriangle>::type Ogre::ProgressiveMeshGenerator::TriangleList [protected, inherited]

Definition at line 116 of file OgreProgressiveMeshGenerator.h.

Definition at line 117 of file OgreProgressiveMeshGenerator.h.

typedef VectorSet<PMEdge, 8> Ogre::ProgressiveMeshGenerator::VEdges [protected, inherited]

Definition at line 121 of file OgreProgressiveMeshGenerator.h.

typedef vector<PMVertex>::type Ogre::ProgressiveMeshGenerator::VertexList [protected, inherited]

Definition at line 113 of file OgreProgressiveMeshGenerator.h.

typedef vector<PMVertex*>::type Ogre::ProgressiveMeshGenerator::VertexLookupList [protected, inherited]

Definition at line 119 of file OgreProgressiveMeshGenerator.h.

Definition at line 122 of file OgreProgressiveMeshGenerator.h.


Constructor & Destructor Documentation

virtual Ogre::PMWorker::~PMWorker ( ) [virtual]

Member Function Documentation

void Ogre::ProgressiveMeshGenerator::addEdge ( PMVertex v,
const PMEdge edge 
) [protected, inherited]
void Ogre::PMWorker::addIndexBuffer ( PMGenRequest::IndexBuffer indexBuffer,
bool  useSharedVertexLookup,
unsigned short  submeshID 
) [private]
void Ogre::ProgressiveMeshGenerator::addIndexData ( IndexData indexData,
bool  useSharedVertexLookup,
unsigned short  submeshID 
) [protected, inherited]
template<typename IndexType >
void Ogre::ProgressiveMeshGenerator::addIndexDataImpl ( IndexType *  iPos,
const IndexType *  iEnd,
VertexLookupList lookup,
unsigned short  submeshID 
) [protected, inherited]
void Ogre::ProgressiveMeshGenerator::addTriangleToEdges ( PMTriangle triangle) [protected, inherited]
void Ogre::PMWorker::addVertexBuffer ( const PMGenRequest::VertexBuffer vertexBuffer,
bool  useSharedVertexLookup 
) [private]
void Ogre::ProgressiveMeshGenerator::addVertexData ( VertexData vertexData,
bool  useSharedVertexLookup 
) [protected, inherited]
void Ogre::ProgressiveMeshGenerator::assertOutdatedCollapseCost ( PMVertex vertex) [protected, inherited]
void Ogre::ProgressiveMeshGenerator::assertValidMesh ( ) [protected, inherited]
void Ogre::ProgressiveMeshGenerator::assertValidVertex ( PMVertex v) [protected, inherited]
void Ogre::PMWorker::bakeLods ( ) [private, virtual]

Reimplemented from Ogre::ProgressiveMeshGenerator.

void Ogre::PMWorker::buildRequest ( LodConfig lodConfigs) [private]
size_t Ogre::ProgressiveMeshGenerator::calcLodVertexCount ( const LodLevel lodConfig) [protected, inherited]
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().

void Ogre::ProgressiveMeshGenerator::cleanupMemory ( ) [protected, inherited]
void Ogre::ProgressiveMeshGenerator::collapse ( PMVertex vertex) [protected, inherited]
void Ogre::ProgressiveMeshGenerator::computeCosts ( ) [protected, inherited]
Real Ogre::ProgressiveMeshGenerator::computeEdgeCollapseCost ( PMVertex src,
PMEdge dstEdge 
) [protected, inherited]
void Ogre::ProgressiveMeshGenerator::computeLods ( LodConfig lodConfigs) [protected, inherited]
void Ogre::ProgressiveMeshGenerator::computeVertexCollapseCost ( PMVertex vertex) [protected, inherited]
size_t Ogre::ProgressiveMeshGenerator::findDstID ( unsigned int  srcID,
unsigned short  submeshID 
) [protected, inherited]
PMTriangle* Ogre::ProgressiveMeshGenerator::findSideTriangle ( const PMVertex v1,
const PMVertex v2 
) [protected, inherited]

Generates the LOD levels for a mesh without configuring it.

Parameters:
meshGenerate the LOD for this mesh.
void Ogre::ProgressiveMeshGenerator::generateLodLevels ( LodConfig lodConfig) [virtual, inherited]

Generates the LOD levels for a mesh.

Parameters:
lodConfigSpecification of the requested LOD levels.

Implements Ogre::ProgressiveMeshGeneratorBase.

virtual void Ogre::ProgressiveMeshGeneratorBase::getAutoconfig ( MeshPtr inMesh,
LodConfig outLodConfig 
) [virtual, inherited]

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

Parameters:
inMeshOptimize for this mesh.
outLodConfigLOD configuration storing the output.
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.

Reimplemented from Ogre::Singleton< PMWorker >.

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.

Reimplemented from Ogre::Singleton< PMWorker >.

int Ogre::ProgressiveMeshGenerator::getTriangleID ( PMTriangle triangle) [protected, inherited]
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:
reqThe 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.
srcQThe 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.

bool Ogre::ProgressiveMeshGenerator::hasSrcID ( unsigned int  srcID,
unsigned short  submeshID 
) [protected, inherited]
void Ogre::PMWorker::initialize ( ) [private]

Reimplemented from Ogre::ProgressiveMeshGenerator.

bool Ogre::ProgressiveMeshGenerator::isBorderVertex ( const PMVertex vertex) const [protected, inherited]
bool Ogre::ProgressiveMeshGenerator::isDuplicateTriangle ( PMTriangle triangle,
PMTriangle triangle2 
) [protected, inherited]
template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr) [inherited]

Definition at line 96 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
) [inherited]

Definition at line 102 of file OgreMemoryAllocatedObject.h.

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.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr) [inherited]

Definition at line 113 of file OgreMemoryAllocatedObject.h.

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.

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.

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

Definition at line 73 of file OgreMemoryAllocatedObject.h.

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.

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.

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

Definition at line 91 of file OgreMemoryAllocatedObject.h.

void Ogre::ProgressiveMeshGenerator::printTriangle ( PMTriangle triangle,
stringstream str 
) [protected, inherited]
void Ogre::ProgressiveMeshGenerator::removeEdge ( PMVertex v,
const PMEdge edge 
) [protected, inherited]
void Ogre::ProgressiveMeshGenerator::removeTriangleFromEdges ( PMTriangle triangle,
PMVertex skip = NULL 
) [protected, inherited]
void Ogre::ProgressiveMeshGenerator::replaceVertexID ( PMTriangle triangle,
unsigned int  oldID,
unsigned int  newID,
PMVertex dst 
) [protected, inherited]

Reimplemented from Ogre::ProgressiveMeshGenerator.


Member Data Documentation

Definition at line 120 of file OgreQueuedProgressiveMeshGenerator.h.

Definition at line 198 of file OgreProgressiveMeshGenerator.h.

Definition at line 213 of file OgreProgressiveMeshGenerator.h.

Definition at line 200 of file OgreProgressiveMeshGenerator.h.

Definition at line 202 of file OgreProgressiveMeshGenerator.h.

Definition at line 212 of file OgreProgressiveMeshGenerator.h.

The name of the mesh being processed.

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

Definition at line 210 of file OgreProgressiveMeshGenerator.h.

Definition at line 119 of file OgreQueuedProgressiveMeshGenerator.h.

Definition at line 193 of file OgreProgressiveMeshGenerator.h.

PMWorker * Ogre::Singleton< PMWorker >::msSingleton [static, protected, inherited]

Definition at line 75 of file OgreSingleton.h.

Definition at line 196 of file OgreProgressiveMeshGenerator.h.

Definition at line 197 of file OgreProgressiveMeshGenerator.h.

Definition at line 195 of file OgreProgressiveMeshGenerator.h.

Definition at line 194 of file OgreProgressiveMeshGenerator.h.

Definition at line 199 of file OgreProgressiveMeshGenerator.h.


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

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Mon Jul 27 2020 13:41:30