Helios++
Helios software for LiDAR simulations
SpectralLibrary.h
1 #pragma once
2 
3 // Class for loading and applying the material reflectances [0,100] from the ASTER Spectral Library
4 
5 #include <boost/filesystem.hpp>
6 namespace fs = boost::filesystem;
7 
8 #include <string>
9 #include <map>
10 #include "typedef.h"
11 #include "Scene.h"
12 
17 
18 private:
19  // *** ATTRIBUTES *** //
20  // ******************** //
24  const std::string spectra;
28  const double defaultReflectance = 50;
32  std::map<std::string, float> reflectanceMap;
40  float wavelength_um = 0;
41 
42 public:
48  SpectralLibrary(float wavelength_m, std::string spectra);
49 
50 private:
63  float interpolateReflectance(float w0, float w1, float r0, float r1);
69  void readFileAster(boost::filesystem::path path);
70 
71 public:
76  void readReflectances();
81  void setReflectances(Scene* scene);
82 };
const std::string spectra
Spectra specification.
Definition: SpectralLibrary.h:24
SpectralLibrary(float wavelength_m, std::string spectra)
Spectral library constructor.
Definition: SpectralLibrary.cpp:14
float interpolateReflectance(float w0, float w1, float r0, float r1)
Reflectance interpolation function.
Definition: SpectralLibrary.cpp:21
Class representing the spectral library.
Definition: SpectralLibrary.h:16
void readReflectances()
Read spectra file.
Definition: SpectralLibrary.cpp:85
void readFileAster(boost::filesystem::path path)
Definition: SpectralLibrary.cpp:33
const double defaultReflectance
Default reflectance value.
Definition: SpectralLibrary.h:28
float wavelength_um
Wavelength.
Definition: SpectralLibrary.h:40
Class representing a scene asset.
Definition: Scene.h:25
void setReflectances(Scene *scene)
Fill scene materials reflectance with available spectra data.
Definition: SpectralLibrary.cpp:103
std::map< std::string, float > reflectanceMap
Reflectances retrieved from file.
Definition: SpectralLibrary.h:32