open_iA  2019.12
A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
Public Member Functions | Public Attributes | Protected Attributes | List of all members
iABSPTree Class Reference

Class representing a BSP-tree. Assigned with root node, level and AABB. More...

#include <iABSPTree.h>

Collaboration diagram for iABSPTree:

Public Member Functions

void BuildTree (int a_splitLevel, iAaabb &a_aabb)
 Assigning split level and AABB to tree. More...
 
void FillLoadedTree (std::vector< iATriPrim * > &triangles)
 Fills already created tree with primitives. More...
 
void FillTree (std::vector< iATriPrim * > &triangles)
 Fills empty tree with primitives. More...
 
int GetIntersectionsNR (iARay &ray, std::vector< iAintersection * > &intersections, iATraverseStack *tr_stack) const
 Finds all intersections between ray and primitives of tree. More...
 
 iABSPTree ()
 
int LoadTree (QString const &filename)
 Loads tree from file specified by filename. More...
 
int SaveTree (QString const &filename)
 Saves tree in file specified by filename. More...
 
 ~iABSPTree ()
 

Public Attributes

iAaabb m_aabb
 tree AABB More...
 
std::vector< iABSPNode * > nodes
 
iABSPNoderoot
 root node More...
 
int splitLevel
 tree split level More...
 
std::vector< unsigned int > tri_ind
 

Protected Attributes

std::vector< iATriPrim * > * m_triangles
 

Detailed Description

Class representing a BSP-tree. Assigned with root node, level and AABB.

Constructor & Destructor Documentation

◆ iABSPTree()

iABSPTree::iABSPTree ( )
inline

◆ ~iABSPTree()

iABSPTree::~iABSPTree ( )
inline

Member Function Documentation

◆ BuildTree()

void iABSPTree::BuildTree ( int  a_splitLevel,
iAaabb a_aabb 
)
inline

Assigning split level and AABB to tree.

Note
only root node is created here, child nodes are not defined yet. Nodes are splited in FillTree function
See also
FillTree()
Parameters
a_splitLevelsplit level of tree.
a_aabbAABB of tree.

◆ FillLoadedTree()

void iABSPTree::FillLoadedTree ( std::vector< iATriPrim * > &  triangles)
inline

Fills already created tree with primitives.

Parameters
trianglesprimitives.

◆ FillTree()

void iABSPTree::FillTree ( std::vector< iATriPrim * > &  triangles)
inline

Fills empty tree with primitives.

New nodes are created and divided here

Parameters
trianglesprimitives.

◆ GetIntersectionsNR()

int iABSPTree::GetIntersectionsNR ( iARay ray,
std::vector< iAintersection * > &  intersections,
iATraverseStack tr_stack 
) const
inline

Finds all intersections between ray and primitives of tree.

Note
non recursive (stack based) tree traversal version
rd = 100000.f*ray.GetDirection()+ro;
Parameters
rayray instance.
[out]intersectionsvector where obtained intersections are placed.
tr_stack
Returns
1 if intersect tree AABB , 0 - otherwise

◆ LoadTree()

int iABSPTree::LoadTree ( QString const &  filename)
inline

Loads tree from file specified by filename.

Note
tree in file [splitLevel][aabb][num nodes][n0...nN][num tri inds][ti1...tiN]
Parameters
filenamefilename of input file
Returns
1 if succed , 0 - otherwise

◆ SaveTree()

int iABSPTree::SaveTree ( QString const &  filename)
inline

Saves tree in file specified by filename.

Note
tree in file [splitLevel][aabb][num nodes][n0...nN][num tri inds][ti1...tiN]
Parameters
filenamefilename of ouput file
Returns
1 if succed , 0 - otherwise

Member Data Documentation

◆ m_aabb

iAaabb iABSPTree::m_aabb

tree AABB

◆ m_triangles

std::vector<iATriPrim*>* iABSPTree::m_triangles
protected

◆ nodes

std::vector<iABSPNode*> iABSPTree::nodes

◆ root

iABSPNode* iABSPTree::root

root node

◆ splitLevel

int iABSPTree::splitLevel

tree split level

◆ tri_ind

std::vector<unsigned int> iABSPTree::tri_ind

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