Code_TYMPAN  4.4.0
Industrial site acoustic simulation
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
GridAccelerator Class Reference

Regular grid Accelerator. More...

#include <GridAccelerator.h>

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

Public Member Functions

 GridAccelerator (std::vector< Shape * > *_initialMesh=NULL, BBox _globalBox=BBox())
 Constructor. More...
 
virtual ~GridAccelerator ()
 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...
 
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 Attributes

std::vector< Shape * > primitives
 Pointer to all the shapes (different from initialMesh) as it is reordered. More...
 
BBox globalBox
 Root bounding box. 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...
 

Private Member Functions

int posToVoxel (const vec3 &P, int axis) const
 
float voxelToPos (int p, int axis) const
 
int offset (int x, int y, int z) const
 

Private Attributes

int nVoxels [3]
 
BBox bounds
 
vec3 width
 
vec3 invWidth
 
Voxel ** voxels
 

Additional Inherited Members

- Protected Member Functions inherited from Accelerator
void defineLeafFunction ()
 To define leaf function. More...
 

Detailed Description

Regular grid Accelerator.

Definition at line 62 of file GridAccelerator.h.

Constructor & Destructor Documentation

◆ GridAccelerator()

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

Constructor.

Definition at line 20 of file GridAccelerator.cpp.

◆ ~GridAccelerator()

virtual GridAccelerator::~GridAccelerator ( )
inlinevirtual

Destructor.

Definition at line 69 of file GridAccelerator.h.

Member Function Documentation

◆ build()

bool GridAccelerator::build ( )
virtual

Build this accelerator.

Reimplemented from Accelerator.

Definition at line 29 of file GridAccelerator.cpp.

Here is the call graph for this function:

◆ getMaxPrimPerLeaf()

int GridAccelerator::getMaxPrimPerLeaf ( )
inline

Get maximal primitives per leaf.

Definition at line 98 of file GridAccelerator.h.

◆ getMaxProfondeur()

int GridAccelerator::getMaxProfondeur ( )
inline

Get maximal depth.

Definition at line 88 of file GridAccelerator.h.

◆ offset()

int GridAccelerator::offset ( int  x,
int  y,
int  z 
) const
inlineprivate

Definition at line 135 of file GridAccelerator.h.

Here is the caller graph for this function:

◆ posToVoxel()

int GridAccelerator::posToVoxel ( const vec3 &  P,
int  axis 
) const
inlineprivate

Definition at line 126 of file GridAccelerator.h.

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

◆ print()

void GridAccelerator::print ( )

Print (not implemented)

◆ setMaxPrimPerLeaf()

void GridAccelerator::setMaxPrimPerLeaf ( int  _maxPrimPerLeaf)
inline

Set maximal primitives per leaf.

Definition at line 93 of file GridAccelerator.h.

◆ setMaxProfondeur()

void GridAccelerator::setMaxProfondeur ( int  _maxProfondeur)
inline

Set maximal depth.

Definition at line 83 of file GridAccelerator.h.

◆ traverse()

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

Run this accelerator.

Reimplemented from Accelerator.

Definition at line 91 of file GridAccelerator.cpp.

Here is the call graph for this function:

◆ voxelToPos()

float GridAccelerator::voxelToPos ( int  p,
int  axis 
) const
inlineprivate

Definition at line 131 of file GridAccelerator.h.

Here is the caller graph for this function:

Member Data Documentation

◆ bounds

BBox GridAccelerator::bounds
private

Definition at line 142 of file GridAccelerator.h.

◆ globalBox

BBox GridAccelerator::globalBox
protected

Root bounding box.

Definition at line 113 of file GridAccelerator.h.

◆ invWidth

vec3 GridAccelerator::invWidth
private

Definition at line 143 of file GridAccelerator.h.

◆ maxPrimPerLeaf

int GridAccelerator::maxPrimPerLeaf
protected

Maximal primitives per leaf.

Definition at line 116 of file GridAccelerator.h.

◆ maxProfondeur

int GridAccelerator::maxProfondeur
protected

Maximal depth.

Definition at line 115 of file GridAccelerator.h.

◆ nVoxels

int GridAccelerator::nVoxels[3]
private

Definition at line 141 of file GridAccelerator.h.

◆ primitives

std::vector<Shape*> GridAccelerator::primitives
protected

Pointer to all the shapes (different from initialMesh) as it is reordered.

Definition at line 112 of file GridAccelerator.h.

◆ realMaxProfondeur

int GridAccelerator::realMaxProfondeur
protected

Real maximal depth.

Definition at line 118 of file GridAccelerator.h.

◆ voxels

Voxel** GridAccelerator::voxels
private

Definition at line 144 of file GridAccelerator.h.

◆ width

vec3 GridAccelerator::width
private

Definition at line 143 of file GridAccelerator.h.


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