OGRE  1.9
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::PMWorker Class Reference

Processes requests. More...

#include <OgreQueuedProgressiveMeshGenerator.h>

+ Inheritance diagram for Ogre::PMWorker:
+ Collaboration diagram for Ogre::PMWorker:

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 PMWorkergetSingleton (void)
 Override standard Singleton retrieval. More...
 
static PMWorkergetSingletonPtr (void)
 Override standard Singleton retrieval. More...
 

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. 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)
 
PMTrianglefindSideTriangle (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...
 
PMEdgegetPointer (VEdges::iterator it)
 
int getTriangleID (PMTriangle *triangle)
 
WorkQueue::ResponsehandleRequest (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)
 
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. More...
 
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 116 of file OgreProgressiveMeshGenerator.h.

Definition at line 121 of file OgreProgressiveMeshGenerator.h.

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

Definition at line 113 of file OgreProgressiveMeshGenerator.h.

Definition at line 119 of file OgreProgressiveMeshGenerator.h.

Definition at line 122 of file OgreProgressiveMeshGenerator.h.

Constructor & Destructor Documentation

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

Member Function Documentation

void Ogre::ProgressiveMeshGenerator::addEdge ( PMVertex v,
const PMEdge edge 
)
protectedinherited
void Ogre::PMWorker::addIndexBuffer ( PMGenRequest::IndexBuffer indexBuffer,
bool  useSharedVertexLookup,
unsigned short  submeshID 
)
private
void Ogre::ProgressiveMeshGenerator::addIndexData ( IndexData indexData,
bool  useSharedVertexLookup,
unsigned short  submeshID 
)
protectedinherited
void Ogre::PMWorker::addRequestToQueue ( PMGenRequest request)
void Ogre::ProgressiveMeshGenerator::addTriangleToEdges ( PMTriangle triangle)
protectedinherited
void Ogre::PMWorker::addVertexBuffer ( const PMGenRequest::VertexBuffer vertexBuffer,
bool  useSharedVertexLookup 
)
private
void Ogre::ProgressiveMeshGenerator::addVertexData ( VertexData vertexData,
bool  useSharedVertexLookup 
)
protectedinherited
void Ogre::ProgressiveMeshGenerator::assertOutdatedCollapseCost ( PMVertex vertex)
protectedinherited
void Ogre::ProgressiveMeshGenerator::assertValidMesh ( )
protectedinherited
void Ogre::ProgressiveMeshGenerator::assertValidVertex ( PMVertex v)
protectedinherited
void Ogre::PMWorker::bakeLods ( )
privatevirtual

Reimplemented from Ogre::ProgressiveMeshGenerator.

void Ogre::PMWorker::buildRequest ( LodConfig lodConfigs)
private
size_t Ogre::ProgressiveMeshGenerator::calcLodVertexCount ( const LodLevel lodConfig)
protectedinherited
virtual bool Ogre::WorkQueue::RequestHandler::canHandleRequest ( const Request req,
const WorkQueue srcQ 
)
inlinevirtualinherited

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 ( )
protectedinherited
void Ogre::PMWorker::clearPendingLodRequests ( )
void Ogre::ProgressiveMeshGenerator::collapse ( PMVertex vertex)
protectedinherited
void Ogre::ProgressiveMeshGenerator::computeCosts ( )
protectedinherited
Real Ogre::ProgressiveMeshGenerator::computeEdgeCollapseCost ( PMVertex src,
PMEdge dstEdge 
)
protectedinherited
void Ogre::ProgressiveMeshGenerator::computeLods ( LodConfig lodConfigs)
protectedinherited
void Ogre::ProgressiveMeshGenerator::computeVertexCollapseCost ( PMVertex vertex)
protectedinherited
size_t Ogre::ProgressiveMeshGenerator::findDstID ( unsigned int  srcID,
unsigned short  submeshID 
)
protectedinherited
PMTriangle* Ogre::ProgressiveMeshGenerator::findSideTriangle ( const PMVertex v1,
const PMVertex v2 
)
protectedinherited
virtual void Ogre::ProgressiveMeshGeneratorBase::generateAutoconfiguredLodLevels ( MeshPtr mesh)
virtualinherited

Generates the LOD levels for a mesh without configuring it.

Parameters
meshGenerate the LOD for this mesh.
void Ogre::ProgressiveMeshGenerator::generateLodLevels ( LodConfig lodConfig)
virtualinherited

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 
)
virtualinherited

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

Parameters
inMeshOptimize for this mesh.
outLodConfigLOD configuration storing the output.
PMEdge* Ogre::ProgressiveMeshGenerator::getPointer ( VEdges::iterator  it)
protectedinherited
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.
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.
int Ogre::ProgressiveMeshGenerator::getTriangleID ( PMTriangle triangle)
protectedinherited
WorkQueue::Response* Ogre::PMWorker::handleRequest ( const WorkQueue::Request req,
const WorkQueue srcQ 
)
privatevirtual

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 
)
protectedinherited
void Ogre::PMWorker::initialize ( )
private
bool Ogre::ProgressiveMeshGenerator::isBorderVertex ( const PMVertex vertex) const
protectedinherited
bool Ogre::ProgressiveMeshGenerator::isDuplicateTriangle ( PMTriangle triangle,
PMTriangle triangle2 
)
protectedinherited
PMTriangle* Ogre::ProgressiveMeshGenerator::isDuplicateTriangle ( PMTriangle triangle)
protectedinherited
template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

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

Definition at line 102 of file OgreMemoryAllocatedObject.h.

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

Definition at line 108 of file OgreMemoryAllocatedObject.h.

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

Definition at line 113 of file OgreMemoryAllocatedObject.h.

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

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 
)
inlineinherited

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)
inlineinherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

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

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 
)
inlineinherited

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)
inlineinherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.

void Ogre::ProgressiveMeshGenerator::printTriangle ( PMTriangle triangle,
stringstream str 
)
protectedinherited
void Ogre::ProgressiveMeshGenerator::removeEdge ( PMVertex v,
const PMEdge edge 
)
protectedinherited
void Ogre::ProgressiveMeshGenerator::removeTriangleFromEdges ( PMTriangle triangle,
PMVertex skip = NULL 
)
protectedinherited
void Ogre::ProgressiveMeshGenerator::replaceVertexID ( PMTriangle triangle,
unsigned int  oldID,
unsigned int  newID,
PMVertex dst 
)
protectedinherited
void Ogre::PMWorker::tuneContainerSize ( )
private
void Ogre::ProgressiveMeshGenerator::updateVertexCollapseCost ( PMVertex src)
protectedinherited

Member Data Documentation

ushort Ogre::PMWorker::mChannelID
private

Definition at line 120 of file OgreQueuedProgressiveMeshGenerator.h.

CollapseCostHeap Ogre::ProgressiveMeshGenerator::mCollapseCostHeap
protectedinherited

Definition at line 198 of file OgreProgressiveMeshGenerator.h.

Real Ogre::ProgressiveMeshGenerator::mCollapseCostLimit
protectedinherited

Definition at line 213 of file OgreProgressiveMeshGenerator.h.

IndexBufferInfoList Ogre::ProgressiveMeshGenerator::mIndexBufferInfoList
protectedinherited

Definition at line 200 of file OgreProgressiveMeshGenerator.h.

MeshPtr Ogre::ProgressiveMeshGenerator::mMesh
protectedinherited

Definition at line 202 of file OgreProgressiveMeshGenerator.h.

Real Ogre::ProgressiveMeshGenerator::mMeshBoundingSphereRadius
protectedinherited

Definition at line 212 of file OgreProgressiveMeshGenerator.h.

String Ogre::ProgressiveMeshGenerator::mMeshName
protectedinherited

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.

PMGenRequest* Ogre::PMWorker::mRequest
private

Definition at line 119 of file OgreQueuedProgressiveMeshGenerator.h.

VertexLookupList Ogre::ProgressiveMeshGenerator::mSharedVertexLookup
protectedinherited

Definition at line 193 of file OgreProgressiveMeshGenerator.h.

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

Definition at line 75 of file OgreSingleton.h.

TriangleList Ogre::ProgressiveMeshGenerator::mTriangleList
protectedinherited

Definition at line 196 of file OgreProgressiveMeshGenerator.h.

UniqueVertexSet Ogre::ProgressiveMeshGenerator::mUniqueVertexSet
protectedinherited

Definition at line 197 of file OgreProgressiveMeshGenerator.h.

VertexList Ogre::ProgressiveMeshGenerator::mVertexList
protectedinherited

Definition at line 195 of file OgreProgressiveMeshGenerator.h.

VertexLookupList Ogre::ProgressiveMeshGenerator::mVertexLookup
protectedinherited

Definition at line 194 of file OgreProgressiveMeshGenerator.h.

CollapsedEdges Ogre::ProgressiveMeshGenerator::tmpCollapsedEdges
protectedinherited

Definition at line 199 of file OgreProgressiveMeshGenerator.h.


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