Helios++
Helios software for LiDAR simulations
GroveKDTreeRaycaster Class Reference

Grove KDTree Raycaster extends KDTreeRaycaster to make it compatible with groves by implementing the RaycasterGroveTree interface. More...

#include <GroveKDTreeRaycaster.h>

Inheritance diagram for GroveKDTreeRaycaster:
Collaboration diagram for GroveKDTreeRaycaster:

Public Member Functions

 GroveKDTreeRaycaster (std::shared_ptr< LightKDTreeNode > root, std::shared_ptr< KDTreeFactory > kdtf=nullptr, std::shared_ptr< PointerVector< Primitive >> cache_prims=nullptr)
 Default Grove KDTree ray caster constructor. More...
 
virtual ~GroveKDTreeRaycaster ()=default
 The destructor of Grove KDTree must destroy any cache-related resource that doesnt make sense after the time-of-live of the raycaster has finished.
 
std::map< double, Primitive * > searchAll (glm::dvec3 rayOrigin, glm::dvec3 rayDir, double tmin, double tmax, bool groundOnly) override
 
RaySceneIntersectionsearch (glm::dvec3 rayOrigin, glm::dvec3 rayDir, double tmin, double tmax, bool groundOnly) override
 
void update (DynObject &dynObj) override
 Method to handle callbacks from updated dynamic objects. More...
 
virtual std::shared_ptr< GroveKDTreeRaycastermakeTemporalClone () const
 Make a temporal clone of the GroveKDTreeRaycaster. More...
 
std::shared_ptr< PointerVector< Primitive > > sharedCopy (std::vector< Primitive * > const &src) const
 Generate a shared pointer to a copy of the given vector of primitives. Copy implies that primitives are cloned. Thus, deleting copied primitives will not delete source primitives. More...
 
- Public Member Functions inherited from KDTreeRaycaster
 KDTreeRaycaster (std::shared_ptr< LightKDTreeNode > root)
 KDTree ray caster constructor. More...
 
std::map< double, Primitive * > searchAll (glm::dvec3 const rayOrigin, glm::dvec3 const rayDir, double const tmin, double const tmax, bool const groundOnly) override
 
RaySceneIntersectionsearch (glm::dvec3 const rayOrigin, glm::dvec3 const rayDir, double const tmin, double const tmax, bool const groundOnly) override
 

Protected Attributes

std::shared_ptr< KDTreeFactorykdtf
 The KDTreeFactory to be used to rebuild the KDTree if necessary.
 
std::shared_ptr< PointerVector< Primitive > > cache_prims
 The cache of primitives defining the last state for the root node of the raycasting process.
 

Additional Inherited Members

- Public Attributes inherited from KDTreeRaycaster
double epsilon = 0.0001
 Decimal precision for the ray caster.
 
std::shared_ptr< LightKDTreeNoderoot
 Shared pointer to the root node of the KDTree.
 
- Protected Member Functions inherited from KDTreeRaycaster
void searchAll_recursive (LightKDTreeNode *node, double const tmin, double const tmax, KDTreeRaycasterSearch &search)
 Recursive search function to assist searchAll function. More...
 
Primitivesearch_recursive (LightKDTreeNode *node, double const tmin, double const tmax, KDTreeRaycasterSearch &search) const
 Recursive search function to assist search function. More...
 

Detailed Description

Grove KDTree Raycaster extends KDTreeRaycaster to make it compatible with groves by implementing the RaycasterGroveTree interface.

Author
Alberto M. Esmoris Pena
Version
1.0
See also
RaycasterGroveTree
KDTreeRaycaster

Constructor & Destructor Documentation

◆ GroveKDTreeRaycaster()

GroveKDTreeRaycaster::GroveKDTreeRaycaster ( std::shared_ptr< LightKDTreeNode root,
std::shared_ptr< KDTreeFactory kdtf = nullptr,
std::shared_ptr< PointerVector< Primitive >>  cache_prims = nullptr 
)
inline

Default Grove KDTree ray caster constructor.

Parameters
rootRoot node of the KDTree

Member Function Documentation

◆ makeTemporalClone()

std::shared_ptr< GroveKDTreeRaycaster > GroveKDTreeRaycaster::makeTemporalClone ( ) const
virtual

Make a temporal clone of the GroveKDTreeRaycaster.

The temporal clone is meant to produce a temporal copy of the tree. If the original tree is updated, then the temporal copy should not be updated.

Returns
Temporal clone of the GroveKDTreeRaycaster
See also
KDGrove::makeTemporalClone

◆ search()

RaySceneIntersection* GroveKDTreeRaycaster::search ( glm::dvec3  rayOrigin,
glm::dvec3  rayDir,
double  tmin,
double  tmax,
bool  groundOnly 
)
inlineoverridevirtual
See also
Raycaster::search

Implements Raycaster.

◆ searchAll()

std::map<double, Primitive*> GroveKDTreeRaycaster::searchAll ( glm::dvec3  rayOrigin,
glm::dvec3  rayDir,
double  tmin,
double  tmax,
bool  groundOnly 
)
inlineoverridevirtual
See also
Raycaster::searchAll

Implements Raycaster.

◆ sharedCopy()

std::shared_ptr< PointerVector< Primitive > > GroveKDTreeRaycaster::sharedCopy ( std::vector< Primitive * > const &  src) const

Generate a shared pointer to a copy of the given vector of primitives. Copy implies that primitives are cloned. Thus, deleting copied primitives will not delete source primitives.

Parameters
srcThe source primitives to be copied
Returns
Shared pointer to a vector of cloned primitives

◆ update()

void GroveKDTreeRaycaster::update ( DynObject dynObj)
overridevirtual

Method to handle callbacks from updated dynamic objects.

Parameters
dynObjThe updated dynamic object
See also
RaycasterGroveTree::update

Implements RaycasterGroveTree< DynObject >.


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