Helios++
Helios software for LiDAR simulations
ScanningPulseProcess.h
1 #pragma once
2 
3 #include <Measurement.h>
4 #include <Rotation.h>
5 #include <PulseTaskFactory.h>
6 #include <scanner/SimulatedPulse.h>
7 class Scanner;
8 
9 #include <glm/glm.hpp>
10 
11 #include <mutex>
12 
19 protected:
20  // *** ATTRIBUTES *** //
21  // ******************** //
31  std::shared_ptr<Scanner> scanner;
32 
33 public:
34  // *** CONSTRUCTION / DESTRUCTION *** //
35  // ************************************ //
39  ScanningPulseProcess(std::shared_ptr<Scanner> scanner);
40  virtual ~ScanningPulseProcess() = default;
41 
42  // *** PULSE COMPUTATION *** //
43  // *************************** //
49  virtual void handlePulseComputation(SimulatedPulse const &sp) = 0;
59  virtual inline void onLegComplete() {}
69  virtual inline void onSimulationFinished() {}
70 
71  // *** GETTERs and SETTERs *** //
72  // **************************** //
78  std::shared_ptr<Scanner> getScanner() const;
84  bool isWriteWaveform() const;
90  bool isCalcEchowidth() const;
96  std::shared_ptr<std::vector<Measurement>> & getAllMeasurements() const;
102  std::shared_ptr<std::mutex> & getAllMeasurementsMutex() const;
108  std::shared_ptr<std::vector<Measurement>> & getCycleMeasurements() const;
114  std::shared_ptr<std::mutex> &getCycleMeasurementsMutex() const;
115 };
Factory to make the adequate pulse task depending on the simulation.
Definition: PulseTaskFactory.h:22
Class representing a scanner asset.
Definition: Scanner.h:28
Class defining the scanning pulse process interface.
Definition: ScanningPulseProcess.h:18
bool isCalcEchowidth() const
Obtain the scanner's calc echowidth flag.
Definition: ScanningPulseProcess.cpp:22
ScanningPulseProcess(std::shared_ptr< Scanner > scanner)
Default constructor for scanning pulse process.
Definition: ScanningPulseProcess.cpp:6
std::shared_ptr< std::mutex > & getAllMeasurementsMutex() const
Obtain the scanner's all measurements mutex.
Definition: ScanningPulseProcess.cpp:32
std::shared_ptr< std::mutex > & getCycleMeasurementsMutex() const
Obtain the scanner's cycle measurements mutex.
Definition: ScanningPulseProcess.cpp:42
bool isWriteWaveform() const
Obtain the scanner's write waveform flag.
Definition: ScanningPulseProcess.cpp:18
PulseTaskFactory ptf
The pulse task factory to build pulse tasks.
Definition: ScanningPulseProcess.h:26
virtual void handlePulseComputation(SimulatedPulse const &sp)=0
Handle pulse computation whatever it is single thread based or thread pool based.
std::shared_ptr< std::vector< Measurement > > & getAllMeasurements() const
Obtain the scanner's all measurements vector.
Definition: ScanningPulseProcess.cpp:27
std::shared_ptr< Scanner > scanner
The scanner emitting the pulses.
Definition: ScanningPulseProcess.h:31
std::shared_ptr< Scanner > getScanner() const
Obtain the scanner.
Definition: ScanningPulseProcess.cpp:15
virtual void onSimulationFinished()
Handle behavior of scanning pulse process once simulation has finished.
Definition: ScanningPulseProcess.h:69
virtual void onLegComplete()
Handle behavior of scanning pulse process once current leg has been completed. It is useful mainly wh...
Definition: ScanningPulseProcess.h:59
std::shared_ptr< std::vector< Measurement > > & getCycleMeasurements() const
Obtain the scanner's cycle measurements vector.
Definition: ScanningPulseProcess.cpp:37
Class representing a simulated laser pulse.
Definition: SimulatedPulse.h:10