Class MeshDistanceRCGPU
java.lang.Object
cz.fidentis.analyst.engines.distance.impl.MeshDistanceVisitorImpl
cz.fidentis.analyst.engines.distance.impl.MeshDistanceRCGPU
- All Implemented Interfaces:
MeshVisitor
,MeshDistanceVisitor
,Serializable
This visitor searches for the closest points of the primary mesh (provided to the constructor)
and inspected meshes by casting rays (RC) in the direction of normal vectors on the inspected mesh.
Computation is done on the GPU (if available). After GPU finishes visit (blocking), java-side reads the results from GPU.
The distance is computed either as absolute or relative. Absolute represents Euclidean distance (all numbers are positive). On the contrary, relative distance considers orientation of the visited mesh (determined by its normal vectors) and produces positive or negative distances depending on whether the primary mesh is "in front of" or "behind" the given vertex.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMeshDistanceRCGPU
(com.jogamp.opengl.GLContext context, Collection<MeshFacet> mainFacets, boolean relativeDistance) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Dispose all disposable resources this visitor was using.boolean
Returnstrue
if the implementation is thread-safe and then a single visitor instance can be applied to multiple mesh facets simultaneously.void
visitMeshFacet
(MeshFacet comparedFacet) The inspection method to be implemented by specific visitors.Methods inherited from class cz.fidentis.analyst.engines.distance.impl.MeshDistanceVisitorImpl
getDistancesOfVisitedFacets, inParallel, relativeDistance
-
Constructor Details
-
MeshDistanceRCGPU
public MeshDistanceRCGPU(com.jogamp.opengl.GLContext context, Collection<MeshFacet> mainFacets, boolean relativeDistance) Constructor. Creates 3D uniform grid and populates it with triangles from facets.- Parameters:
context
- active OpenGL context on which makeCurrent() can be called now and during visitmainFacets
- facets from which to take triangles, at least two triangles must be present in totalrelativeDistance
- If true, then the visitor calculates the relative distances with respect to the normal vectors of source facets (normal vectors have to present), i.e., we can get negative distances.- Throws:
IllegalArgumentException
- if some parameter is wrong
-
-
Method Details
-
visitMeshFacet
Description copied from interface:MeshVisitor
The inspection method to be implemented by specific visitors.- Parameters:
comparedFacet
- Mesh facet to be visited.
-
isThreadSafe
public boolean isThreadSafe()Description copied from interface:MeshVisitor
Returnstrue
if the implementation is thread-safe and then a single visitor instance can be applied to multiple mesh facets simultaneously.Thread-safe implementation means that any read or write from/to the visitor's state is protected by
synchronized
.- Returns:
true
if the implementation is thread-safe.
-
dispose
public void dispose()Description copied from interface:MeshVisitor
Dispose all disposable resources this visitor was using. Distances can still be retrieved after calling this method. Subclasses should override this method if they need to dispose something.- Specified by:
dispose
in interfaceMeshVisitor
- Overrides:
dispose
in classMeshDistanceVisitorImpl
-