Helios++
Helios software for LiDAR simulations
PulseTaskFactory.h
1 #pragma once
2 
3 #include <PulseTask.h>
4 #include <Scene.h>
5 #include <SimulatedPulse.h>
7 
8 #include <functional>
9 #include <memory>
10 
11 using std::shared_ptr;
12 using std::make_shared;
13 
23 protected:
24  // *** ATTRIBUTES *** //
25  // ******************** //
38  std::function<shared_ptr<PulseTask>(
39  ScanningPulseProcess const &,
40  SimulatedPulse const &
41  )> _build;
42 
43 public:
44  // *** CONSTRUCTION / DESTRUCTION *** //
45  // ************************************ //
51  virtual ~PulseTaskFactory() {}
52 
53  // *** FACTORY METHODS *** //
54  // ************************* //
61  inline shared_ptr<PulseTask> build(
62  ScanningPulseProcess const &spp,
63  SimulatedPulse const &sp
64  ) const {return _build(spp,sp);}
65 
66 protected:
71  shared_ptr<PulseTask> buildFullWaveformPulseRunnable(
72  ScanningPulseProcess const &spp,
73  SimulatedPulse const &sp
74  ) const;
79  shared_ptr<PulseTask> buildDynFullWaveformPulseRunnable(
80  ScanningPulseProcess const &spp,
81  SimulatedPulse const &sp
82  ) const;
83 
89  virtual void configureBuildMethod();
90 
91 public:
92  // *** GETTERs and SETTERs *** //
93  // ***************************** //
99  inline Scene & getScene() const {return scene;}
105  inline void setScene(Scene &scene)
106  {this->scene = scene; configureBuildMethod();}
107 
108 };
Factory to make the adequate pulse task depending on the simulation.
Definition: PulseTaskFactory.h:22
void setScene(Scene &scene)
Set the scene associated to the pulse task factory.
Definition: PulseTaskFactory.h:105
std::function< shared_ptr< PulseTask > ScanningPulseProcess const &, SimulatedPulse const &)> _build
The build function to be used.
Definition: PulseTaskFactory.h:41
PulseTaskFactory(Scene &scene)
Constructor for the PulseTaskFactory.
Definition: PulseTaskFactory.cpp:9
shared_ptr< PulseTask > buildDynFullWaveformPulseRunnable(ScanningPulseProcess const &spp, SimulatedPulse const &sp) const
Build a DynFullWaveformPulseRunnable from given arguments.
Definition: PulseTaskFactory.cpp:24
virtual void configureBuildMethod()
Automatically set the _build function depending on current factory state.
Definition: PulseTaskFactory.cpp:35
shared_ptr< PulseTask > buildFullWaveformPulseRunnable(ScanningPulseProcess const &spp, SimulatedPulse const &sp) const
Build a FullWaveformPulseRunnable from given arguments.
Definition: PulseTaskFactory.cpp:17
shared_ptr< PulseTask > build(ScanningPulseProcess const &spp, SimulatedPulse const &sp) const
The main build method of the factory. It is the method that must be called to automatically build the...
Definition: PulseTaskFactory.h:61
Scene & scene
Reference to the scene to be scanned.
Definition: PulseTaskFactory.h:29
Scene & getScene() const
Obtain the scene associated to the pulse task factory.
Definition: PulseTaskFactory.h:99
Class defining the scanning pulse process interface.
Definition: ScanningPulseProcess.h:18
Class representing a scene asset.
Definition: Scene.h:28
Class representing a simulated laser pulse.
Definition: SimulatedPulse.h:10