Code_TYMPAN
4.2.0
Industrial site acoustic simulation
|
A Bounding Volume Hierarchy (BVH) Accelerator. More...
#include <BvhAccelerator.h>
Public Member Functions | |
BvhAccelerator (std::vector< Shape *> *_initialMesh=NULL, BBox _globalBox=BBox(), unsigned int maxProf=8, const string &sm="sah") | |
Default constructor. More... | |
virtual | ~BvhAccelerator () |
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 not implemented: 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) |
Protected Types | |
enum | SplitMethod { SPLIT_MIDDLE, SPLIT_EQUAL_COUNTS, SPLIT_SAH } |
Protected Member Functions | |
BVHBuildNode * | recursiveBuild (std::vector< BVHPrimitiveInfo > &buildData, unsigned int start, unsigned int end, unsigned int *totalNodes, std::vector< Shape * > &orderedPrims) |
unsigned int | flattenBVHTree (BVHBuildNode *node, unsigned int *offset) |
Protected Member Functions inherited from Accelerator | |
void | defineLeafFunction () |
To define leaf function. More... | |
Protected Attributes | |
unsigned int | maxPrimsInNode |
Maximal primitives in node. More... | |
SplitMethod | splitMethod |
Split method. More... | |
LinearBVHNode * | nodes |
Nodes list. More... | |
std::vector< Shape * > | primitives |
Pointer to all the shapes (different from initialMesh) as it is reordered. More... | |
BBox | globalBox |
Global bounding box. More... | |
std::vector< BBox > | tableBox |
Bounding boxes vector. More... | |
int | maxProfondeur |
Maximal depth. More... | |
int | maxPrimPerLeaf |
Maximal primitives per leaf. More... | |
int | realMaxProfondeur |
Real maximal depth. 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... | |
A Bounding Volume Hierarchy (BVH) Accelerator.
Definition at line 33 of file BvhAccelerator.h.
|
protected |
Enumerator | |
---|---|
SPLIT_MIDDLE | |
SPLIT_EQUAL_COUNTS | |
SPLIT_SAH |
Definition at line 73 of file BvhAccelerator.h.
BvhAccelerator::BvhAccelerator | ( | std::vector< Shape *> * | _initialMesh = NULL , |
BBox | _globalBox = BBox() , |
||
unsigned int | maxProf = 8 , |
||
const string & | sm = "sah" |
||
) |
Default constructor.
Definition at line 152 of file BvhAccelerator.cpp.
|
inlinevirtual |
Destructor.
Definition at line 40 of file BvhAccelerator.h.
|
virtual |
Build this accelerator.
Reimplemented from Accelerator.
Definition at line 439 of file BvhAccelerator.cpp.
|
protected |
|
inline |
Get the vector of bounding boxes.
Definition at line 55 of file BvhAccelerator.h.
|
inline |
Get maximal primitives per leaf.
Definition at line 53 of file BvhAccelerator.h.
|
inline |
Get maximal depth.
Definition at line 49 of file BvhAccelerator.h.
void BvhAccelerator::print | ( | ) |
Print not implemented:
|
protected |
Definition at line 172 of file BvhAccelerator.cpp.
|
inline |
Set maximal primitives per leaf.
Definition at line 51 of file BvhAccelerator.h.
|
inline |
Set maximal depth.
Definition at line 47 of file BvhAccelerator.h.
|
virtual |
Run this accelerator.
Reimplemented from Accelerator.
Definition at line 372 of file BvhAccelerator.cpp.
|
protected |
Global bounding box.
Definition at line 78 of file BvhAccelerator.h.
|
protected |
Maximal primitives per leaf.
Definition at line 83 of file BvhAccelerator.h.
|
protected |
Maximal primitives in node.
Definition at line 72 of file BvhAccelerator.h.
|
protected |
Maximal depth.
Definition at line 82 of file BvhAccelerator.h.
|
protected |
Nodes list.
Definition at line 75 of file BvhAccelerator.h.
|
protected |
Pointer to all the shapes (different from initialMesh) as it is reordered.
Definition at line 77 of file BvhAccelerator.h.
|
protected |
Real maximal depth.
Definition at line 85 of file BvhAccelerator.h.
|
protected |
Split method.
Definition at line 74 of file BvhAccelerator.h.
|
protected |
Bounding boxes vector.
Definition at line 80 of file BvhAccelerator.h.