Interface MeshVisitor

All Known Subinterfaces:
AvgMeshVisitor, BoundingBoxVisitor, CrossSectionVisitor, CurvatureVisitor, GlyphsVisitor, IcpVisitor, MeshDistanceVisitor, PointSamplingVisitor
All Known Implementing Classes:
AvgMeshVisitorNN, AvgMeshVisitorRC, AvgMeshVisitorRCGPU, BoundingBoxVisitorImpl, CrossSectionVisitorImpl, CurvatureSampling, CurvatureVisitorImpl, GlyphsVisitorImpl, IcpVisitorImpl, MeshDistanceNN, MeshDistanceRC, MeshDistanceRCGPU, MeshDistanceVisitorImpl, NoSampling, PointSamplingVisitorImpl, PoissonDiskSubSampling, PoissonDiskSubSamplingGPU, RandomSampling, SymmetryVisitor, SymmetryVisitorMesh, SymmetryVisitorRobust, SymmetryVisitorRobustMesh, UniformSpaceSampling, UniformSurfaceSampling
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 MeshVisitor
Required interface for stateful inspection of meshes. It follows the principles of the Visitor GoF patterns. Once instantiated, the visitor can be gradually applied to multiple mesh facets. It inspects the state of the mesh facets one by one, and (cumulatively) computes results.

Implement this interface whenever you want to define new algorithm over a mesh.

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

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Dispose all disposable resources this visitor was using.
    default boolean
    Returns true if the implementation is thread-safe and then a single visitor instance can be applied to multiple mesh facets simultaneously.
    void
    The 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 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

      default void dispose()
      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.
    • visitMeshFacet

      void visitMeshFacet(MeshFacet facet)
      The inspection method to be implemented by specific visitors.
      Parameters:
      facet - Mesh facet to be visited.