Helios++
Helios software for LiDAR simulations
AbstractGeometryFilter.h
1 #pragma once
2 
3 
4 #include <map>
5 #include <string>
6 
7 #include "Material.h"
8 #include "ScenePart.h"
9 
10 #include "maths/Rotation.h"
11 
12 #include "typedef.h"
13 #include <ogr_spatialref.h>
14 
19 
20 public:
21  // *** ATTRIBUTES *** //
22  // ******************** //
23  OGRSpatialReference* sourceCRS;
24 
28  std::map<std::string, ObjectT> params;
32  std::map<std::string, Material> materials;
33 
38  ScenePart* primsOut = nullptr;
39 
40  // *** CONSTRUCTION / DESTRUCTION *** //
41  // ************************************ //
47  AbstractGeometryFilter(ScenePart* parts_) : primsOut(parts_)
48  {if(primsOut == nullptr) primsOut = new ScenePart();}
49  virtual ~AbstractGeometryFilter()
50  {if(primsOut != nullptr) delete primsOut;}
51 
52  // *** R U N *** //
53  // *************** //
60  virtual ScenePart* run() = 0;
61 
62 
63  // *** GETTERs and SETTERs *** //
64  // ***************************** //
70  std::shared_ptr<Material> getMaterial(std::string materialName);
71 
72  // *** U T I L S *** //
73  // ******************* //
80  std::vector<std::shared_ptr<Material>> parseMaterials();
81 
82 };
AbstractGeometryFilter(ScenePart *parts_)
Base constructor for asset loading filters.
Definition: AbstractGeometryFilter.h:47
std::map< std::string, ObjectT > params
Available parameters.
Definition: AbstractGeometryFilter.h:28
ScenePart * primsOut
ScenePart used to build the output. Not strictly necessary for any filter.
Definition: AbstractGeometryFilter.h:38
std::map< std::string, Material > materials
Available materials.
Definition: AbstractGeometryFilter.h:32
virtual ScenePart * run()=0
Abstract method to run the filter and obtain the output.
Class representing a scene part.
Definition: ScenePart.h:16
Abstract class defining asset loading filters common behavior.
Definition: AbstractGeometryFilter.h:18
std::vector< std::shared_ptr< Material > > parseMaterials()
Parse materials specified through "matfile", which can be concreted through "matname" parameter...
Definition: AbstractGeometryFilter.cpp:19
std::shared_ptr< Material > getMaterial(std::string materialName)
Retrieve requested material by name.
Definition: AbstractGeometryFilter.cpp:5