Code_TYMPAN  4.2.0
Industrial site acoustic simulation
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
KdtreeAccelerator Class Reference

K-d tree Accelerator (based on space splitting) More...

#include <KdtreeAccelerator.h>

Inheritance diagram for KdtreeAccelerator:
Inheritance graph
[legend]
Collaboration diagram for KdtreeAccelerator:
Collaboration graph
[legend]

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< InfoPrimtablePrimitive
 List of primitives and their bounding box. More...
 
std::vector< BBoxtableBox
 Bounding boxes list of the tree. More...
 
std::vector< KDNodetableNode
 
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...
 

Detailed Description

K-d tree Accelerator (based on space splitting)

Definition at line 120 of file KdtreeAccelerator.h.

Constructor & Destructor Documentation

◆ KdtreeAccelerator()

KdtreeAccelerator::KdtreeAccelerator ( std::vector< Shape *> *  _initialMesh = NULL,
BBox  _globalBox = BBox() 
)

Constructor.

Definition at line 48 of file KdtreeAccelerator.cpp.

◆ ~KdtreeAccelerator()

KdtreeAccelerator::~KdtreeAccelerator ( )
virtual

Destructor.

Definition at line 67 of file KdtreeAccelerator.cpp.

Member Function Documentation

◆ build()

bool KdtreeAccelerator::build ( )
virtual

Build this accelerator.

Reimplemented from Accelerator.

Definition at line 72 of file KdtreeAccelerator.cpp.

Here is the call graph for this function:

◆ generateMidKdTree()

void KdtreeAccelerator::generateMidKdTree ( int  currentProfondeur,
BBox localBox,
unsigned int  nbPrims,
unsigned int *  prims 
)
protected

Generate the tree by middle subdivision.

Definition at line 106 of file KdtreeAccelerator.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateSAHKdTree()

void KdtreeAccelerator::generateSAHKdTree ( int  currentProfondeur,
BBox localBox,
TaBRecBoundEdge edges[3],
unsigned int  nbPrims,
unsigned int *  prims 
)
protected

Generate the tree with SAH (Surface Area Heuristic) method.

Definition at line 316 of file KdtreeAccelerator.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBBox()

std::vector<BBox>& KdtreeAccelerator::getBBox ( )
inline

Get the vector of bounding boxes.

Definition at line 143 of file KdtreeAccelerator.h.

◆ getMaxPrimPerLeaf()

int KdtreeAccelerator::getMaxPrimPerLeaf ( )
inline

Get maximal primitives per leaf.

Definition at line 141 of file KdtreeAccelerator.h.

◆ getMaxProfondeur()

int KdtreeAccelerator::getMaxProfondeur ( )
inline

Get maximal depth.

Definition at line 136 of file KdtreeAccelerator.h.

◆ print()

void KdtreeAccelerator::print ( )

Print the tree (not implemented yet)

Definition at line 296 of file KdtreeAccelerator.cpp.

◆ setMaxPrimPerLeaf()

void KdtreeAccelerator::setMaxPrimPerLeaf ( int  _maxPrimPerLeaf)
inline

Set maximal primitives per leaf.

Definition at line 139 of file KdtreeAccelerator.h.

◆ setMaxProfondeur()

void KdtreeAccelerator::setMaxProfondeur ( int  _maxProfondeur)
inline

Set maximal depth.

Definition at line 134 of file KdtreeAccelerator.h.

◆ traverse()

decimal KdtreeAccelerator::traverse ( Ray r,
std::list< Intersection > &  result 
) const
virtual

Run this accelerator.

Reimplemented from Accelerator.

Definition at line 177 of file KdtreeAccelerator.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ alreadyFail

bool KdtreeAccelerator::alreadyFail

Unused attribute.

Definition at line 147 of file KdtreeAccelerator.h.

◆ emptyBonus

float KdtreeAccelerator::emptyBonus
protected

Parameter for best splitting.

Definition at line 170 of file KdtreeAccelerator.h.

◆ initialMesh

std::vector<Shape*>* KdtreeAccelerator::initialMesh
protected

Pointer to the mesh.

Definition at line 157 of file KdtreeAccelerator.h.

◆ isectCost

float KdtreeAccelerator::isectCost
protected

Parameter for best splitting.

Definition at line 169 of file KdtreeAccelerator.h.

◆ maxPrimPerLeaf

int KdtreeAccelerator::maxPrimPerLeaf
protected

Maximal primitives per leaf.

Definition at line 165 of file KdtreeAccelerator.h.

◆ maxProfondeur

int KdtreeAccelerator::maxProfondeur
protected

Maximal depth.

Definition at line 164 of file KdtreeAccelerator.h.

◆ nbFail

unsigned int KdtreeAccelerator::nbFail

Unused attribute.

Definition at line 148 of file KdtreeAccelerator.h.

◆ r

Ray KdtreeAccelerator::r

Unused attribute.

Definition at line 149 of file KdtreeAccelerator.h.

◆ realMaxProfondeur

int KdtreeAccelerator::realMaxProfondeur
protected

Real max depth.

Definition at line 167 of file KdtreeAccelerator.h.

◆ tableBox

std::vector<BBox> KdtreeAccelerator::tableBox
protected

Bounding boxes list of the tree.

Definition at line 161 of file KdtreeAccelerator.h.

◆ tableNode

std::vector<KDNode> KdtreeAccelerator::tableNode
protected

Definition at line 162 of file KdtreeAccelerator.h.

◆ tablePrimitive

std::vector<InfoPrim> KdtreeAccelerator::tablePrimitive
protected

List of primitives and their bounding box.

Definition at line 160 of file KdtreeAccelerator.h.

◆ trace

bool KdtreeAccelerator::trace

Unused attribute.

Definition at line 150 of file KdtreeAccelerator.h.

◆ traversalCost

float KdtreeAccelerator::traversalCost
protected

Parameter for best splitting.

Definition at line 171 of file KdtreeAccelerator.h.


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