Helios++
Helios software for LiDAR simulations
|
Leaf Angle Distribution Look-Up Table. More...
#include <LadLut.h>
Public Member Functions | |
LadLut ()=default | |
LadLut default constructor. | |
LadLut (LadLut &ll) | |
void | computeAngles () |
Compute angles. More... | |
double | computeSigma (double padBVTotal, glm::dvec3 direction) |
double | computeSigma (double padBVTotal, double x, double y, double z) |
Compute sigma ( \(\sigma\)) More... | |
double | interpolate (glm::dvec3 direction) |
double | interpolate (double x, double y, double z) |
Interpolate \(g\). More... | |
void | transformToLadLutDomain (double a, double b, double c, double &x, double &y, double &z) |
Transform a vector \((a,b,c)\) from standard domain to a vector \((x,y=0,z)\) in LadLut domain. More... | |
void | fastTransformToLadLutDomain (double a, double b, double c, double &x, double &y, double &z) |
Fast verision of transformToLadLutDomain function. More... | |
void | findEnvelopmentDirections (double wx, double wy, double wz, size_t &uIdx, double &ux, double &uy, double &uz, size_t &vIdx, double &vx, double &vy, double &vz, double &a, double &b) |
Find the vector immediately after \(\hat{w}\) ( \(\hat{u}\)) and the one immediately before \(\hat{w}\) ( \(\hat{v}\)) More... | |
Public Attributes | |
std::vector< double > | X |
X component of normalized director vector for each record. | |
std::vector< double > | Y |
Y component of normalized director vector for each record. | |
std::vector< double > | Z |
Z component of normalized director vector for each record. | |
std::vector< double > | G |
Function evaluation for each record. | |
std::vector< double > | angles |
The angle for each director vector with respect to \((0, 0, 1)\). | |
Static Public Attributes | |
static const double | eps = 0.0000001 |
Used to consider decimal precision. Two values will be treated as equal when the difference between them is not greater than eps ( \(\epsilon\)) | |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Friends | |
class | boost::serialization::access |
Leaf Angle Distribution Look-Up Table.
Class representing the look-up table for leaf angle distribution
void LadLut::computeAngles | ( | ) |
Compute angles.
double LadLut::computeSigma | ( | double | padBVTotal, |
double | x, | ||
double | y, | ||
double | z | ||
) |
Compute sigma ( \(\sigma\))
\[ \sigma = \frac{p \cdot g}{2{\pi}} \]
padBVTotal | The PadBVTotal value ( \(p\)) |
x | The x component of normalized director vector |
y | The y component of normalized director vector |
z | The z component of normalized director vector |
|
inline |
|
inline |
Fast verision of transformToLadLutDomain function.
\[ \hat{u} = (x, y, z) \longrightarrow \hat{v} = \left(\sqrt{x^{2}+y^{2}}, 0, z\right) \]
void LadLut::findEnvelopmentDirections | ( | double | wx, |
double | wy, | ||
double | wz, | ||
size_t & | uIdx, | ||
double & | ux, | ||
double & | uy, | ||
double & | uz, | ||
size_t & | vIdx, | ||
double & | vx, | ||
double & | vy, | ||
double & | vz, | ||
double & | a, | ||
double & | b | ||
) |
Find the vector immediately after \(\hat{w}\) ( \(\hat{u}\)) and the one immediately before \(\hat{w}\) ( \(\hat{v}\))
[in] | wx | X component of w vector |
[in] | wy | Y component of w vector |
[in] | wz | Z component of w vector |
[out] | uIdx | Index of the closet direction after w |
[out] | ux | X component of the closest direction after w |
[out] | uy | Y component of the closest direction after w |
[out] | uz | Z component of the closest direction after w |
[out] | vIdx | Index of the closest direction before w |
[out] | vx | X component of the closest direction before w |
[out] | vy | Y component of the closest direction before w |
[out] | vz | Z component of the closest direction before w |
[out] | a | Angular distance between u and w |
[out] | b | Angular distance between v and w |
double LadLut::interpolate | ( | double | x, |
double | y, | ||
double | z | ||
) |
Interpolate \(g\).
Considering known evaluations, interpolate the value for given direction.
First, \(\hat{u}\) and \(\hat{v}\) are the immediately after-before kown director vectors with respect to \(\hat{w}\), which is the one that must be interpolated.
Second, \(a\) and \(b\) are the absolute value of angular distance between \(\hat{u}\) and \(\hat{w}\) and between \(\hat{v}\) and \(\hat{w}\) respectively.
Therefore, \(\Delta = a+b\).
Now weights are defined as \(\alpha = \frac{b}{\Delta}\) and \(\beta = \frac{a}{\Delta}\).
And \(g\) can be interpolated:
\[ g_{\hat{w}} = {\alpha} g_{\hat{u}} + {\beta} g_{\hat{v}} \]
Finally, in case \(a\) or \(b\) is 0, there is a coincidence with respecct to \(\hat{w}\). In consequence, it is not necessary to compute interpolation as \(g\) is contained in the look-up table.
x | X component of normalized director vector for interpolation |
y | Y component of normalized director vector for interpolation |
z | Z component of normalized director vector for interpolation |
|
inline |
void LadLut::transformToLadLutDomain | ( | double | a, |
double | b, | ||
double | c, | ||
double & | x, | ||
double & | y, | ||
double & | z | ||
) |
Transform a vector \((a,b,c)\) from standard domain to a vector \((x,y=0,z)\) in LadLut domain.
[in] | a | X component of the vector to transform |
[in] | b | Y component of the vector to transform |
[in] | c | Z component of the vector to transform |
[out] | x | X component of transformed vector |
[out] | y | Y component of transformed vector |
[out] | z | Z component of transformed vector |