3 #include <LightKDTreeNode.h>
4 #include <KDTreeNode.h>
5 #include <KDTreeNodeRoot.h>
6 #include <LightKDTreeNodeBlockAllocator.h>
26 friend class boost::serialization::access;
33 template <
class Archive>
34 void serialize(Archive &ar,
const unsigned int version) {
36 ar.template register_type<LightKDTreeNode>();
37 ar.template register_type<KDTreeNode>();
38 ar.template register_type<KDTreeNodeRoot>();
95 vector<Primitive *> &primitives,
96 bool const computeStats=
false,
97 bool const reportStats=
false
112 vector<Primitive *>
const &primitives,
113 bool const computeStats=
false,
114 bool const reportStats=
false
117 vector<Primitive *> prims = primitives;
153 {
if(node !=
nullptr) child = node;}
Class that must be extended by any class which provides factory methods for k-dimensional trees....
Definition: KDTreeFactory.h:22
virtual bool isBuildingLightNodes()
Check if KDTreeFactory is building light nodes.
Definition: KDTreeFactory.h:128
void serialize(Archive &ar, const unsigned int version)
Serialize a KDTree factory to a stream of bytes.
Definition: KDTreeFactory.h:34
virtual KDTreeFactory * clone() const =0
Create a clone of the KDTreeFactory.
LightKDTreeNodeBlockAllocator lkdtnBlockAllocator
The block allocator to speed-up lighten of KDTree by reducing allocation calls when instantiating mul...
Definition: KDTreeFactory.h:63
virtual void setChild(LightKDTreeNode *&child, KDTreeNode *node)
Set child to given node if and only if node is not null. It must be used to assign children nodes in ...
Definition: KDTreeFactory.h:152
virtual void lighten(KDTreeNodeRoot *root)
Rebuild all children of given root KDTree node as LightKDTeeeNode nodes.
Definition: KDTreeFactory.cpp:32
virtual void setBuildingLightNodes(bool const buildLightNodes)
Set KDTreeFactory so it build light nodes (true) or not (false)
Definition: KDTreeFactory.h:134
virtual KDTreeNodeRoot * makeFromPrimitivesUnsafe(vector< Primitive * > &primitives, bool const computeStats=false, bool const reportStats=false)=0
Build a KDTree from given primitives.
bool buildLightNodes
When it is true, the KDTreeFactory is expected to build light nodes. It is, built KDTree must have a ...
Definition: KDTreeFactory.h:56
virtual LightKDTreeNode * _lighten(KDTreeNode *node)
Assist KDTreeFactory::lighten function by handling the lighten of a given non-root node.
Definition: KDTreeFactory.cpp:5
KDTreeFactory()
K dimensional tree factory default constructor.
Definition: KDTreeFactory.h:71
virtual KDTreeNodeRoot * makeFromPrimitives(vector< Primitive * > const &primitives, bool const computeStats=false, bool const reportStats=false)
Safe wrapper from makeFromPrimitivesUnsafe which handles a copy to make from primitives by default....
Definition: KDTreeFactory.h:111
Class representing the root node of a KDTree.
Definition: KDTreeNodeRoot.h:12
Class representing a KDTree node.
Definition: KDTreeNode.h:9
Block allocator for LightKDTreeNode instances.
Definition: LightKDTreeNodeBlockAllocator.h:12
Class representing a light KDTree node. It is, the basic representation of a KDTree node with uses le...
Definition: LightKDTreeNode.h:28