Interface KdTreeVisitor

All Known Subinterfaces:
AvgMeshVisitor, PointToSurfaceDistanceVisitor
All Known Implementing Classes:
AvgMeshVisitorNN, AvgMeshVisitorRC, AvgMeshVisitorRCGPU, ClosestMeshVerticesImpl, ClosestNodesImpl, ClosestSurfacePointsImpl
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface KdTreeVisitor
When instantiated, the object can be gradually applied to multiple k-d trees. It inspects the state of the tree one by one, and (cumulatively) computes results.

Implement this interface whenever you want to define new algorithm over a k-d tree.

If the visitor is thread-safe, then a single instance of the visitor can visit concurrently (and asynchronously) multiple k-d trees. Otherwise, the parallel inspection is still possible, but a new instance of the visitor has to be used for each k-d tree.

  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Returns true if the implementation is thread-safe and then a single visitor instance can be applied to multiple k-d trees simultaneously.
    void
    The main inspection method to be implemented by specific visitors.
  • Method Details

    • isThreadSafe

      default boolean isThreadSafe()
      Returns true if the implementation is thread-safe and then a single visitor instance can be applied to multiple k-d trees 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.
    • visitKdTree

      void visitKdTree(KdTree kdTree)
      The main inspection method to be implemented by specific visitors.
      Parameters:
      kdTree - K-d tree to be visited