6 #include <boost/serialization/map.hpp>
18 friend class boost::serialization::access;
19 template <
typename Archive>
20 void serialize(Archive &ar,
const unsigned int version){
21 boost::serialization::void_cast_register<DetailedVoxel, Voxel>();
22 ar & boost::serialization::base_object<Voxel>(*
this);
62 std::map<std::string, size_t>
identifiers = std::map<std::string, size_t>({
63 {
"PadBVTotal", 0}, {
"angleMean", 1}, {
"bsEntering", 2},
64 {
"bsIntercepted", 3}, {
"bsPotential", 4}, {
"ground_distance", 5},
65 {
"lMeanTotal", 6}, {
"lgTotal", 7}, {
"transmittance", 8},
66 {
"attenuation", 9}, {
"attenuationBiasCorrection", 10}
95 Voxel(center, voxelSize),
113 double halfVoxelSize,
117 Voxel(x, y, z, halfVoxelSize),
177 {
intValues[1] = nbSampling;
return *
this;}
200 {
intValues[index] = value;
return *
this;}
248 glm::dvec3 &rayDirection,
249 glm::dvec3
const &insideIntersectionPoint,
250 glm::dvec3
const &outsideIntersectionPoint,
259 glm::dvec3 &rayDirection,
260 glm::dvec3
const &insideIntersectionPoint,
261 glm::dvec3
const &outsideIntersectionPoint,
269 glm::dvec3 &rayDirection,
270 glm::dvec3
const &insideIntersectionPoint,
271 glm::dvec3
const &outsideIntersectionPoint,
280 glm::dvec3 &rayDirection,
281 glm::dvec3
const &insideIntersectionPoint,
282 glm::dvec3
const &outsideIntersectionPoint,
298 {
return part->ladlut !=
nullptr;}
Class which extends Voxel to support AMAPVox format with extra features.
Definition: DetailedVoxel.h:15
bool canHandleIntersections() override
Specify DetailedVoxel can handle intersections.
Definition: DetailedVoxel.h:241
void _clone(Primitive *p) override
Definition: DetailedVoxel.cpp:11
bool canComputeSigmaWithLadLut() override
Definition: DetailedVoxel.h:297
DetailedVoxel & setDoubleValue(size_t index, double value)
Set the double value at given index.
Definition: DetailedVoxel.h:214
double computeSigmaWithLadLut(glm::dvec3 const &direction) override
Definition: DetailedVoxel.cpp:158
int getNbSampling()
Obtain the number of pulses entering the voxel.
Definition: DetailedVoxel.h:169
std::vector< int > intValues
All integers defining the detailed voxel.
Definition: DetailedVoxel.h:38
int getNbEchos()
Obtain the number of total echoes count inside the voxel.
Definition: DetailedVoxel.h:156
double getMaxPad() const
The the max pad value.
Definition: DetailedVoxel.h:227
DetailedVoxel & setIntValue(size_t index, int value)
Set integer value at given index.
Definition: DetailedVoxel.h:199
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 & setNbEchos(int const nbEchos)
Set the number of total echoes count inside the voxel.
Definition: DetailedVoxel.h:163
void setMaxPad(double maxPad)
Set the max pad value.
Definition: DetailedVoxel.h:232
void onFinishLoading(NoiseSource< double > &uniformNoiseSource) override
Configure DetailedVoxel size for scaled mode.
Definition: DetailedVoxel.cpp:131
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:116
double & operator[](size_t index)
Obtain the value at specified index (position)
Definition: DetailedVoxel.h:140
std::vector< double > doubleValues
All decimals defining the detailed voxel.
Definition: DetailedVoxel.h:57
DetailedVoxel(double x, double y, double z, double halfVoxelSize, std::vector< int > intValues, std::vector< double > doubleValues)
Detailed voxel constructor.
Definition: DetailedVoxel.h:109
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:100
double maxPad
Maximum plant area density.
Definition: DetailedVoxel.h:72
size_t getNumberOfDoubleValues() const
Obtain the number of double values defining the detailed voxel.
Definition: DetailedVoxel.h:191
int getIntValue(size_t index) const
Obtain integer value at given index.
Definition: DetailedVoxel.h:206
std::map< std::string, size_t > identifiers
Identifiers for doubleValues vector.
Definition: DetailedVoxel.h:62
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(glm::dvec3 center, double voxelSize, std::vector< int > intValues, std::vector< double > doubleValues)
Detailed voxel constructor.
Definition: DetailedVoxel.h:89
Primitive * clone() override
Definition: DetailedVoxel.cpp:6
DetailedVoxel & setNbSampling(int nbSampling)
Set the number of pulses entering the voxel.
Definition: DetailedVoxel.h:176
DetailedVoxel()
Defualt constructor for detailed voxel.
Definition: DetailedVoxel.h:80
double getDoubleValue(size_t index) const
Get the double value at given index.
Definition: DetailedVoxel.h:221
size_t getNumberOfIntValues() const
Obtain the number of integer values defining the detailed voxel.
Definition: DetailedVoxel.h:185
Output class for intersection handling methods.
Definition: IntersectionHandlingResult.h:14
Abstract class defining the common behavior for all primitives.
Definition: Primitive.h:24
std::shared_ptr< ScenePart > part
Shared pointer to the scene part the primitive belongs to.
Definition: Primitive.h:57
Class representing a voxel primitive.
Definition: Voxel.h:11