|
Code_TYMPAN
4.4.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 93 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 168 of file BvhAccelerator.cpp.
|
inlinevirtual |
Destructor.
Definition at line 41 of file BvhAccelerator.h.
|
virtual |
Build this accelerator.
Reimplemented from Accelerator.
Definition at line 478 of file BvhAccelerator.cpp.

|
protected |
|
inline |
Get the vector of bounding boxes.
Definition at line 71 of file BvhAccelerator.h.
|
inline |
Get maximal primitives per leaf.
Definition at line 66 of file BvhAccelerator.h.
|
inline |
Get maximal depth.
Definition at line 56 of file BvhAccelerator.h.
| void BvhAccelerator::print | ( | ) |
Print not implemented:
|
protected |
Definition at line 197 of file BvhAccelerator.cpp.


|
inline |
Set maximal primitives per leaf.
Definition at line 61 of file BvhAccelerator.h.
|
inline |
Set maximal depth.
Definition at line 51 of file BvhAccelerator.h.
|
virtual |
Run this accelerator.
Reimplemented from Accelerator.
Definition at line 397 of file BvhAccelerator.cpp.

|
protected |
Global bounding box.
Definition at line 104 of file BvhAccelerator.h.
|
protected |
Maximal primitives per leaf.
Definition at line 109 of file BvhAccelerator.h.
|
protected |
Maximal primitives in node.
Definition at line 92 of file BvhAccelerator.h.
|
protected |
Maximal depth.
Definition at line 108 of file BvhAccelerator.h.
|
protected |
Nodes list.
Definition at line 100 of file BvhAccelerator.h.
|
protected |
Pointer to all the shapes (different from initialMesh) as it is reordered.
Definition at line 103 of file BvhAccelerator.h.
|
protected |
Real maximal depth.
Definition at line 111 of file BvhAccelerator.h.
|
protected |
Split method.
Definition at line 99 of file BvhAccelerator.h.
|
protected |
Bounding boxes vector.
Definition at line 106 of file BvhAccelerator.h.