Record Class MeshDistanceConfig

java.lang.Object
java.lang.Record
cz.fidentis.analyst.engines.distance.MeshDistanceConfig
Record Components:
method - Distance calculation method
kdTree - K-d tree of the mesh to which distance from other meshes is to be computed. Either this parameter or the octree must not be null, depending on the method used.
octree - Octree of the mesh to which distance from other meshes is to be computed. Either this parameter or the kdTree must not be null, depending on the method used.
gpuData - Wrapper with data for GPU computing, can be null if you do not want to use GPU-based method.
relativeDist - 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.
crop - If true, then only parts of the visited secondary faces that overlay the primary face are taken into account. Parts (vertices) that are out of the surface of the primary face are ignored (their distance is set to NaN). This feature makes the nearest-neighbor distance computation more symmetric. On the contrary, this parameter is ignored by ray-casting methods.

public record MeshDistanceConfig(MeshDistanceConfig.Method method, KdTree kdTree, Octree octree, MeshDistanceConfig.GPUData gpuData, boolean relativeDist, boolean crop) extends Record
Mesh-to-mesh distance strategies and their configuration.
  • Constructor Details

    • MeshDistanceConfig

      public MeshDistanceConfig(MeshDistanceConfig.Method method, KdTree kdTree, boolean relativeDist, boolean crop)
      Constructor for the nearest-neighbor distance methods only, when the k-D tree already exists.
      Parameters:
      method - Distance calculation method
      kdTree - K-d tree of the mesh to which distance from other meshes is to be computed. Must not be null
      relativeDist - 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.
      crop - If true, then only parts of the visited secondary faces that overlay the primary face are taken into account. Parts (vertices) that are out of the surface of the primary face are ignored (their distance is set to NaN). This feature makes the nearest-neighbor distance computation more symmetric. On the contrary, this parameter is ignored by ray-casting methods.
    • MeshDistanceConfig

      public MeshDistanceConfig(MeshDistanceConfig.Method method, Octree octree, boolean relativeDist)
      Constructor for the ray-casting distance methods only, when the octree already exists.
      Parameters:
      method - Distance calculation method
      octree - An octree of the mesh to which distance from other meshes is to be computed. Must not be null
      relativeDist - 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.
    • MeshDistanceConfig

      public MeshDistanceConfig(MeshDistanceConfig.Method method, Collection<MeshFacet> mainFacets, com.jogamp.opengl.GLContext context, boolean relativeDist, boolean crop)
      Constructor that creates k-d tree or octree automatically based on required method.
      Parameters:
      method - Distance calculation method
      mainFacets - Facets to which distance from other facets is to be computed. Must not be null
      context - Active OpenGL context on which makeCurrent() can be called.
      relativeDist - 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.
      crop - If true, then only parts of the visited secondary faces that overlay the primary face are taken into account. Parts (vertices) that are out of the surface of the primary face are ignored (their distance is set to NaN). This feature makes the distance computation more symmetric. On the contrary, this parameter is ignored by ray-casting methods.
    • MeshDistanceConfig

      public MeshDistanceConfig(MeshDistanceConfig.Method method, MeshFacet mainFacet, com.jogamp.opengl.GLContext context, boolean relativeDist, boolean crop)
      Constructor that creates k-d tree or octree automatically based on required method.
      Parameters:
      method - Distance calculation method
      mainFacet - Facet to which distance from other facets is to be computed. Must not be null
      context - Active OpenGL context on which makeCurrent() can be called.
      relativeDist - 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.
      crop - If true, then only parts of the visited secondary faces that overlay the primary face are taken into account. Parts (vertices) that are out of the surface of the primary face are ignored (their distance is set to NaN). This feature makes the distance computation more symmetric. On the contrary, this parameter is ignored by ray-casting methods.
    • MeshDistanceConfig

      public MeshDistanceConfig(MeshDistanceConfig.Method method, MeshModel mainModel, com.jogamp.opengl.GLContext context, boolean relativeDist, boolean crop)
      Constructor that creates k-d tree or octree automatically based on required method.
      Parameters:
      method - Distance calculation method
      mainModel - Mesh model to which distance from other facets is to be computed. Must not be null
      context - Active OpenGL context on which makeCurrent() can be called.
      relativeDist - 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.
      crop - If true, then only parts of the visited secondary faces that overlay the primary face are taken into account. Parts (vertices) that are out of the surface of the primary face are ignored (their distance is set to NaN). This feature makes the distance computation more symmetric. On the contrary, this parameter is ignored by ray-casting methods.
    • MeshDistanceConfig

      public MeshDistanceConfig(MeshDistanceConfig.Method method, KdTree kdTree, Octree octree, MeshDistanceConfig.GPUData gpuData, boolean relativeDist, boolean crop)
      Creates an instance of a MeshDistanceConfig record class.
      Parameters:
      method - the value for the method record component
      kdTree - the value for the kdTree record component
      octree - the value for the octree record component
      gpuData - the value for the gpuData record component
      relativeDist - the value for the relativeDist record component
      crop - the value for the crop record component
  • Method Details

    • getVisitor

      public MeshDistanceVisitor getVisitor()
      Instantiates and returns a point sampling visitor.
      Returns:
      a point sampling visitor
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • method

      public MeshDistanceConfig.Method method()
      Returns the value of the method record component.
      Returns:
      the value of the method record component
    • kdTree

      public KdTree kdTree()
      Returns the value of the kdTree record component.
      Returns:
      the value of the kdTree record component
    • octree

      public Octree octree()
      Returns the value of the octree record component.
      Returns:
      the value of the octree record component
    • gpuData

      public MeshDistanceConfig.GPUData gpuData()
      Returns the value of the gpuData record component.
      Returns:
      the value of the gpuData record component
    • relativeDist

      public boolean relativeDist()
      Returns the value of the relativeDist record component.
      Returns:
      the value of the relativeDist record component
    • crop

      public boolean crop()
      Returns the value of the crop record component.
      Returns:
      the value of the crop record component