Class ClosestMeshVerticesImpl

java.lang.Object
cz.fidentis.analyst.engines.point2surface.impl.ClosestMeshVerticesImpl
All Implemented Interfaces:
KdTreeVisitor, PointToSurfaceDistanceVisitor

public class ClosestMeshVerticesImpl extends Object implements 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 Details

    • ClosestMeshVerticesImpl

      public ClosestMeshVerticesImpl(javax.vecmath.Point3d point, boolean checkOverlay)
      Constructor.
      Parameters:
      point - A 3D point from which distance is computed. Must not be null
      checkOverlay - If true 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

      public Map<MeshFacet,List<MeshPoint>> 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 interface PointToSurfaceDistanceVisitor
      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 interface PointToSurfaceDistanceVisitor
      Returns:
      the minimal found distance, Double.POSITIVE_INFINITY if no distance has been computed so far
    • visitKdTree

      public void visitKdTree(KdTree kdTree)
      Description copied from interface: KdTreeVisitor
      The main inspection method to be implemented by specific visitors.
      Specified by:
      visitKdTree in interface KdTreeVisitor
      Parameters:
      kdTree - K-d tree to be visited
    • setNearestVertices

      protected void setNearestVertices()