Helios++
Helios software for LiDAR simulations
KDTreeNode Class Reference

Class representing a KDTree node. More...

#include <KDTreeNode.h>

Inheritance diagram for KDTreeNode:
Collaboration diagram for KDTreeNode:

Public Member Functions

void computeKDTreeStats (KDTreeNode *root, int depth=0)
 Analyze KDTree computing its max depth and the minimum and maximum number of primitives considering all nodes. More...
 
void writeObject (std::string path)
 Serialize KDTree. More...
 

Static Public Member Functions

static KDTreeNodebuildRecursive (std::vector< Primitive *> primitives, int depth)
 Recursively build a KDTree for given primitives. More...
 
static KDTreeNodereadObject (std::string path)
 Import a serialized KDTree from file. More...
 

Public Attributes

KDTreeNodeleft = nullptr
 Pointer to node at left side on space partition. Can be nullptr if there is no left side node.
 
KDTreeNoderight = nullptr
 
double splitPos = 0
 Point position at corresponding split axis.
 
int splitAxis = 0
 Space axis to consider at current depth.
 
std::vector< Primitive * > primitives
 Vector of primitives associated with the node.
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Friends

class boost::serialization::access
 

Detailed Description

Class representing a KDTree node.

Member Function Documentation

◆ buildRecursive()

KDTreeNode * KDTreeNode::buildRecursive ( std::vector< Primitive *>  primitives,
int  depth 
)
static

Recursively build a KDTree for given primitives.

Parameters
primitivesPrimitives to build KDTree splitting them
depthCurrent depth at build process. Useful for tracking recursion level
Returns
Built node

◆ computeKDTreeStats()

void KDTreeNode::computeKDTreeStats ( KDTreeNode root,
int  depth = 0 
)

Analyze KDTree computing its max depth and the minimum and maximum number of primitives considering all nodes.

Parameters
rootRoot node
depthCurrent depth. Useful for tracking since computations require recursive analysis of KDTree

◆ readObject()

KDTreeNode * KDTreeNode::readObject ( std::string  path)
static

Import a serialized KDTree from file.

Parameters
pathPath to the file containing a serialized KDTree
Returns
Imported KDTree

◆ writeObject()

void KDTreeNode::writeObject ( std::string  path)

Serialize KDTree.

Parameters
pathPath to file where the serialized KDTree must be exported

Member Data Documentation

◆ right

KDTreeNode* KDTreeNode::right = nullptr

Pointer to node at right side on space partition. Can be nullptr if there is no right side node


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