Class BeamIntersectionVisitorImpl
java.lang.Object
cz.fidentis.analyst.opencl.services.raycasting.impl.BeamIntersectionVisitorImpl
- All Implemented Interfaces:
CLResources
,BeamIntersectionVisitor
Visitor providing methods to ray cast
OctreeOpenCL
in parallel utilizing GPU.
Visits octree and calculates closest intersections. Can be reused multiple times.-
Constructor Summary
ConstructorsConstructorDescriptionBeamIntersectionVisitorImpl
(com.jogamp.opencl.CLContext context, MeshTriangle.Smoothing smoothing, boolean filter) Constructor compiles OpenCL source-code needed to calculate ray intersections -
Method Summary
Modifier and TypeMethodDescriptionvoid
Dispatches asynchronous kernel to calculate the closest ray intersections withOctreeOpenCL
.Checks if the results are ready and then copies them from GPUWaits for results and then copies them from GPU as MeshPoints Ignores calculated distances to speed-up readingvoid
release()
Explicitly releases GPU resources held by this objectvoid
setBeam
(WriteBufferGPU<javax.vecmath.Point3d> rayOriginsBuffer, WriteBufferGPU<javax.vecmath.Vector3d> rayDirectionsBuffer) StoresRay
components in visitorvoid
visitOctree
(OctreeOpenCL octree) Visits OpenCl Octree
-
Constructor Details
-
BeamIntersectionVisitorImpl
public BeamIntersectionVisitorImpl(com.jogamp.opencl.CLContext context, MeshTriangle.Smoothing smoothing, boolean filter) Constructor compiles OpenCL source-code needed to calculate ray intersections- Parameters:
smoothing
- Smoothing strategyfilter
- Iftrue
, then only triangles with the same orientation are taken into account
-
-
Method Details
-
visitOctree
Description copied from interface:BeamIntersectionVisitor
Visits OpenCl Octree- Specified by:
visitOctree
in interfaceBeamIntersectionVisitor
- Parameters:
octree
- instance ofOctreeOpenCL
-
setBeam
public void setBeam(WriteBufferGPU<javax.vecmath.Point3d> rayOriginsBuffer, WriteBufferGPU<javax.vecmath.Vector3d> rayDirectionsBuffer) Description copied from interface:BeamIntersectionVisitor
StoresRay
components in visitor- Specified by:
setBeam
in interfaceBeamIntersectionVisitor
- Parameters:
rayOriginsBuffer
- origin points of rayrayDirectionsBuffer
- common direction of all rays
-
calculateClosestIntersections
public void calculateClosestIntersections()Description copied from interface:BeamIntersectionVisitor
Dispatches asynchronous kernel to calculate the closest ray intersections withOctreeOpenCL
. The method does not wait for it to finish.- Specified by:
calculateClosestIntersections
in interfaceBeamIntersectionVisitor
-
readResultsAsMeshPoints
Description copied from interface:BeamIntersectionVisitor
Waits for results and then copies them from GPU as MeshPoints Ignores calculated distances to speed-up reading- Specified by:
readResultsAsMeshPoints
in interfaceBeamIntersectionVisitor
- Returns:
- Set of closest
MeshPoint
-
readResults
Description copied from interface:BeamIntersectionVisitor
Checks if the results are ready and then copies them from GPU- Specified by:
readResults
in interfaceBeamIntersectionVisitor
- Returns:
- Set of closest
RayIntersection
-
release
public void release()Description copied from interface:CLResources
Explicitly releases GPU resources held by this object- Specified by:
release
in interfaceCLResources
-