Helios++
Helios software for LiDAR simulations
|
Class representing a KDTree node. More...
#include <KDTreeNode.h>
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 KDTreeNode * | buildRecursive (std::vector< Primitive *> primitives, int depth) |
Recursively build a KDTree for given primitives. More... | |
static KDTreeNode * | readObject (std::string path) |
Import a serialized KDTree from file. More... | |
Public Attributes | |
KDTreeNode * | left = nullptr |
Pointer to node at left side on space partition. Can be nullptr if there is no left side node. | |
KDTreeNode * | right = 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 |
Class representing a KDTree node.
|
static |
Recursively build a KDTree for given primitives.
primitives | Primitives to build KDTree splitting them |
depth | Current depth at build process. Useful for tracking recursion level |
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.
root | Root node |
depth | Current depth. Useful for tracking since computations require recursive analysis of KDTree |
|
static |
Import a serialized KDTree from file.
path | Path to the file containing a serialized KDTree |
void KDTreeNode::writeObject | ( | std::string | path | ) |
Serialize KDTree.
path | Path to file where the serialized KDTree must be exported |
KDTreeNode* KDTreeNode::right = nullptr |
Pointer to node at right side on space partition. Can be nullptr if there is no right side node