Helios++
Helios software for LiDAR simulations
LasSyncFileMeasurementWriter.h
1 #pragma once
2 
3 #include <filems/write/comps/LasSyncFileWriter.h>
4 #include <filems/write/strategies/LasMeasurementWriteStrategy.h>
5 #include <Measurement.h>
6 
7 #include <glm/glm.hpp>
8 
9 #include <memory>
10 #include <string>
11 
12 
13 namespace helios { namespace filems {
14 
15 using std::make_shared;
16 
23  public LasSyncFileWriter<Measurement const &, glm::dvec3 const &>
24 {
25 public:
26  // *** CONSTRUCTION / DESTRUCTION *** //
27  // ************************************ //
30  {};
36  const std::string &path,
37  bool const compress = false,
38  double const scaleFactor = 0.0001,
39  glm::dvec3 const offset = glm::dvec3(0, 0, 0),
40  double const minIntensity = 0.0,
41  double const deltaIntensity = 1000000.0,
42  bool const createWriter = true
43  ) :
44  LasSyncFileWriter<Measurement const&, glm::dvec3 const&>(
45  path,
46  compress,
47  scaleFactor,
48  offset,
49  minIntensity,
50  deltaIntensity,
51  createWriter
52  )
53  {
54  // Write strategy
55  this->writeStrategy = make_shared<LasMeasurementWriteStrategy>(
56  *lw,
57  lws.lp,
59  lws.offset,
67  );
68  }
69 
72 
73 };
74 
75 }}
Class representing a measurement.
Definition: Measurement.h:13
SyncFileWriter implementation to write measurements in LAS format.
Definition: LasSyncFileMeasurementWriter.h:24
LasSyncFileMeasurementWriter(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)
Synchronous LAS file measurement writer constructor.
Definition: LasSyncFileMeasurementWriter.h:35
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
void finish() override
LasSyncFileWriter updates header and guarantees writings have been done only after the finish method ...
Definition: LasSyncFileWriter.h:120
std::shared_ptr< LASwriter > lw
LASwriter. Used to write to LAS file.
Definition: LasSyncFileWriter.h:34
LASpoint lp
LASpoint used to build different points which shall be written to LAS output file.
Definition: LasWriterSpec.h:39
double maxIntensity
Maximum value for intensity. Values greater than this will be clipped to maxIntensity.
Definition: LasWriterSpec.h:73
I32 ampAttrStart
Helios amplitude attribute start (LAS extra bytes format)
Definition: LasWriterSpec.h:124
glm::dvec3 offset
Offset for coordinates.
Definition: LasWriterSpec.h:63
I32 fwiAttrStart
Full wave index attribute start (LAS extra bytes format)
Definition: LasWriterSpec.h:116
I32 hoiAttrStart
Hit object ID attribute start (LAS extra bytes format)
Definition: LasWriterSpec.h:120
I32 ewAttrStart
Echo width attribute start (LAS extra bytes format)
Definition: LasWriterSpec.h:112
double scaleFactorInverse
Inverse of the scale factor.
Definition: LasWriterSpec.h:55
double intensityCoefficient
Precomputed intensity coefficient.
Definition: LasWriterSpec.h:92
double minIntensity
Minimum value for intensity. Values less than this will be clipped to minIntensity.
Definition: LasWriterSpec.h:68
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