Class used to compute LOD of GlEntities with OpenMP parallelization.
More...
#include <GlCPULODCalculator.h>
List of all members.
Protected Member Functions |
virtual void | computeFor3DCamera (LayerLODUnit *layerLODUnit, const Coord &eye, const Matrix< float, 4 > transformMatrix, const Vector< int, 4 > &globalViewport, const Vector< int, 4 > ¤tViewport) |
virtual void | computeFor2DCamera (LayerLODUnit *layerLODUnit, const Vector< int, 4 > &globalViewport, const Vector< int, 4 > ¤tViewport) |
Detailed Description
Class used to compute LOD of GlEntities with OpenMP parallelization.
This class perform LOD computation of GlEntities based on screen projection of entities bounding boxes
- Warning:
- By default this class don't compute LOD for edges (for optimisation) and return a lod of 10. to these edges, if you want to compute edges' LOD call setComputeEdgesLOD(true)
Constructor & Destructor Documentation
tlp::GlCPULODCalculator::GlCPULODCalculator |
( |
| ) |
|
virtual tlp::GlCPULODCalculator::~GlCPULODCalculator |
( |
| ) |
|
|
virtual |
Member Function Documentation
virtual void tlp::GlCPULODCalculator::addEdgeBoundingBox |
( |
unsigned int |
id, |
|
|
const BoundingBox & |
bb |
|
) |
| |
|
virtual |
virtual void tlp::GlCPULODCalculator::addNodeBoundingBox |
( |
unsigned int |
id, |
|
|
const BoundingBox & |
bb |
|
) |
| |
|
virtual |
virtual void tlp::GlCPULODCalculator::addSimpleEntityBoundingBox |
( |
GlSimpleEntity * |
entity, |
|
|
const BoundingBox & |
bb |
|
) |
| |
|
virtual |
virtual void tlp::GlCPULODCalculator::beginNewCamera |
( |
Camera * |
camera | ) |
|
|
virtual |
Begin a new camera (use to render next entities)
virtual GlLODCalculator* tlp::GlCPULODCalculator::clone |
( |
| ) |
|
|
inlinevirtual |
virtual void tlp::GlCPULODCalculator::compute |
( |
const Vector< int, 4 > & |
globalViewport, |
|
|
const Vector< int, 4 > & |
currentViewport |
|
) |
| |
|
virtual |
Compute all bounding boxes If you want to compute LOD for a simple scene, you just have to call this function with same value on globalViewport and currentViewport But if you want to perform a sub screen part selection you have to call this function with : globalViewport the viewport of the visualisation and currentViewport the viewport of the selection
- Parameters:
-
globalViewport | is used to compute LOD |
currentViewport | : return -1 for all entities outside this viewport |
Reimplemented in tlp::GlQuadTreeLODCalculator.
virtual void tlp::GlCPULODCalculator::computeFor2DCamera |
( |
LayerLODUnit * |
layerLODUnit, |
|
|
const Vector< int, 4 > & |
globalViewport, |
|
|
const Vector< int, 4 > & |
currentViewport |
|
) |
| |
|
protectedvirtual |
virtual void tlp::GlCPULODCalculator::computeFor3DCamera |
( |
LayerLODUnit * |
layerLODUnit, |
|
|
const Coord & |
eye, |
|
|
const Matrix< float, 4 > |
transformMatrix, |
|
|
const Vector< int, 4 > & |
globalViewport, |
|
|
const Vector< int, 4 > & |
currentViewport |
|
) |
| |
|
protectedvirtual |
virtual BoundingBox tlp::GlCPULODCalculator::getSceneBoundingBox |
( |
| ) |
|
|
inlinevirtual |
This function return the scene bounding box
virtual void tlp::GlCPULODCalculator::reserveMemoryForEdges |
( |
unsigned int |
numberOfEdges | ) |
|
|
virtual |
Reserve memory to store edges LOD, this function is an optimisation function
virtual void tlp::GlCPULODCalculator::reserveMemoryForNodes |
( |
unsigned int |
numberOfNodes | ) |
|
|
virtual |
Reserve memory to store nodes LOD, this function is an optimisation function
void tlp::GlCPULODCalculator::setComputeEdgesLOD |
( |
bool |
state | ) |
|
|
inline |
Set if the edge LOD must be calculated at default the edge LOD is not calculated and return 10.
void tlp::GlCPULODCalculator::setComputeOutScreenLOD |
( |
bool |
state | ) |
|
|
inline |
Set if the LOD is computed for out screen entities
Member Data Documentation
bool tlp::GlCPULODCalculator::computeEdgesLOD |
|
protected |
bool tlp::GlCPULODCalculator::computeOutScreenLOD |
|
protected |
LayerLODUnit* tlp::GlCPULODCalculator::currentLayerLODUnit |
|
protected |
BoundingBox tlp::GlCPULODCalculator::sceneBoundingBox |
|
protected |
|