Code_TYMPAN
4.2.0
Industrial site acoustic simulation
|
K-d tree Accelerator (based on space splitting) More...
#include <KdtreeAccelerator.h>
Public Member Functions | |
KdtreeAccelerator (std::vector< Shape *> *_initialMesh=NULL, BBox _globalBox=BBox()) | |
Constructor. More... | |
virtual | ~KdtreeAccelerator () |
Destructor. More... | |
virtual bool | build () |
Build this accelerator. More... | |
virtual decimal | traverse (Ray *r, std::list< Intersection > &result) const |
Run this accelerator. More... | |
void | setMaxProfondeur (int _maxProfondeur) |
Set maximal depth. More... | |
int | getMaxProfondeur () |
Get maximal depth. More... | |
void | setMaxPrimPerLeaf (int _maxPrimPerLeaf) |
Set maximal primitives per leaf. More... | |
int | getMaxPrimPerLeaf () |
Get maximal primitives per leaf. More... | |
std::vector< BBox > & | getBBox () |
Get the vector of bounding boxes. More... | |
void | print () |
Print the tree (not implemented yet) More... | |
Public Member Functions inherited from Accelerator | |
Accelerator () | |
Constructors. More... | |
Accelerator (std::vector< Shape *> *_shapes, BBox &_globalBox) | |
Accelerator (const Accelerator &other) | |
Copy constructor. More... | |
virtual | ~Accelerator () |
Destructor. More... | |
leafTreatment::treatment | getIntersectionChoice () |
Get/Set the Intersection choice. More... | |
void | setIntersectionChoice (leafTreatment::treatment _intersectionChoice=leafTreatment::FIRST) |
Public Attributes | |
bool | alreadyFail |
Unused attribute. More... | |
unsigned int | nbFail |
Unused attribute. More... | |
Ray | r |
Unused attribute. More... | |
bool | trace |
Unused attribute. More... | |
Protected Member Functions | |
void | generateMidKdTree (int currentProfondeur, BBox &localBox, unsigned int nbPrims, unsigned int *prims) |
Generate the tree by middle subdivision. More... | |
void | generateSAHKdTree (int currentProfondeur, BBox &localBox, TaBRecBoundEdge *edges[3], unsigned int nbPrims, unsigned int *prims) |
Generate the tree with SAH (Surface Area Heuristic) method. More... | |
Protected Member Functions inherited from Accelerator | |
void | defineLeafFunction () |
To define leaf function. More... | |
Protected Attributes | |
std::vector< Shape * > * | initialMesh |
Pointer to the mesh. More... | |
std::vector< InfoPrim > | tablePrimitive |
List of primitives and their bounding box. More... | |
std::vector< BBox > | tableBox |
Bounding boxes list of the tree. More... | |
std::vector< KDNode > | tableNode |
int | maxProfondeur |
Maximal depth. More... | |
int | maxPrimPerLeaf |
Maximal primitives per leaf. More... | |
int | realMaxProfondeur |
Real max depth. More... | |
float | isectCost |
Parameter for best splitting. More... | |
float | emptyBonus |
Parameter for best splitting. More... | |
float | traversalCost |
Parameter for best splitting. More... | |
Protected Attributes inherited from Accelerator | |
decimal(* | pLeafTreatmentFunction )(std::list< Intersection > &, decimal) |
Pointer to the treatment function of leaf. More... | |
leafTreatment::treatment | intersectionChoice |
Intersection choice. More... | |
std::vector< Shape * > * | shapes |
Vector of pointers to shapes. More... | |
BBox | globalBox |
Global bounding box. More... | |
K-d tree Accelerator (based on space splitting)
Definition at line 120 of file KdtreeAccelerator.h.
KdtreeAccelerator::KdtreeAccelerator | ( | std::vector< Shape *> * | _initialMesh = NULL , |
BBox | _globalBox = BBox() |
||
) |
Constructor.
Definition at line 48 of file KdtreeAccelerator.cpp.
|
virtual |
Destructor.
Definition at line 67 of file KdtreeAccelerator.cpp.
|
virtual |
Build this accelerator.
Reimplemented from Accelerator.
Definition at line 72 of file KdtreeAccelerator.cpp.
|
protected |
Generate the tree by middle subdivision.
Definition at line 106 of file KdtreeAccelerator.cpp.
|
protected |
Generate the tree with SAH (Surface Area Heuristic) method.
Definition at line 316 of file KdtreeAccelerator.cpp.
|
inline |
Get the vector of bounding boxes.
Definition at line 143 of file KdtreeAccelerator.h.
|
inline |
Get maximal primitives per leaf.
Definition at line 141 of file KdtreeAccelerator.h.
|
inline |
Get maximal depth.
Definition at line 136 of file KdtreeAccelerator.h.
void KdtreeAccelerator::print | ( | ) |
Print the tree (not implemented yet)
Definition at line 296 of file KdtreeAccelerator.cpp.
|
inline |
Set maximal primitives per leaf.
Definition at line 139 of file KdtreeAccelerator.h.
|
inline |
Set maximal depth.
Definition at line 134 of file KdtreeAccelerator.h.
|
virtual |
Run this accelerator.
Reimplemented from Accelerator.
Definition at line 177 of file KdtreeAccelerator.cpp.
bool KdtreeAccelerator::alreadyFail |
Unused attribute.
Definition at line 147 of file KdtreeAccelerator.h.
|
protected |
Parameter for best splitting.
Definition at line 170 of file KdtreeAccelerator.h.
|
protected |
Pointer to the mesh.
Definition at line 157 of file KdtreeAccelerator.h.
|
protected |
Parameter for best splitting.
Definition at line 169 of file KdtreeAccelerator.h.
|
protected |
Maximal primitives per leaf.
Definition at line 165 of file KdtreeAccelerator.h.
|
protected |
Maximal depth.
Definition at line 164 of file KdtreeAccelerator.h.
unsigned int KdtreeAccelerator::nbFail |
Unused attribute.
Definition at line 148 of file KdtreeAccelerator.h.
Ray KdtreeAccelerator::r |
Unused attribute.
Definition at line 149 of file KdtreeAccelerator.h.
|
protected |
Real max depth.
Definition at line 167 of file KdtreeAccelerator.h.
|
protected |
Bounding boxes list of the tree.
Definition at line 161 of file KdtreeAccelerator.h.
|
protected |
Definition at line 162 of file KdtreeAccelerator.h.
|
protected |
List of primitives and their bounding box.
Definition at line 160 of file KdtreeAccelerator.h.
bool KdtreeAccelerator::trace |
Unused attribute.
Definition at line 150 of file KdtreeAccelerator.h.
|
protected |
Parameter for best splitting.
Definition at line 171 of file KdtreeAccelerator.h.