Helios++
Helios software for LiDAR simulations
DetailedVoxel Class Reference

Class which extends Voxel to support AMAPVox format with extra features. More...

#include <DetailedVoxel.h>

Inheritance diagram for DetailedVoxel:
Collaboration diagram for DetailedVoxel:

Public Member Functions

 DetailedVoxel ()=default
 Defualt constructor for detailed voxel.
 
 DetailedVoxel (glm::dvec3 center, double voxelSize, std::vector< int > intValues, std::vector< double > doubleValues)
 Detailed voxel constructor. More...
 
 DetailedVoxel (double x, double y, double z, double halfVoxelSize, std::vector< int > intValues, std::vector< double > doubleValues)
 Detailed voxel constructor. More...
 
Primitiveclone () override
 
void _clone (Primitive *p) override
 
double & operator[] (size_t index)
 Obtain the value at specified index (position) More...
 
double & operator[] (std::string const &id)
 Obtain the value associated with given identifier. More...
 
int getNbEchos ()
 Obtain the number of total echoes count inside the voxel. More...
 
DetailedVoxelsetNbEchos (int const nbEchos)
 Set the number of total echoes count inside the voxel. More...
 
int getNbSampling ()
 Obtain the number of pulses entering the voxel. More...
 
DetailedVoxelsetNbSampling (int nbSampling)
 Set the number of pulses entering the voxel. More...
 
size_t getNumberOfIntValues () const
 Obtain the number of integer values defining the detailed voxel. More...
 
size_t getNumberOfDoubleValues () const
 Obtain the number of double values defining the detailed voxel. More...
 
DetailedVoxelsetIntValue (size_t index, int value)
 Set integer value at given index. More...
 
int getIntValue (size_t index) const
 Obtain integer value at given index. More...
 
DetailedVoxelsetDoubleValue (size_t index, double value)
 Set the double value at given index. More...
 
double getDoubleValue (size_t index) const
 Get the double value at given index. More...
 
double getMaxPad () const
 The the max pad value. More...
 
void setMaxPad (double maxPad)
 Set the max pad value. More...
 
bool canHandleIntersections () override
 Specify DetailedVoxel can handle intersections. More...
 
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. More...
 
IntersectionHandlingResult onRayIntersectionTransmittive (NoiseSource< double > &uniformNoiseSource, glm::dvec3 &rayDirection, glm::dvec3 const &insideIntersectionPoint, glm::dvec3 const &outsideIntersectionPoint, double rayIntensity)
 Transmittive handler for ray intersections.
 
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.
 
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.
 
void onFinishLoading (NoiseSource< double > &uniformNoiseSource) override
 Configure DetailedVoxel size for scaled mode.
 
bool canComputeSigmaWithLadLut () override
 
double computeSigmaWithLadLut (glm::dvec3 const &direction) override
 
- Public Member Functions inherited from Voxel
 Voxel ()=default
 Default voxel constructor.
 
 Voxel (glm::dvec3 center, double voxelSize)
 Voxel constructor. More...
 
 Voxel (double x, double y, double z, double halfVoxelSize)
 Voxel constructor. More...
 
Primitiveclone () override
 
void _clone (Primitive *p) override
 
void swap (Voxel &voxel)
 Swap semantic implementation for voxel. More...
 
 Voxel (Voxel const &voxel)
 
Voxeloperator= (Voxel const &voxel)
 
 Voxel (Voxel &&voxel)
 
Voxeloperator= (Voxel &&voxel)
 
AABBgetAABB () override
 
glm::dvec3 getCentroid () override
 
double getIncidenceAngle_rad (const glm::dvec3 &rayOrigin, const glm::dvec3 &rayDir, const glm::dvec3 &intersectionPoint) override
 
double getIncidenceAngleClosestFace_rad (const glm::dvec3 &rayOrigin, const glm::dvec3 &rayDir, const glm::dvec3 &intersectionPoint)
 Obtain the incidence angle with respect to closest face for given intersection point. More...
 
std::vector< double > getRayIntersection (const glm::dvec3 &rayOrigin, const glm::dvec3 &rayDir) override
 
double getRayIntersectionDistance (const glm::dvec3 &rayOrigin, const glm::dvec3 &rayDir) override
 
virtual size_t getNumVertices () override
 
VertexgetVertices () override
 
virtual size_t getNumFullVertices () override
 
VertexgetFullVertices () override
 
double getGroundZOffset () override
 
bool hasNormal ()
 Check if voxel has a valid normal. More...
 
void rotate (Rotation &r) override
  Voxel cannot be rotated More...
 
void scale (double const factor) override
 
void translate (glm::dvec3 const &shift) override
 
void update () override
 

Protected Attributes

std::vector< int > intValues
 All integers defining the detailed voxel. More...
 
std::vector< double > doubleValues
 All decimals defining the detailed voxel. More...
 
std::map< std::string, size_t > identifiers
 Identifiers for doubleValues vector. More...
 
double maxPad = 0.0
 Maximum plant area density.
 

Private Member Functions

template<typename Archive >
void serialize (Archive &ar, const unsigned int version)
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Public Attributes inherited from Voxel
Vertex v
 Vertex representing the voxel center.
 
int numPoints = 0
 Number of points inside the voxel. Useful when the voxel has been built from a point cloud.
 
double r = 0
 Aggregated red component from points inside voxel.
 
double g = 0
 Aggregated green component from points inside voxel.
 
double b = 0
 Aggregated blue component from points inside voxel.
 
glm::dvec3 normal = glm::dvec3(0, 0, 0)
 Voxel normal vecctor.
 
AABBbbox = nullptr
 Axis aligned bounding box containing the voxel.
 
Color4f color
 Voxel color. This attribute is not used at the moment and might be removed in the future.
 
double halfSize
 Half of the voxel sizxe.
 
- Public Attributes inherited from Primitive
std::shared_ptr< ScenePartpart = nullptr
 Shared pointer to the scene part the primitive belongs to. More...
 
std::shared_ptr< Materialmaterial = nullptr
 Shared pointer to the material defining certain properties such as reflectance, specularity, ... More...
 

Detailed Description

Class which extends Voxel to support AMAPVox format with extra features.

Author
Alberto M. Esmoris Pena 1.0

Constructor & Destructor Documentation

◆ DetailedVoxel() [1/2]

DetailedVoxel::DetailedVoxel ( glm::dvec3  center,
double  voxelSize,
std::vector< int >  intValues,
std::vector< double >  doubleValues 
)
inline

Detailed voxel constructor.

Parameters
centerCenter for the voxel
voxelSizeSize for the voxel
intValuesInteger values for detailed voxel
doubleValuesDouble values for detailed voxel
See also
Voxel::Voxel(glm::dvec3, double)

◆ DetailedVoxel() [2/2]

DetailedVoxel::DetailedVoxel ( double  x,
double  y,
double  z,
double  halfVoxelSize,
std::vector< int >  intValues,
std::vector< double >  doubleValues 
)
inline

Detailed voxel constructor.

Parameters
xX coordinate of voxel center
yY coordinate of voxel center
zZ coordinate of voxel center
halfVoxelSizeHalf the voxel size
intValuesInteger values for detailed voxel
doubleValuesDouble values for detailed voxel
See also
Voxel::Voxel(double, double, double, double)

Member Function Documentation

◆ _clone()

void DetailedVoxel::_clone ( Primitive p)
overridevirtual
See also
Primitive::_clone

Reimplemented from Primitive.

◆ canComputeSigmaWithLadLut()

bool DetailedVoxel::canComputeSigmaWithLadLut ( )
inlineoverridevirtual
See also
Primitive::canComputeSigmaWithLadLut

Reimplemented from Primitive.

◆ canHandleIntersections()

bool DetailedVoxel::canHandleIntersections ( )
inlineoverridevirtual

Specify DetailedVoxel can handle intersections.

Returns
True
See also
Primitive::canHandleIntersections

Reimplemented from Primitive.

◆ clone()

Primitive * DetailedVoxel::clone ( )
overridevirtual
See also
Primitive::clone

Implements Primitive.

◆ computeSigmaWithLadLut()

double DetailedVoxel::computeSigmaWithLadLut ( glm::dvec3 const &  direction)
overridevirtual
See also
Primitive::computeSigmaWithLadLut

Reimplemented from Primitive.

◆ getDoubleValue()

double DetailedVoxel::getDoubleValue ( size_t  index) const
inline

Get the double value at given index.

Parameters
indexIndex of double value to obtain
Returns
Double value at given index

◆ getIntValue()

int DetailedVoxel::getIntValue ( size_t  index) const
inline

Obtain integer value at given index.

Parameters
indexIndex of integer value to obtain
Returns
Integer value at given index

◆ getMaxPad()

double DetailedVoxel::getMaxPad ( ) const
inline

The the max pad value.

Returns
Max pad value

◆ getNbEchos()

int DetailedVoxel::getNbEchos ( )
inline

Obtain the number of total echoes count inside the voxel.

Returns
Number of total echoes count inside the voxel

◆ getNbSampling()

int DetailedVoxel::getNbSampling ( )
inline

Obtain the number of pulses entering the voxel.

Returns
Number of pulses entering the voxel

◆ getNumberOfDoubleValues()

size_t DetailedVoxel::getNumberOfDoubleValues ( ) const
inline

Obtain the number of double values defining the detailed voxel.

Returns
Number of double value defining the detailed voxel

◆ getNumberOfIntValues()

size_t DetailedVoxel::getNumberOfIntValues ( ) const
inline

Obtain the number of integer values defining the detailed voxel.

Returns
Number of integer values defining the detailed voxel

◆ onRayIntersection()

IntersectionHandlingResult DetailedVoxel::onRayIntersection ( NoiseSource< double > &  uniformNoiseSource,
glm::dvec3 &  rayDirection,
glm::dvec3 const &  insideIntersectionPoint,
glm::dvec3 const &  outsideIntersectionPoint,
double  rayIntensity 
)
overridevirtual

Define ray intersection handling for DetailedVoxel primitive.

See also
Primitive::onRayIntersection

Reimplemented from Primitive.

◆ operator[]() [1/2]

double& DetailedVoxel::operator[] ( size_t  index)
inline

Obtain the value at specified index (position)

Parameters
indexIndex of the requested value
Returns
Value at given index

◆ operator[]() [2/2]

double& DetailedVoxel::operator[] ( std::string const &  id)
inline

Obtain the value associated with given identifier.

Parameters
idIdentifier associated with requested value
Returns
Value associated with given identifier

◆ setDoubleValue()

DetailedVoxel& DetailedVoxel::setDoubleValue ( size_t  index,
double  value 
)
inline

Set the double value at given index.

Parameters
indexIndex of double value to set
valueNew double value
Returns
Reference to the

◆ setIntValue()

DetailedVoxel& DetailedVoxel::setIntValue ( size_t  index,
int  value 
)
inline

Set integer value at given index.

Parameters
indexIndex of integer value to set
valueNew integer value
Returns
Reference to the detailed voxel (fluent programming)

◆ setMaxPad()

void DetailedVoxel::setMaxPad ( double  maxPad)
inline

Set the max pad value.

Parameters
maxPadNew max pad value

◆ setNbEchos()

DetailedVoxel& DetailedVoxel::setNbEchos ( int const  nbEchos)
inline

Set the number of total echoes count inside the voxel.

Parameters
nbEchosNew number of total echoes count inside the voxel
Returns
The DetailedVoxel reference in a fluent programming fashion

◆ setNbSampling()

DetailedVoxel& DetailedVoxel::setNbSampling ( int  nbSampling)
inline

Set the number of pulses entering the voxel.

Parameters
nbSamplingNumber of pulses entering the voxel
Returns
The DetailedVoxel reference in a fluent programming fashion

Member Data Documentation

◆ doubleValues

std::vector<double> DetailedVoxel::doubleValues
protected

All decimals defining the detailed voxel.

By default, the first elements must be:

  1. Plant area density
  2. Mean inclination angle of shots which entered the voxel
  3. Sum of weighted fractions of entering laser pulses
  4. Potential
  5. Distance from voxel center to the ground. If no ground is set, then the plane with equation Z=0 will be used.
  6. Mean length of optical path inside the voxel
  7. Length sum of optical path inside the voxel
  8. Transmittance (standarized per one meter optical path length)
  9. Attenuation
  10. AttenuationBiasCorrection

◆ identifiers

std::map<std::string, size_t> DetailedVoxel::identifiers
protected
Initial value:
= std::map<std::string, size_t>({
{"PadBVTotal", 0}, {"angleMean", 1}, {"bsEntering", 2},
{"bsIntercepted", 3}, {"bsPotential", 4}, {"ground_distance", 5},
{"lMeanTotal", 6}, {"lgTotal", 7}, {"transmittance", 8},
{"attenuation", 9}, {"attenuationBiasCorrection", 10}
})

Identifiers for doubleValues vector.

◆ intValues

std::vector<int> DetailedVoxel::intValues
protected

All integers defining the detailed voxel.

By default first integer must be total echoes count inside the voxel (nbEchos), while second integer must be number of pulses entering the voxel (nbSampling)


The documentation for this class was generated from the following files: