Helios++
Helios software for LiDAR simulations
LasVectorialSyncFileMeasurementWriter.h
1 #pragma once
2 
3 #include <filems/write/comps/LasSyncFileWriter.h>
4 #include <filems/write/strategies/LasMeasurementWriteStrategy.h>
5 #include <filems/write/strategies/VectorialWriteStrategy.h>
6 #include <Measurement.h>
7 
8 #include <glm/glm.hpp>
9 
10 #include <memory>
11 #include <string>
12 #include <vector>
13 
14 
15 namespace helios { namespace filems{
16 
17 using std::make_shared;
18 using std::vector;
19 
32  public LasSyncFileWriter<
33  vector<Measurement> const &,
34  glm::dvec3 const &
35  >
36 {
37 protected:
38  // *** ATTRIBUTES *** //
39  // ******************** //
47 
48 public:
49  // *** CONSTRUCTION / DESTRUCTION *** //
50  // ************************************ //
57  const std::string &path,
58  bool const compress = false,
59  double const scaleFactor = 0.0001,
60  glm::dvec3 const offset = glm::dvec3(0, 0, 0),
61  double const minIntensity = 0.0,
62  double const deltaIntensity = 1000000.0,
63  bool const createWriter = true
64  ) :
66  vector<Measurement> const &,
67  glm::dvec3 const &
68  >(
69  path,
70  compress,
71  scaleFactor,
72  offset,
73  minIntensity,
74  deltaIntensity,
75  createWriter
76  ),
77  lmws(
78  *lw,
79  lws.lp,
80  lws.scaleFactorInverse,
81  lws.offset,
82  lws.minIntensity,
83  lws.maxIntensity,
84  lws.intensityCoefficient,
85  lws.ewAttrStart,
86  lws.fwiAttrStart,
87  lws.hoiAttrStart,
88  lws.ampAttrStart
89  )
90  {
91  // Write strategy
92  this->writeStrategy = make_shared<VectorialWriteStrategy<
94  glm::dvec3 const &
95  >>(lmws);
96  }
97 
98 };
99 
100 
101 }}
Class representing a measurement.
Definition: Measurement.h:13
Concrete class specializing WriteStrategy to directly write measurements to a file with LAS format.
Definition: LasMeasurementWriteStrategy.h:23
Abstract specialization of SingleSyncFileWriter to write output in LAS format.
Definition: LasSyncFileWriter.h:23
LasWriterSpec lws
The specification defining the LAS writer.
Definition: LasSyncFileWriter.h:30
std::shared_ptr< LASwriter > lw
LASwriter. Used to write to LAS file.
Definition: LasSyncFileWriter.h:34
Concrete class specializing LasSyncFileWriter to write a vector of measurements to a LAS file.
Definition: LasVectorialSyncFileMeasurementWriter.h:36
LasVectorialSyncFileMeasurementWriter(const std::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, bool const createWriter=true)
LAS vectorial synchronous file measurement vector writer constructor.
Definition: LasVectorialSyncFileMeasurementWriter.h:56
LasMeasurementWriteStrategy lmws
The measurement write strategy that is wrapped by the main write strategy in a vectorial fashion ( fi...
Definition: LasVectorialSyncFileMeasurementWriter.h:46
std::string path
Path to file to be written.
Definition: SingleSyncFileWriter.h:28
std::shared_ptr< WriteStrategy< WriteArgs ... > > writeStrategy
The write strategy specifying how to write data to file.
Definition: SingleSyncFileWriter.h:36
Concrete class specializing WriteStrategy to make any other write strategy operate over a vector.
Definition: VectorialWriteStrategy.h:23