Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
lvr2::CLRaycaster< IntT > Class Template Reference

CLRaycaster: GPU OpenCL version of BVH Raycasting. More...

#include <CLRaycaster.hpp>

Inheritance diagram for lvr2::CLRaycaster< IntT >:
Inheritance graph
[legend]

Classes

struct  ClTriangleIntersectionResult
 

Public Member Functions

bool castRay (const Vector3f &origin, const Vector3f &direction, IntT &intersection)
 Overload functions ///. More...
 
void castRays (const Vector3f &origin, const std::vector< Vector3f > &directions, std::vector< IntT > &intersections, std::vector< uint8_t > &hits) override
 Cast a ray from single origin with multiple directions onto the mesh. More...
 
void castRays (const std::vector< Vector3f > &origins, const std::vector< Vector3f > &directions, std::vector< IntT > &intersections, std::vector< uint8_t > &hits) override
 Cast from multiple ray origin/direction pairs onto the mesh. More...
 
 CLRaycaster (const MeshBufferPtr mesh, unsigned int stack_size=32)
 Constructor: Generate BVH tree on mesh, loads CL kernels. More...
 
- Public Member Functions inherited from lvr2::BVHRaycaster< IntT >
 BVHRaycaster (const MeshBufferPtr mesh, unsigned int stack_size=64)
 Constructor: Stores mesh as member. More...
 
- Public Member Functions inherited from lvr2::RaycasterBase< IntT >
virtual void castRays (const Vector3f &origin, const std::vector< std::vector< Vector3f > > &directions, std::vector< std::vector< IntT > > &intersections, std::vector< std::vector< uint8_t > > &hits)
 Cast a ray from a single origin with multiple directions (in matrix form) onto the mesh. More...
 
virtual void castRays (const std::vector< Vector3f > &origins, const std::vector< std::vector< Vector3f > > &directions, std::vector< std::vector< IntT > > &intersections, std::vector< std::vector< uint8_t > > &hits)
 Cast rays with multiples origins. Each origin has multiples directions. More...
 
 RaycasterBase (const MeshBufferPtr mesh)
 Constructor: Stores mesh as member. More...
 

Private Member Functions

void copyBVHToGPU ()
 TODO. More...
 
void createKernel ()
 TODO. More...
 
void getDeviceInformation ()
 TODO. More...
 
void initOpenCL ()
 Initializes OpenCL related stuff. More...
 
void initOpenCLBuffer (size_t num_origins, size_t num_dirs)
 TODO. More...
 
void initOpenCLTreeBuffer ()
 TODO docu. More...
 

Private Attributes

cl::Buffer m_bvhIndicesOrTriListsBuffer
 BUFFER ///. More...
 
cl::Buffer m_bvhLimitsnBuffer
 
cl::Buffer m_bvhTriangleIntersectionDataBuffer
 
cl::Buffer m_bvhTriIdxListBuffer
 
cl::Context m_context
 
cl::Device m_device
 
cl_ulong m_device_global_memory
 
cl::Kernel m_kernel_multi_multi
 
cl::Kernel m_kernel_one_multi
 
cl::Kernel m_kernel_one_one
 
size_t m_max_work_group_size
 
cl_uint m_mps
 TODO. More...
 
cl::Platform m_platform
 
cl::Program m_program
 
cl::CommandQueue m_queue
 
cl::Buffer m_rayBuffer
 
cl::Buffer m_rayOriginBuffer
 
cl::Buffer m_resultBuffer
 
cl_uint m_threads_per_block
 
size_t m_warp_size
 

Additional Inherited Members

- Protected Member Functions inherited from lvr2::BVHRaycaster< IntT >
Vector3f barycentric (const Vector3f &p, const Vector3f &a, const Vector3f &b, const Vector3f &c) const
 
- Protected Attributes inherited from lvr2::BVHRaycaster< IntT >
BVHTree< BaseVector< float > > m_bvh
 
const unsigned int * m_BVHindicesOrTriLists
 
const float * m_BVHlimits
 
indexArray m_faces
 
const unsigned int m_stack_size
 
const float * m_TriangleIntersectionData
 
const unsigned int * m_TriIdxList
 
floatArr m_vertices
 

Detailed Description

template<typename IntT>
class lvr2::CLRaycaster< IntT >

CLRaycaster: GPU OpenCL version of BVH Raycasting.

Definition at line 70 of file CLRaycaster.hpp.

Constructor & Destructor Documentation

◆ CLRaycaster()

template<typename IntT >
lvr2::CLRaycaster< IntT >::CLRaycaster ( const MeshBufferPtr  mesh,
unsigned int  stack_size = 32 
)

Constructor: Generate BVH tree on mesh, loads CL kernels.

Member Function Documentation

◆ castRay()

template<typename IntT >
bool lvr2::CLRaycaster< IntT >::castRay ( const Vector3f origin,
const Vector3f direction,
IntT &  intersection 
)
virtual

Overload functions ///.

Cast a single ray onto the mesh. Hint: Better not use it on GPU.

Parameters
[in]originRay origin
[in]directionRay direction
[out]intersectionUser defined intersection output
Returns
true Intersection found
false Not intersection found

Reimplemented from lvr2::BVHRaycaster< IntT >.

◆ castRays() [1/2]

template<typename IntT >
void lvr2::CLRaycaster< IntT >::castRays ( const Vector3f origin,
const std::vector< Vector3f > &  directions,
std::vector< IntT > &  intersections,
std::vector< uint8_t > &  hits 
)
overridevirtual

Cast a ray from single origin with multiple directions onto the mesh.

Parameters
[in]originOrigin of the ray
[in]directionsDirections of the ray
[out]intersectionsUser defined intersections output
[out]hitsIntersection found or not

Reimplemented from lvr2::RaycasterBase< IntT >.

◆ castRays() [2/2]

template<typename IntT >
void lvr2::CLRaycaster< IntT >::castRays ( const std::vector< Vector3f > &  origins,
const std::vector< Vector3f > &  directions,
std::vector< IntT > &  intersections,
std::vector< uint8_t > &  hits 
)
overridevirtual

Cast from multiple ray origin/direction pairs onto the mesh.

Parameters
[in]originOrigin of the ray
[in]directionsDirections of the ray
[out]intersectionsUser defined intersections output
[out]hitsIntersection found or not

Reimplemented from lvr2::RaycasterBase< IntT >.

◆ copyBVHToGPU()

template<typename IntT >
void lvr2::CLRaycaster< IntT >::copyBVHToGPU ( )
private

TODO.

◆ createKernel()

template<typename IntT >
void lvr2::CLRaycaster< IntT >::createKernel ( )
private

TODO.

◆ getDeviceInformation()

template<typename IntT >
void lvr2::CLRaycaster< IntT >::getDeviceInformation ( )
private

TODO.

◆ initOpenCL()

template<typename IntT >
void lvr2::CLRaycaster< IntT >::initOpenCL ( )
private

Initializes OpenCL related stuff.

◆ initOpenCLBuffer()

template<typename IntT >
void lvr2::CLRaycaster< IntT >::initOpenCLBuffer ( size_t  num_origins,
size_t  num_dirs 
)
private

TODO.

◆ initOpenCLTreeBuffer()

template<typename IntT >
void lvr2::CLRaycaster< IntT >::initOpenCLTreeBuffer ( )
private

TODO docu.

Member Data Documentation

◆ m_bvhIndicesOrTriListsBuffer

template<typename IntT >
cl::Buffer lvr2::CLRaycaster< IntT >::m_bvhIndicesOrTriListsBuffer
private

BUFFER ///.

Definition at line 214 of file CLRaycaster.hpp.

◆ m_bvhLimitsnBuffer

template<typename IntT >
cl::Buffer lvr2::CLRaycaster< IntT >::m_bvhLimitsnBuffer
private

Definition at line 215 of file CLRaycaster.hpp.

◆ m_bvhTriangleIntersectionDataBuffer

template<typename IntT >
cl::Buffer lvr2::CLRaycaster< IntT >::m_bvhTriangleIntersectionDataBuffer
private

Definition at line 216 of file CLRaycaster.hpp.

◆ m_bvhTriIdxListBuffer

template<typename IntT >
cl::Buffer lvr2::CLRaycaster< IntT >::m_bvhTriIdxListBuffer
private

Definition at line 217 of file CLRaycaster.hpp.

◆ m_context

template<typename IntT >
cl::Context lvr2::CLRaycaster< IntT >::m_context
private

Definition at line 205 of file CLRaycaster.hpp.

◆ m_device

template<typename IntT >
cl::Device lvr2::CLRaycaster< IntT >::m_device
private

Definition at line 204 of file CLRaycaster.hpp.

◆ m_device_global_memory

template<typename IntT >
cl_ulong lvr2::CLRaycaster< IntT >::m_device_global_memory
private

Definition at line 200 of file CLRaycaster.hpp.

◆ m_kernel_multi_multi

template<typename IntT >
cl::Kernel lvr2::CLRaycaster< IntT >::m_kernel_multi_multi
private

Definition at line 210 of file CLRaycaster.hpp.

◆ m_kernel_one_multi

template<typename IntT >
cl::Kernel lvr2::CLRaycaster< IntT >::m_kernel_one_multi
private

Definition at line 209 of file CLRaycaster.hpp.

◆ m_kernel_one_one

template<typename IntT >
cl::Kernel lvr2::CLRaycaster< IntT >::m_kernel_one_one
private

Definition at line 208 of file CLRaycaster.hpp.

◆ m_max_work_group_size

template<typename IntT >
size_t lvr2::CLRaycaster< IntT >::m_max_work_group_size
private

Definition at line 198 of file CLRaycaster.hpp.

◆ m_mps

template<typename IntT >
cl_uint lvr2::CLRaycaster< IntT >::m_mps
private

TODO.

TODO

Definition at line 196 of file CLRaycaster.hpp.

◆ m_platform

template<typename IntT >
cl::Platform lvr2::CLRaycaster< IntT >::m_platform
private

Definition at line 203 of file CLRaycaster.hpp.

◆ m_program

template<typename IntT >
cl::Program lvr2::CLRaycaster< IntT >::m_program
private

Definition at line 206 of file CLRaycaster.hpp.

◆ m_queue

template<typename IntT >
cl::CommandQueue lvr2::CLRaycaster< IntT >::m_queue
private

Definition at line 207 of file CLRaycaster.hpp.

◆ m_rayBuffer

template<typename IntT >
cl::Buffer lvr2::CLRaycaster< IntT >::m_rayBuffer
private

Definition at line 220 of file CLRaycaster.hpp.

◆ m_rayOriginBuffer

template<typename IntT >
cl::Buffer lvr2::CLRaycaster< IntT >::m_rayOriginBuffer
private

Definition at line 221 of file CLRaycaster.hpp.

◆ m_resultBuffer

template<typename IntT >
cl::Buffer lvr2::CLRaycaster< IntT >::m_resultBuffer
private

Definition at line 224 of file CLRaycaster.hpp.

◆ m_threads_per_block

template<typename IntT >
cl_uint lvr2::CLRaycaster< IntT >::m_threads_per_block
private

Definition at line 197 of file CLRaycaster.hpp.

◆ m_warp_size

template<typename IntT >
size_t lvr2::CLRaycaster< IntT >::m_warp_size
private

Definition at line 199 of file CLRaycaster.hpp.


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


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:11