Helios++
Helios software for LiDAR simulations
SimpleKDTreeGeometricStrategy.h
1 #pragma once
2 
3 #include <SimpleKDTreeFactory.h>
4 #include <SharedTaskSequencer.h>
5 
16  // *** FRIENDS *** //
17  // ***************** //
18  friend class MultiThreadKDTreeFactory;
19 
20 protected:
21  // *** ATTRIBUTES *** //
22  // ******************** //
28 
29 public:
30  // *** CONSTRUCTION / DESTRUCTION *** //
31  // ************************************ //
38  kdtf(kdtf)
39  {}
40  virtual ~SimpleKDTreeGeometricStrategy() = default;
41 
42  // *** CLONE *** //
43  // *************** //
51  ) const;
52 
53 protected:
54  // *** GEOMETRY LEVEL BUILDING *** //
55  // ********************************* //
63  virtual void GEOM_defineSplit(
64  KDTreeNode *node,
65  KDTreeNode *parent,
66  vector<Primitive *> &primitives,
67  int const depth,
68  int const assignedThreads
69  ) const;
77  virtual void GEOM_computeNodeBoundaries(
78  KDTreeNode *node,
79  KDTreeNode *parent,
80  bool const left,
81  vector<Primitive *> const &primitives,
82  int assignedThreads
83  );
91  virtual void GEOM_populateSplits(
92  vector<Primitive *> const &primitives,
93  int const splitAxis,
94  double const splitPos,
95  vector<Primitive *> &leftPrimitives,
96  vector<Primitive *> &rightPrimitives,
97  int assignedThreads
98  ) const;
113  virtual void GEOM_buildChildrenNodes(
114  KDTreeNode *node,
115  KDTreeNode *parent,
116  vector<Primitive *> const &primitives,
117  int const depth,
118  int const index,
119  vector<Primitive *> &leftPrimitives,
120  vector<Primitive *> &rightPrimitives,
121  std::shared_ptr<SharedTaskSequencer> masters
122  );
123 };
Class representing a KDTree node.
Definition: KDTreeNode.h:9
Decorator for any KDTree factory which provides support for multi thread KDTree building.
Definition: MultiThreadKDTreeFactory.h:34
shared_ptr< SharedTaskSequencer > masters
All masters threads (except main thread) are handled by this shared task sequencer.
Definition: MultiThreadKDTreeFactory.h:118
Class providing building methods for simple k-dimensional trees.
Definition: SimpleKDTreeFactory.h:18
Class providing a strategy for geometry-level parallelization of Simple KDTree building....
Definition: SimpleKDTreeGeometricStrategy.h:15
virtual void GEOM_populateSplits(vector< Primitive * > const &primitives, int const splitAxis, double const splitPos, vector< Primitive * > &leftPrimitives, vector< Primitive * > &rightPrimitives, int assignedThreads) const
Geometry-level parallel version of the SimpleKDTreeFactory::populateSplits function.
Definition: SimpleKDTreeGeometricStrategy.cpp:156
virtual void GEOM_defineSplit(KDTreeNode *node, KDTreeNode *parent, vector< Primitive * > &primitives, int const depth, int const assignedThreads) const
Geometry-level parallel version of the SimpleKDTreeFactory::defineSplit function.
Definition: SimpleKDTreeGeometricStrategy.cpp:22
virtual SimpleKDTreeGeometricStrategy * clone(SimpleKDTreeFactory *kdtf) const
Create a clone of the SimpleKDTreeGeometricStrategy.
Definition: SimpleKDTreeGeometricStrategy.cpp:14
virtual void GEOM_computeNodeBoundaries(KDTreeNode *node, KDTreeNode *parent, bool const left, vector< Primitive * > const &primitives, int assignedThreads)
Geometry-level parallel version of the SimpleKDTreeFactory::computeNodeBoundaries function.
Definition: SimpleKDTreeGeometricStrategy.cpp:50
SimpleKDTreeGeometricStrategy(SimpleKDTreeFactory &kdtf)
SimpleKDTreeGeometricStrategy default constructor.
Definition: SimpleKDTreeGeometricStrategy.h:37
SimpleKDTreeFactory & kdtf
The simple KDTree factory to which geometric strategy shall be applied.
Definition: SimpleKDTreeGeometricStrategy.h:27
virtual void GEOM_buildChildrenNodes(KDTreeNode *node, KDTreeNode *parent, vector< Primitive * > const &primitives, int const depth, int const index, vector< Primitive * > &leftPrimitives, vector< Primitive * > &rightPrimitives, std::shared_ptr< SharedTaskSequencer > masters)
Geometry-level parallel version of the SimpleKDTreeFactory::buildChildrenNodes function.
Definition: SimpleKDTreeGeometricStrategy.cpp:245