Class ClosestMeshVerticesImpl
java.lang.Object
cz.fidentis.analyst.engines.point2surface.impl.ClosestMeshVerticesImpl
- All Implemented Interfaces:
KdTreeVisitor
,PointToSurfaceDistanceVisitor
This visitor finds the minimal distance between the given 3D point and points
(e.g., mesh vertices) stored in visited k-d trees.
All closest mesh facets and all their closest vertices are returned in addition to the distance.
Possible independent vertices stored in the visited k-d tree are skipped at this moment
as they have no associated mesh facet.
-
Constructor Summary
ConstructorsConstructorDescriptionClosestMeshVerticesImpl
(javax.vecmath.Point3d point, boolean checkOverlay) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the minimal found distance between a 3D point (set in a constructor) and visited mesh facets.Returns the closest mesh facets and their closest points.protected void
void
visitKdTree
(KdTree kdTree) The main inspection method to be implemented by specific visitors.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.kdtree.KdTreeVisitor
isThreadSafe
-
Constructor Details
-
ClosestMeshVerticesImpl
public ClosestMeshVerticesImpl(javax.vecmath.Point3d point, boolean checkOverlay) Constructor.- Parameters:
point
- A 3D point from which distance is computed. Must not benull
checkOverlay
- Iftrue
and the closest point to the given 3D reference point lies on the boundary of the mesh stored in the k-d tree, then the reference point is considered "outside" of the mesh and the distance is set to infinity.
-
-
Method Details
-
getNearestPoints
Description copied from interface:PointToSurfaceDistanceVisitor
Returns the closest mesh facets and their closest points. As there can be more point in the same (smallest) distance, the method returns a list instead of a single point. Similarly, as the closest point(s) can belong to multiple facets, a map of facet is returned instead of a single facet.- Specified by:
getNearestPoints
in interfacePointToSurfaceDistanceVisitor
- Returns:
- closest mesh facets and their closest points.
-
getDistance
public double getDistance()Description copied from interface:PointToSurfaceDistanceVisitor
Returns the minimal found distance between a 3D point (set in a constructor) and visited mesh facets.- Specified by:
getDistance
in interfacePointToSurfaceDistanceVisitor
- Returns:
- the minimal found distance,
Double.POSITIVE_INFINITY
if no distance has been computed so far
-
visitKdTree
Description copied from interface:KdTreeVisitor
The main inspection method to be implemented by specific visitors.- Specified by:
visitKdTree
in interfaceKdTreeVisitor
- Parameters:
kdTree
- K-d tree to be visited
-
setNearestVertices
protected void setNearestVertices()
-