Helios++
Helios software for LiDAR simulations
|
Abstract class defining the common behavior for all primitives. More...
#include <Primitive.h>
Public Member Functions | |
virtual Primitive * | clone ()=0 |
virtual void | _clone (Primitive *p) |
virtual AABB * | getAABB ()=0 |
Obtain the axis aligned bounding box containing the primitive. More... | |
virtual glm::dvec3 | getCentroid ()=0 |
Obtain the primitive centroid. More... | |
virtual double | getIncidenceAngle_rad (const glm::dvec3 &rayOrigin, const glm::dvec3 &rayDir, const glm::dvec3 &intersectionPoint)=0 |
Obtain the incidence angle in radians. More... | |
virtual std::vector< double > | getRayIntersection (const glm::dvec3 &rayOrigin, const glm::dvec3 &rayDir)=0 |
Obtain the intersection point between primitive and given ray. More... | |
virtual double | getRayIntersectionDistance (const glm::dvec3 &rayOrigin, const glm::dvec3 &rayDir)=0 |
Obtain the intersection distance between primitive and given ray. More... | |
virtual void | onFinishLoading (NoiseSource< double > &uniformNoiseSource) |
Method to be triggered once all Primitives have been loaded. More... | |
virtual size_t | getNumVertices () |
Obtain the number of vertices returned by the getVertices function. More... | |
virtual Vertex * | getVertices ()=0 |
Obtain basic vertices for the primitive. More... | |
virtual size_t | getNumFullVertices () |
Obtain the number of vertices returned by the getFullVertices function. More... | |
virtual Vertex * | getFullVertices () |
Obtain full vertices for the primitive. More... | |
virtual double | getGroundZOffset () |
Offset for ground point z coordinate. More... | |
virtual void | update ()=0 |
Necessary primitive updates after modification. More... | |
virtual bool | canHandleIntersections () |
Specify if the primitive can handle intersections or not. More... | |
virtual IntersectionHandlingResult | onRayIntersection (NoiseSource< double > &uniformNoiseSource, glm::dvec3 &rayDirection, glm::dvec3 const &insideIntersectionPoint, glm::dvec3 const &outsideIntersectionPoint, double rayIntensity) |
Handle ray intersections. More... | |
virtual void | rotate (Rotation &r) |
Performs rotation over primitive. More... | |
virtual void | scale (double const factor) |
Scale primitive by given factor. More... | |
virtual void | translate (glm::dvec3 const &shift) |
Translate primitive by given shift. More... | |
virtual bool | canComputeSigmaWithLadLut () |
Check if primitive can compute sigma using LadLut or not. More... | |
virtual double | computeSigmaWithLadLut (glm::dvec3 const &direction) |
Compute sigma using LadLut. More... | |
Public Attributes | |
std::shared_ptr< ScenePart > | part = nullptr |
Shared pointer to the scene part the primitive belongs to. More... | |
std::shared_ptr< Material > | material = nullptr |
Shared pointer to the material defining certain properties such as reflectance, specularity, ... More... | |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Serialize a Primitive to a stream of bytes. More... | |
Friends | |
class | boost::serialization::access |
std::ostream & | operator<< (std::ostream &out, Primitive &p) |
Output stream operator << overloading. | |
Abstract class defining the common behavior for all primitives.
|
inlinevirtual |
Check if primitive can compute sigma using LadLut or not.
Reimplemented in DetailedVoxel.
|
inlinevirtual |
Specify if the primitive can handle intersections or not.
By default primitives cannot handle intersections. Primitives which can handle intersections should override this method and return true. This method is used to avoid unnecessary computations for those primitives which are not going to handle intersections.
Reimplemented in DetailedVoxel.
|
inlinevirtual |
Compute sigma using LadLut.
This computation will only be possible when primitive is able to do it. For this purpose, a LadLut is required. Also, the primitive must be able to use the LadLut.
Reimplemented in DetailedVoxel.
|
pure virtual |
|
pure virtual |
|
inlinevirtual |
Obtain full vertices for the primitive.
FullVertices is a set containing basic vertices and, when necessary, those extra vertices required to define all the space occupied by the primitive.
Thi is necessary, for instance, for correct voxels ray intersection.
Reimplemented in Voxel.
|
inlinevirtual |
Offset for ground point z coordinate.
When finding ground points it is necessary to consider the offset. For triangles or similar plane-like primitives, the offset is 0. However, when considering primitives with volume, the z offset must be considered to compute the ground surface and not the first intersected point.
Imagine the ray with originWaypoint at o is going through the given voxel. It will intersect at p first. However, the ground point must be q, because the ground is understood as the voxel upper surface. This offset is used to assist computing the ground point (see Scene getGrountPointAt function) ___q____
___p____ |
| | | o
Reimplemented in Voxel.
|
pure virtual |
|
inlinevirtual |
Obtain the number of vertices returned by the getFullVertices function.
Reimplemented in Voxel.
|
inlinevirtual |
Obtain the number of vertices returned by the getVertices function.
|
pure virtual |
|
pure virtual |
Obtain the intersection distance between primitive and given ray.
rayOrigin | Ray origin coordinates |
rayDir | Ray director vector |
|
pure virtual |
Obtain basic vertices for the primitive.
|
inlinevirtual |
Method to be triggered once all Primitives have been loaded.
It can be used to prepare primitives after being loaded but before starting the simulation. It is not necessary that this method does nothing at all, but it can be used by primitives which need it.
[in] | uniformNoiseSource | Uniform noise source in range [-1, 1] |
Reimplemented in DetailedVoxel.
|
virtual |
Handle ray intersections.
This function acts as a callback to apply desired behavior when intersection events are notified.
uniformNoiseSource | The uniform noise source used to handle randomness simmulation |
rayDirection | The direction of the ray. It is necessary to apply randomness while avoiding the intersection point to go outside voxel limits |
insideIntersectionPoint | The point where the ray enters the primitive |
outsideIntersectionPoint | The point where the ray exits the primitive |
rayIntensity | Intensity for the ray intersecting the primitive |
extra | An extra argument that can be used by handlers which need it |
Reimplemented in DetailedVoxel.
|
virtual |
|
virtual |
|
inlineprivate |
|
virtual |
|
pure virtual |
Necessary primitive updates after modification.
std::shared_ptr<Material> Primitive::material = nullptr |
Shared pointer to the material defining certain properties such as reflectance, specularity, ...
std::shared_ptr<ScenePart> Primitive::part = nullptr |
Shared pointer to the scene part the primitive belongs to.