Helios++
Helios software for LiDAR simulations
ScenePart.h
1 #pragma once
2 
3 #include <vector>
4 
5 #include "Vertex.h"
6 class Primitive;
7 
8 #include "maths/Rotation.h"
9 #include <ogr_geometry.h>
10 #include "LadLut.h"
11 #include <iostream>
12 
16 class ScenePart {
17  // *** SERIALIZATION *** //
18  // *********************** //
19  friend class boost::serialization::access;
20  template<class Archive>
21  void serialize(Archive &ar, const unsigned int version)
22  {
23  ar & mPrimitives;
24  ar & mId;
25  ar & mOrigin;
26  ar & mRotation;
27  ar & mScale;
30  ar & randomShift;
31  ar & ladlut;
32  }
33 public:
34  // *** ATTRIBUTES *** //
35  // ******************** //
39  std::vector<Primitive*> mPrimitives;
43  std::string mId = "";
56  std::vector<size_t> subpartLimit;
60  std::string onRayIntersectionMode = "";
70  bool randomShift = false;
71 
75  std::shared_ptr<LadLut> ladlut = nullptr;
76 
80  glm::dvec3 mOrigin = glm::dvec3(0, 0, 0);
84  Rotation mRotation = Rotation(glm::dvec3(1, 0, 0), 0);
88  double mScale = 1;
89 
90  OGRSpatialReference *mCrs = nullptr;
91  OGREnvelope *mEnv = nullptr;
92 
93  // *** CONSTRUCTION / DESTRUCTION *** //
94  // ************************************ //
98  ScenePart() = default;
99  ScenePart(ScenePart &sp);
100  virtual ~ScenePart(){}
101 
102  // *** M E T H O D S *** //
103  // *********************** //
108  std::vector<Vertex*> getAllVertices();
109 
114  void smoothVertexNormals();
115 
122  bool splitSubparts();
123 };
bool randomShift
Specify if apply random shift to the scene part (true) or not (false, by default) ...
Definition: ScenePart.h:70
std::vector< Vertex * > getAllVertices()
Obtain all vertices in the scene part.
Definition: ScenePart.cpp:36
std::vector< Primitive * > mPrimitives
Vector of pointers to primitives used by this scene part.
Definition: ScenePart.h:39
Definition: Rotation.h:80
Rotation mRotation
Specify the rotation for the scene part.
Definition: ScenePart.h:84
std::shared_ptr< LadLut > ladlut
Look-up table for leaf angle distribution.
Definition: ScenePart.h:75
bool splitSubparts()
Split each subpart into a different scene part, with the first one corresponding to this scene part...
Definition: ScenePart.cpp:85
double onRayIntersectionArgument
Specify the extra value to be used for ray intersection handling computation, when needed (depends on...
Definition: ScenePart.h:65
std::string onRayIntersectionMode
Specify the handling mode for ray intersections.
Definition: ScenePart.h:60
void smoothVertexNormals()
Smooth normals for each vertex computing the mean for each triangle using it.
Definition: ScenePart.cpp:47
double mScale
Specify the scale for the scene part.
Definition: ScenePart.h:88
Class representing a scene part.
Definition: ScenePart.h:16
glm::dvec3 mOrigin
Specify the origin for the scene part.
Definition: ScenePart.h:80
Abstract class defining the common behavior for all primitives.
Definition: Primitive.h:20
ScenePart()=default
Default constructor for a scene part.
std::string mId
Identifier for the scene part.
Definition: ScenePart.h:43
std::vector< size_t > subpartLimit
Vector specifying the limit of a subpart as the index of first element of next subpart.
Definition: ScenePart.h:56