15 friend class boost::serialization::access;
16 template <
typename Archive>
17 void serialize(Archive &ar,
const unsigned int version){
18 boost::serialization::void_cast_register<DetailedVoxel, Primitive>();
19 ar & boost::serialization::base_object<Voxel>(*this);
59 std::map<std::string, size_t>
identifiers = std::map<std::string, size_t>({
60 {
"PadBVTotal", 0}, {
"angleMean", 1}, {
"bsEntering", 2},
61 {
"bsIntercepted", 3}, {
"bsPotential", 4}, {
"ground_distance", 5},
62 {
"lMeanTotal", 6}, {
"lgTotal", 7}, {
"transmittance", 8},
63 {
"attenuation", 9}, {
"attenuationBiasCorrection", 10}
89 std::vector<int> intValues,
90 std::vector<double> doubleValues
92 Voxel(center, voxelSize),
93 intValues(
std::move(intValues)),
94 doubleValues(
std::move(doubleValues))
110 double halfVoxelSize,
111 std::vector<int> intValues,
112 std::vector<double> doubleValues
114 Voxel(x, y, z, halfVoxelSize),
115 intValues(
std::move(intValues)),
116 doubleValues(
std::move(doubleValues))
138 {
return doubleValues[index];}
145 {
return doubleValues[identifiers[id]];}
154 {
return intValues[0];}
161 {intValues[0] = nbEchos;
return *
this;}
167 {
return intValues[1];}
174 {intValues[1] = nbSampling;
return *
this;}
183 {
return intValues.size();}
189 {
return doubleValues.size();}
197 {intValues[index] = value;
return *
this;}
204 {
return intValues[index];}
212 {doubleValues[index] = value;
return *
this;}
219 {
return doubleValues[index];}
245 glm::dvec3 &rayDirection,
246 glm::dvec3
const &insideIntersectionPoint,
247 glm::dvec3
const &outsideIntersectionPoint,
256 glm::dvec3 &rayDirection,
257 glm::dvec3
const &insideIntersectionPoint,
258 glm::dvec3
const &outsideIntersectionPoint,
266 glm::dvec3 &rayDirection,
267 glm::dvec3
const &insideIntersectionPoint,
268 glm::dvec3
const &outsideIntersectionPoint,
277 glm::dvec3 &rayDirection,
278 glm::dvec3
const &insideIntersectionPoint,
279 glm::dvec3
const &outsideIntersectionPoint,
295 {
return part->ladlut !=
nullptr;}
void setMaxPad(double maxPad)
Set the max pad value.
Definition: DetailedVoxel.h:229
IntersectionHandlingResult onRayIntersection(NoiseSource< double > &uniformNoiseSource, glm::dvec3 &rayDirection, glm::dvec3 const &insideIntersectionPoint, glm::dvec3 const &outsideIntersectionPoint, double rayIntensity) override
Define ray intersection handling for DetailedVoxel primitive.
Definition: DetailedVoxel.cpp:25
DetailedVoxel & setNbEchos(int const nbEchos)
Set the number of total echoes count inside the voxel.
Definition: DetailedVoxel.h:160
size_t getNumberOfIntValues() const
Obtain the number of integer values defining the detailed voxel.
Definition: DetailedVoxel.h:182
double getMaxPad() const
The the max pad value.
Definition: DetailedVoxel.h:224
int getIntValue(size_t index) const
Obtain integer value at given index.
Definition: DetailedVoxel.h:203
double maxPad
Maximum plant area density.
Definition: DetailedVoxel.h:69
IntersectionHandlingResult onRayIntersectionTransmittive(NoiseSource< double > &uniformNoiseSource, glm::dvec3 &rayDirection, glm::dvec3 const &insideIntersectionPoint, glm::dvec3 const &outsideIntersectionPoint, double rayIntensity)
Transmittive handler for ray intersections.
Definition: DetailedVoxel.cpp:64
DetailedVoxel(glm::dvec3 center, double voxelSize, std::vector< int > intValues, std::vector< double > doubleValues)
Detailed voxel constructor.
Definition: DetailedVoxel.h:86
std::shared_ptr< Material > material
Shared pointer to the material defining certain properties such as reflectance, specularity, ...
Definition: Primitive.h:43
std::vector< double > doubleValues
All decimals defining the detailed voxel.
Definition: DetailedVoxel.h:54
double computeSigmaWithLadLut(glm::dvec3 const &direction) override
Definition: DetailedVoxel.cpp:161
int getNbEchos()
Obtain the number of total echoes count inside the voxel.
Definition: DetailedVoxel.h:153
void onFinishLoading(NoiseSource< double > &uniformNoiseSource) override
Configure DetailedVoxel size for scaled mode.
Definition: DetailedVoxel.cpp:134
IntersectionHandlingResult onRayIntersectionScaled(NoiseSource< double > &uniformNoiseSource, glm::dvec3 &rayDirection, glm::dvec3 const &insideIntersectionPoint, glm::dvec3 const &outsideIntersectionPoint, double rayIntensity, double scaleFactor)
Scaled handler for ray intersections.
Definition: DetailedVoxel.cpp:103
Class which extends Voxel to support AMAPVox format with extra features.
Definition: DetailedVoxel.h:12
Output class for intersection handling methods.
Definition: IntersectionHandlingResult.h:13
bool canComputeSigmaWithLadLut() override
Definition: DetailedVoxel.h:294
DetailedVoxel & setDoubleValue(size_t index, double value)
Set the double value at given index.
Definition: DetailedVoxel.h:211
DetailedVoxel & setNbSampling(int nbSampling)
Set the number of pulses entering the voxel.
Definition: DetailedVoxel.h:173
bool canHandleIntersections() override
Specify DetailedVoxel can handle intersections.
Definition: DetailedVoxel.h:238
std::map< std::string, size_t > identifiers
Identifiers for doubleValues vector.
Definition: DetailedVoxel.h:59
int getNbSampling()
Obtain the number of pulses entering the voxel.
Definition: DetailedVoxel.h:166
Class representing a voxel primitive.
Definition: Voxel.h:11
DetailedVoxel(double x, double y, double z, double halfVoxelSize, std::vector< int > intValues, std::vector< double > doubleValues)
Detailed voxel constructor.
Definition: DetailedVoxel.h:106
std::vector< int > intValues
All integers defining the detailed voxel.
Definition: DetailedVoxel.h:35
DetailedVoxel()=default
Defualt constructor for detailed voxel.
IntersectionHandlingResult onRayIntersectionFixed(NoiseSource< double > &uniformNoiseSource, glm::dvec3 &rayDirection, glm::dvec3 const &insideIntersectionPoint, glm::dvec3 const &outsideIntersectionPoint, double rayIntensity, double fixedSize)
Fixed handler for ray intersections.
Definition: DetailedVoxel.cpp:119
double getDoubleValue(size_t index) const
Get the double value at given index.
Definition: DetailedVoxel.h:218
std::shared_ptr< ScenePart > part
Shared pointer to the scene part the primitive belongs to.
Definition: Primitive.h:37
Abstract class defining the common behavior for all primitives.
Definition: Primitive.h:20
void _clone(Primitive *p) override
Definition: DetailedVoxel.cpp:11
size_t getNumberOfDoubleValues() const
Obtain the number of double values defining the detailed voxel.
Definition: DetailedVoxel.h:188
DetailedVoxel & setIntValue(size_t index, int value)
Set integer value at given index.
Definition: DetailedVoxel.h:196
Primitive * clone() override
Definition: DetailedVoxel.cpp:6
double & operator[](size_t index)
Obtain the value at specified index (position)
Definition: DetailedVoxel.h:137