Code_TYMPAN  4.4.0
Industrial site acoustic simulation
Public Member Functions | Private Attributes | List of all members
kdNode Struct Reference

Node structure (optimized to be stored on 2 bytes) More...

#include <KdtreeAccelerator.h>

Public Member Functions

bool isLeaf ()
 Return true if the node is a leaf. More...
 
bool isNode ()
 Return true if the node is a node. More...
 
unsigned int getNbPrimitives ()
 Return primitives number. More...
 
unsigned int AboveChild ()
 Return second child. More...
 
unsigned int * getPrims ()
 Get the primitives. More...
 
int getAxe ()
 Return the axis number of the separator plane (node) More...
 
float getAxeValue ()
 Return the axis value of the separator plane (node) More...
 
unsigned int getFirstIndex ()
 Return the index of the first node primitive (all) More...
 
void createLeaf (unsigned int _nbPrims, unsigned int _firstIndex, unsigned int *_prims)
 Leaf initialization. More...
 
void createNode (int axis, float _split, unsigned int nextChild)
 Node initialization. More...
 

Private Attributes

union {
   int   flag
 0 : node, x axis, 1 : node, y axis, 2 : node, z axis, 3 : leaf. 2 bits used More...
 
   unsigned int   secondChild
 Node : the first child is just after current node, second one is further. More...
 
   unsigned int   nbPrims
 Leaf : number of primitives. Use 30 bits integer. More...
 
}; 
 
union {
   float   split
 Node : separator axis value. More...
 
   unsigned int   firstIndex
 Leaf : index of the first primitive in the list. More...
 
   unsigned int *   prims
 Leaf : array containing primitives indexes. More...
 
}; 
 

Detailed Description

Node structure (optimized to be stored on 2 bytes)

Definition at line 28 of file KdtreeAccelerator.h.

Member Function Documentation

◆ AboveChild()

unsigned int kdNode::AboveChild ( )
inline

Return second child.

Definition at line 42 of file KdtreeAccelerator.h.

Here is the caller graph for this function:

◆ createLeaf()

void KDNode::createLeaf ( unsigned int  _nbPrims,
unsigned int  _firstIndex,
unsigned int *  _prims 
)

Leaf initialization.

Leaf initialization

Parameters
_nbPrimsNumber of primitives
_firstIndexFirst index of the primitive
_primsArray containing the primitives indexes

Definition at line 29 of file KdtreeAccelerator.cpp.

Here is the caller graph for this function:

◆ createNode()

void KDNode::createNode ( int  axis,
float  _split,
unsigned int  nextChild 
)

Node initialization.

Definition at line 43 of file KdtreeAccelerator.cpp.

◆ getAxe()

int kdNode::getAxe ( )
inline

Return the axis number of the separator plane (node)

Definition at line 50 of file KdtreeAccelerator.h.

Here is the caller graph for this function:

◆ getAxeValue()

float kdNode::getAxeValue ( )
inline

Return the axis value of the separator plane (node)

Definition at line 54 of file KdtreeAccelerator.h.

Here is the caller graph for this function:

◆ getFirstIndex()

unsigned int kdNode::getFirstIndex ( )
inline

Return the index of the first node primitive (all)

Definition at line 58 of file KdtreeAccelerator.h.

Here is the caller graph for this function:

◆ getNbPrimitives()

unsigned int kdNode::getNbPrimitives ( )
inline

Return primitives number.

Definition at line 38 of file KdtreeAccelerator.h.

Here is the caller graph for this function:

◆ getPrims()

unsigned int* kdNode::getPrims ( )
inline

Get the primitives.

Definition at line 46 of file KdtreeAccelerator.h.

Here is the caller graph for this function:

◆ isLeaf()

bool kdNode::isLeaf ( )
inline

Return true if the node is a leaf.

Definition at line 30 of file KdtreeAccelerator.h.

Here is the caller graph for this function:

◆ isNode()

bool kdNode::isNode ( )
inline

Return true if the node is a node.

Definition at line 34 of file KdtreeAccelerator.h.

Member Data Documentation

◆ 

union { ... }

◆ 

union { ... }

◆ firstIndex

unsigned int kdNode::firstIndex

Leaf : index of the first primitive in the list.

Definition at line 77 of file KdtreeAccelerator.h.

◆ flag

int kdNode::flag

0 : node, x axis, 1 : node, y axis, 2 : node, z axis, 3 : leaf. 2 bits used

Definition at line 68 of file KdtreeAccelerator.h.

◆ nbPrims

unsigned int kdNode::nbPrims

Leaf : number of primitives. Use 30 bits integer.

Definition at line 71 of file KdtreeAccelerator.h.

◆ prims

unsigned int* kdNode::prims

Leaf : array containing primitives indexes.

Definition at line 78 of file KdtreeAccelerator.h.

◆ secondChild

unsigned int kdNode::secondChild

Node : the first child is just after current node, second one is further.

Definition at line 70 of file KdtreeAccelerator.h.

◆ split

float kdNode::split

Node : separator axis value.

Definition at line 76 of file KdtreeAccelerator.h.


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