Class that must be extended by any class which provides factory methods for k-dimensional trees. Notice all KDTrees should be instantiated through corresponding factories.
More...
#include <KDTreeFactory.h>
|
template<class Archive > |
void | serialize (Archive &ar, const unsigned int version) |
| Serialize a KDTree factory to a stream of bytes. More...
|
|
|
class | boost::serialization::access |
|
Class that must be extended by any class which provides factory methods for k-dimensional trees. Notice all KDTrees should be instantiated through corresponding factories.
- Author
- Alberto M. Esmoris Pena
- Version
- 1.0
- See also
- KDTreeNodeRoot
◆ _lighten()
◆ clone()
◆ isBuildingLightNodes()
virtual bool KDTreeFactory::isBuildingLightNodes |
( |
| ) |
|
|
inlinevirtual |
◆ lighten()
◆ makeFromPrimitives()
virtual KDTreeNodeRoot* KDTreeFactory::makeFromPrimitives |
( |
vector< Primitive * > const & |
primitives, |
|
|
bool const |
computeStats = false , |
|
|
bool const |
reportStats = false |
|
) |
| |
|
inlinevirtual |
Safe wrapper from makeFromPrimitivesUnsafe which handles a copy to make from primitives by default. This function behavior might be overridden by any derived/child class. It is expected that any implementation of makeFromPrimitives provides a way to implement the makeFromPrimitivesUnsafe method without modifying vector of input primitives. Notice this does not mean primitives themselves cannot be modified, that depends on the type of KDTreeFactory. It only means that the vector itself will not be modified, for instance due to sorting purposes.
- See also
- KDTreeFactory::makeFromPrimitivesUnsafe
◆ makeFromPrimitivesUnsafe()
virtual KDTreeNodeRoot* KDTreeFactory::makeFromPrimitivesUnsafe |
( |
vector< Primitive * > & |
primitives, |
|
|
bool const |
computeStats = false , |
|
|
bool const |
reportStats = false |
|
) |
| |
|
pure virtual |
Build a KDTree from given primitives.
- Parameters
-
primitives | Primitives to build KDTree splitting them |
computeStats | If true, KDTree stats will be computed. If false, they will not |
reportStats | If true, KDTree stats will be reported. If false, they will not. Notice stats can only be reported if computeStats flag is setted to true too. |
- Returns
- Pointer to root node of built KDTree
Implemented in SimpleKDTreeFactory, and MultiThreadKDTreeFactory.
◆ serialize()
template<class Archive >
void KDTreeFactory::serialize |
( |
Archive & |
ar, |
|
|
const unsigned int |
version |
|
) |
| |
|
inlineprivate |
Serialize a KDTree factory to a stream of bytes.
- Template Parameters
-
- Parameters
-
ar | Specific rendering for the stream of bytes |
version | Version number for the K dimensional tree factory |
◆ setBuildingLightNodes()
virtual void KDTreeFactory::setBuildingLightNodes |
( |
bool const |
buildLightNodes | ) |
|
|
inlinevirtual |
◆ setChild()
Set child to given node if and only if node is not null. It must be used to assign children nodes in a thread-safe way.
When using a multi thread like KDTree factory, nullptr is used as a place holder for asynchronous node building tasks. But it might happen that built node is assigned before the place holder, so it will be substituted by nullptr and built node will be lost. This setter is specifically designed to prevent this scenario.
- Parameters
-
child | Reference to child pointer to be setted |
node | New value for the child pointer. If it is nullptr, then no set will be done. |
- See also
- MultiThreadKDTreeFactory
-
MultiThreadSAHKDTreeFactory
◆ buildLightNodes
bool KDTreeFactory::buildLightNodes = true |
|
protected |
◆ lkdtnBlockAllocator
The documentation for this class was generated from the following files: