Helios++
Helios software for LiDAR simulations
SimpleKDTreePopulateSplitsSubTask Class Reference

Shared sub-task to populate splits when building a Simple KDTree. It is meant to be used at geometry-level parallelization context and only for right child nodes. More...

#include <SimpleKDTreePopulateSplitsSubTask.h>

Inheritance diagram for SimpleKDTreePopulateSplitsSubTask:
Collaboration diagram for SimpleKDTreePopulateSplitsSubTask:

Public Member Functions

 SimpleKDTreePopulateSplitsSubTask (std::shared_ptr< SharedTaskSequencer > ch, vector< Primitive * > const &primitives, int const splitAxis, double const splitPos, vector< Primitive * > &leftPrimitives, vector< Primitive * > &rightPrimitives, size_t const startPrimitive, size_t const endPrimitive, std::function< void(Primitive *p, int const splitAxis, double const splitPos, vector< Primitive * > &leftPrimitives, vector< Primitive * > &rightPrimitives)> onPopulateSplitsDigestPrimitive)
 Main constructor for Simple KDTree populate splits sub-task.
 
void run () override
 Implementation of the populate splits method. More...
 
- Public Member Functions inherited from SharedSubTask
 SharedSubTask (std::shared_ptr< SharedSubTaskCompletionHandler > ch)
 Default constructor for shared sub-task. More...
 
virtual void operator() ()
 The functor that will be called by any thread. It calls the SharedSubTask::run method to solve/compute the sub-task. Also, once the task has been computed, it delegates upon the task completion handler. More...
 
virtual void postProcess ()
 Post-processing to be applied after shared sub-task has finished. By default it is a void function which does nothing, but it can be overridden.
 
virtual size_t getKey ()
 Obtain the key of the shared sub-task inside the shared task sequencer context. More...
 
virtual void setKey (size_t const key)
 Set the key of the shared sub-task inside the shared task sequencer context. More...
 
virtual std::shared_ptr< boost::thread > getThread ()
 Get the thread associated to the shared sub-task. More...
 
virtual void setThread (std::shared_ptr< boost::thread > thread)
 Set the thread associated to the shared sub-task. More...
 

Protected Attributes

vector< Primitive * > const & primitives
 Primitives of node being splitted.
 
int const splitAxis
 Index of axis defining the split.
 
double const splitPos
 Position on given axis of the split point.
 
vector< Primitive * > & leftPrimitives
 Where primitives of left split must be stored.
 
vector< Primitive * > & rightPrimitives
 Where primitives of right split must be stored.
 
size_t const startPrimitive
 Index of primitive (inclusive) at which the sub-task must start to iterate.
 
size_t const endPrimitive
 Index of primitive (exclusive) at which the sub-task must end iterating.
 
std::function< void(Primitive *p, int const splitAxis, double const splitPos, vector< Primitive * > &leftPrimitives, vector< Primitive * > &rightPrimitives)> onPopulateSplitsDigestPrimitive
 Function to digest a primitive when populating splits. More...
 
- Protected Attributes inherited from SharedSubTask
std::shared_ptr< SharedSubTaskCompletionHandlerch
 The shared sub-task completion handler that handles what must be done after a shared sub-task execution has been finished. The most paradigmatic case of a valid task completion handler is the shared task sequencer. More...
 
size_t key = 0
 The key identifying the shared sub task inside the shared task sequencer context. More...
 
std::shared_ptr< boost::thread > thread = nullptr
 The thread associated with the shared sub-tasks. It is nullptr until the shared sub-task has been started by its corresponding shared task sequencer.
 

Detailed Description

Shared sub-task to populate splits when building a Simple KDTree. It is meant to be used at geometry-level parallelization context and only for right child nodes.

Author
Alberto M. Esmoris Pena
Version
1.0
See also
SharedSubTask
SimpleKDTreeFactory
SimpleKDTreeFactory::populateSplits
MultiThreadKDTreeFactory

Member Function Documentation

◆ run()

void SimpleKDTreePopulateSplitsSubTask::run ( )
inlineoverridevirtual

Implementation of the populate splits method.

See also
SharedSubTask::run
SimpleKDTreeFactory::populateSplits

Implements SharedSubTask.

Member Data Documentation

◆ onPopulateSplitsDigestPrimitive

std::function<void( Primitive * p, int const splitAxis, double const splitPos, vector<Primitive *> &leftPrimitives, vector<Primitive *> &rightPrimitives )> SimpleKDTreePopulateSplitsSubTask::onPopulateSplitsDigestPrimitive
protected

Function to digest a primitive when populating splits.

See also
SimpleKDTreeFactory::onPopulateSplitsDigestPrimitive

The documentation for this class was generated from the following file: