Helios++
Helios software for LiDAR simulations
MeasurementWriter.h
1 #pragma once
2 
3 #include <util/HeliosException.h>
4 #include <filems/write/core/BaseMeasurementWriter.h>
5 #include <filems/factory/SyncFileMeasurementWriterFactory.h>
6 #include <scanner/Measurement.h>
7 
8 #include <string>
9 #include <memory>
10 
11 
12 namespace helios { namespace filems {
13 
14 
15 using std::string;
16 using std::shared_ptr;
17 
18 
27  public BaseMeasurementWriter<Measurement const&, glm::dvec3 const&>
28 {
29 protected:
30  // *** USING *** //
31  // *************** //
34 
35 public:
36  // *** CONSTRUCTION / DESTRUCTION *** //
37  // ************************************ //
42  BaseMeasurementWriter<Measurement const &, glm::dvec3 const &>()
43  {}
44  virtual ~MeasurementWriter() = default;
45 
46  // *** M E T H O D S *** //
47  // ************************* //
52  void writeMeasurement(Measurement const &m);
58  inline void writeMeasurementUnsafe(Measurement const &m) const
59  {sfw->write(m, shift);}
64  shared_ptr<
67  WriterType const &type,
68  string const &path,
69  bool const zipOutput,
70  double const lasScale,
71  glm::dvec3 shift,
72  double const minIntensity,
73  double const deltaIntensity
74  ) const override{
76  type, // Writer type
77  path, // Output path
78  zipOutput, // Zip flag
79  lasScale, // Scale factor
80  shift, // Offset
81  0.0, // Min intensity
82  1000000.0 // Delta intensity
83  );
84  }
85 };
86 
87  }}
Class representing a measurement.
Definition: Measurement.h:13
Class to handle writing of measurements to generate HELIOS++ output virtual point clouds....
Definition: BaseMeasurementWriter.h:31
glm::dvec3 shift
The pointer to the shift vector to be applied to measurements.
Definition: BaseMeasurementWriter.h:54
shared_ptr< SyncFileWriter< WriteArgs ... > > sfw
Synchronous file writer.
Definition: HeliosWriter.h:33
double lasScale
Scale factor specification to be used when LAS output format specified.
Definition: HeliosWriter.h:56
bool zipOutput
Flag specifying if detector output must be zipped (true) or not (false)
Definition: HeliosWriter.h:50
Class to handle writing of measurements to generate HELIOS++ output virtual point clouds.
Definition: MeasurementWriter.h:28
MeasurementWriter()
Definition: MeasurementWriter.h:41
void writeMeasurement(Measurement const &m)
Write a measurement.
Definition: MeasurementWriter.cpp:8
void writeMeasurementUnsafe(Measurement const &m) const
Like filems::MeasurementWriter::writeMeasurement but faster because there is no validation.
Definition: MeasurementWriter.h:58
shared_ptr< SyncFileWriter< Measurement const &, glm::dvec3 const & > > makeWriter(WriterType const &type, string const &path, bool const zipOutput, double const lasScale, glm::dvec3 shift, double const minIntensity, double const deltaIntensity) const override
Make a single measurement SyncFileWriter.
Definition: MeasurementWriter.h:66
static shared_ptr< SyncFileWriter< Measurement const &, glm::dvec3 const & > > makeWriter(WriterType const type, const string &path, bool const compress=false, double const scaleFactor=0.0001, glm::dvec3 const offset=glm::dvec3(0, 0, 0), double const minIntensity=0.0, double const deltaIntensity=1000000.0)
Synchronous file writer factory.
Definition: SyncFileMeasurementWriterFactory.h:86
Abstract class defining common behavior for all synchronous file writers.
Definition: SyncFileWriter.h:18