Helios++
Helios software for LiDAR simulations
AABB Class Reference

Class representing an Axis Aligned Bounding Box (AABB) More...

#include <AABB.h>

Inheritance diagram for AABB:
Collaboration diagram for AABB:

Public Member Functions

 AABB ()=default
 Default constructor for axis aligned bounding box.
 
 AABB (glm::dvec3 min, glm::dvec3 max)
 Build an axis aligned bounding box through min and max values for each coordinate. More...
 
 ~AABB () override=default
 Default destructor for axis aligned bounding box.
 
Primitiveclone () override
 Generate a clone of the primitive. More...
 
void _clone (Primitive *p) override
 Assist clone function. More...
 
glm::dvec3 const & getMin () const
 Get the min value for each coordinate of the axis aligned bounding box. More...
 
glm::dvec3 const & getMax () const
 Get the max value for each coordinate of the axis aligned bounding box. More...
 
AABBgetAABB () override
 Obtain this axis aligned bounding box. More...
 
glm::dvec3 getCentroid () override
 Get the centroid of the axis aligned bounding box. More...
 
double getIncidenceAngle_rad (const glm::dvec3 &rayOrigin, const glm::dvec3 &rayDir, const glm::dvec3 &intersectionPoint) override
 
std::vector< double > getRayIntersection (const glm::dvec3 &rayOrigin, const glm::dvec3 &rayDir) override
 
double getRayIntersectionDistance (const glm::dvec3 &rayOrigin, const glm::dvec3 &rayDir) override
 
size_t getNumVertices () override
 
VertexgetVertices () override
 
void update () override
 
glm::dvec3 getSize ()
 Obtain size along each axis for the axis aligned bounding box. More...
 
std::string toString ()
 Bbuild a string representing the axis aligned bounding box. More...
 
- Public Member Functions inherited from Primitive
virtual void onFinishLoading (NoiseSource< double > &uniformNoiseSource)
 Method to be triggered once all Primitives have been loaded. More...
 
virtual size_t getNumFullVertices ()
 Obtain the number of vertices returned by the getNumFullVertices function. More...
 
virtual VertexgetFullVertices ()
 Obtain full vertices for the primitive. More...
 
virtual double getGroundZOffset ()
 Offset for ground point z coordinate. 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...
 

Static Public Member Functions

static std::shared_ptr< AABBgetForPrimitives (std::vector< Primitive *> &primitives)
 Build an axis aligned bounding box containing given primitives. More...
 
static std::shared_ptr< AABBgetForVertices (std::vector< Vertex > &verts)
 Build an axis aligned bounding box containing given vertices. More...
 
static std::shared_ptr< AABBgetForVertices (std::unordered_set< Vertex *, VertexKeyHash, VertexKeyEqual > &verts)
 Build an axis aligned bounding box containing given vertices. More...
 

Public Attributes

Vertex vertices [2]
 Vertices defining the axis aligned bounding box. More...
 
glm::dvec3 bounds [2]
 Cached bounds to speed-up intersection computation.
 
- 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...
 

Private Member Functions

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

Friends

class boost::serialization::access
 

Detailed Description

Class representing an Axis Aligned Bounding Box (AABB)

Constructor & Destructor Documentation

◆ AABB()

AABB::AABB ( glm::dvec3  min,
glm::dvec3  max 
)

Build an axis aligned bounding box through min and max values for each coordinate.

Parameters
minMin value for each 3D coordinate
maxMax value for each 3D coordinate

Member Function Documentation

◆ _clone()

void AABB::_clone ( Primitive p)
overridevirtual

Assist clone function.

Parameters
pPointer to the clone to be updated
See also
Primitive::_clone

Reimplemented from Primitive.

◆ clone()

Primitive * AABB::clone ( )
overridevirtual

Generate a clone of the primitive.

Returns
Pointer to the clone of the primitive
See also
Primitive::clone

Implements Primitive.

◆ getAABB()

AABB * AABB::getAABB ( )
overridevirtual

Obtain this axis aligned bounding box.

Returns
The axis aligned bounding box itself
See also
Primitive::getAABB

Implements Primitive.

◆ getCentroid()

dvec3 AABB::getCentroid ( )
overridevirtual

Get the centroid of the axis aligned bounding box.

Returns
Centroid of the axis aligned bounding box
See also
Primitive::getCentroid

Implements Primitive.

◆ getForPrimitives()

shared_ptr< AABB > AABB::getForPrimitives ( std::vector< Primitive *> &  primitives)
static

Build an axis aligned bounding box containing given primitives.

Parameters
primitivesPrimitives to build axis aligned bounding box around
Returns
Axis aligned bounding box containing given primitives

◆ getForVertices() [1/2]

static std::shared_ptr<AABB> AABB::getForVertices ( std::vector< Vertex > &  verts)
static

Build an axis aligned bounding box containing given vertices.

Parameters
vertsVertices to build axis aligned bounding box around
Returns
Axis aligned bounding box containing given vertices

◆ getForVertices() [2/2]

std::shared_ptr< AABB > AABB::getForVertices ( std::unordered_set< Vertex *, VertexKeyHash, VertexKeyEqual > &  verts)
static

Build an axis aligned bounding box containing given vertices.

Parameters
vertsVertices to build axis aligned bounding box around
Returns
Axis aligned bounding box containing given vertices

◆ getIncidenceAngle_rad()

double AABB::getIncidenceAngle_rad ( const glm::dvec3 &  rayOrigin,
const glm::dvec3 &  rayDir,
const glm::dvec3 &  intersectionPoint 
)
overridevirtual

◆ getMax()

glm::dvec3 const& AABB::getMax ( ) const
inline

Get the max value for each coordinate of the axis aligned bounding box.

Returns
Max value for each coordinate of the axis aligned bounding box

◆ getMin()

glm::dvec3 const& AABB::getMin ( ) const
inline

Get the min value for each coordinate of the axis aligned bounding box.

Returns
Min value for each coordinate of the axis aligned bounding box

◆ getNumVertices()

size_t AABB::getNumVertices ( )
inlineoverridevirtual
See also
Primitive::getNumVertices

Reimplemented from Primitive.

◆ getRayIntersection()

std::vector< double > AABB::getRayIntersection ( const glm::dvec3 &  rayOrigin,
const glm::dvec3 &  rayDir 
)
overridevirtual

◆ getRayIntersectionDistance()

double AABB::getRayIntersectionDistance ( const glm::dvec3 &  rayOrigin,
const glm::dvec3 &  rayDir 
)
overridevirtual

◆ getSize()

dvec3 AABB::getSize ( )

Obtain size along each axis for the axis aligned bounding box.

Returns
Size along each axis for the axis aligned bounding box

◆ getVertices()

Vertex * AABB::getVertices ( )
overridevirtual
See also
Primitive::getVertices

Implements Primitive.

◆ toString()

string AABB::toString ( )

Bbuild a string representing the axis aligned bounding box.

Returns
String representing the axis aligned bounding box

◆ update()

void AABB::update ( )
inlineoverridevirtual
See also
Primitive::update

Implements Primitive.

Member Data Documentation

◆ vertices

Vertex AABB::vertices[2]

Vertices defining the axis aligned bounding box.

The first vertex represents the minimum boundaries while the second one represents the maximum boundaries


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