6 #include <boost/archive/text_iarchive.hpp> 7 #include <boost/archive/text_oarchive.hpp> 8 #include <boost/serialization/vector.hpp> 10 #include "Primitive.h" 19 friend class boost::serialization::access;
20 template<
class Archive>
21 void serialize(Archive & ar,
const unsigned int version) {
int splitAxis
Space axis to consider at current depth.
Definition: KDTreeNode.h:49
KDTreeNode * right
Definition: KDTreeNode.h:41
std::vector< Primitive * > primitives
Vector of primitives associated with the node.
Definition: KDTreeNode.h:53
static KDTreeNode * buildRecursive(std::vector< Primitive *> primitives, int depth)
Recursively build a KDTree for given primitives.
Definition: KDTreeNode.cpp:12
void computeKDTreeStats(KDTreeNode *root, int depth=0)
Analyze KDTree computing its max depth and the minimum and maximum number of primitives considering a...
Definition: KDTreeNode.cpp:75
KDTreeNode * left
Pointer to node at left side on space partition. Can be nullptr if there is no left side node...
Definition: KDTreeNode.h:36
double splitPos
Point position at corresponding split axis.
Definition: KDTreeNode.h:45
Class representing a KDTree node.
Definition: KDTreeNode.h:16
static KDTreeNode * readObject(std::string path)
Import a serialized KDTree from file.
Definition: KDTreeNode.cpp:103
void writeObject(std::string path)
Serialize KDTree.
Definition: KDTreeNode.cpp:96