Class MeshDistanceVisitorImpl
java.lang.Object
cz.fidentis.analyst.engines.distance.impl.MeshDistanceVisitorImpl
- All Implemented Interfaces:
MeshVisitor
,MeshDistanceVisitor
,Serializable
- Direct Known Subclasses:
MeshDistanceNN
,MeshDistanceRC
,MeshDistanceRCGPU
An abstract class for distance visitors that search for the distances of inspected meshes (their vertices)
to the primary mesh, which is provided to the visitor's constructor.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
MeshDistanceVisitorImpl
(boolean relativeDistance, boolean parallel) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Dispose all disposable resources this visitor was using.Returns the distance of inspected mesh facets to the source mesh facets.boolean
Returnstrue
if the distance computation is parallel.boolean
Returnstrue
if the distance was computed as relative (with possibly negative values).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface cz.fidentis.analyst.data.mesh.MeshVisitor
isThreadSafe, visitMeshFacet
-
Constructor Details
-
MeshDistanceVisitorImpl
protected MeshDistanceVisitorImpl(boolean relativeDistance, boolean parallel) Constructor.- Parameters:
relativeDistance
- 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.parallel
- Iftrue
, then the algorithm runs concurrently utilizing all CPU cores- Throws:
IllegalArgumentException
- if some parameter is wrong
-
-
Method Details
-
getDistancesOfVisitedFacets
Description copied from interface:MeshDistanceVisitor
Returns the distance of inspected mesh facets to the source mesh facets.If non or multiple closest points were found or if the point was auto-cropped, then the distance is set to
Double.POSITIVE_INFINITY
and the nearest neighbor is set tonull
.- Specified by:
getDistancesOfVisitedFacets
in interfaceMeshDistanceVisitor
- Returns:
- the distance of inspected mesh facets to the source mesh facets.
-
relativeDistance
public boolean relativeDistance()Description copied from interface:MeshDistanceVisitor
Returnstrue
if the distance was computed as relative (with possibly negative values).- Specified by:
relativeDistance
in interfaceMeshDistanceVisitor
- Returns:
true
if the distance is computed as relative,false
otherwise.
-
inParallel
public boolean inParallel()Description copied from interface:MeshDistanceVisitor
Returnstrue
if the distance computation is parallel.- Specified by:
inParallel
in interfaceMeshDistanceVisitor
- Returns:
true
if the distance computation is parallel.
-
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
-