Class AvgMeshVisitorRC

java.lang.Object
cz.fidentis.analyst.engines.avgmesh.impl.AvgMeshVisitorRC
All Implemented Interfaces:
KdTreeVisitor, MeshVisitor, OctreeVisitor, AvgMeshVisitor
Direct Known Subclasses:
AvgMeshVisitorRCGPU

public class AvgMeshVisitorRC extends Object implements AvgMeshVisitor
Visitor capable to create an average face by deforming main face template so that its vertices are in the "average position" with respect to the visited faces. The average position is computed as the average position of intersections of visited faces. Intersection are computed using ray casting It is supposed that the inspected faces are already registered (superimposed with the template ).
  • Constructor Details

    • AvgMeshVisitorRC

      public AvgMeshVisitorRC(MeshFacet templateFacet)
      Constructor.
      Parameters:
      templateFacet - Mesh facet which is transformed to the averaged mesh. The original mesh remains unchanged. New mesh is allocated instead.
      Throws:
      IllegalArgumentException - if some parameter is wrong
    • AvgMeshVisitorRC

      public AvgMeshVisitorRC(Collection<MeshFacet> templateFacets)
      Constructor.
      Parameters:
      templateFacets - Mesh facets that are transformed to the averaged mesh The original mesh remains unchanged. New mesh is allocated instead.
      Throws:
      IllegalArgumentException - if some parameter is wrong
    • AvgMeshVisitorRC

      public AvgMeshVisitorRC(MeshModel templateModel)
      Constructor.
      Parameters:
      templateModel - Mesh model which is transformed to the averaged mesh The original mesh remains unchanged. New mesh is allocated instead.
      Throws:
      IllegalArgumentException - if some parameter is wrong
  • Method Details

    • isThreadSafe

      public boolean isThreadSafe()
      Description copied from interface: KdTreeVisitor
      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.

      Specified by:
      isThreadSafe in interface AvgMeshVisitor
      Specified by:
      isThreadSafe in interface KdTreeVisitor
      Specified by:
      isThreadSafe in interface MeshVisitor
      Specified by:
      isThreadSafe in interface OctreeVisitor
      Returns:
      true if the implementation is thread-safe.
    • visitOctree

      public void visitOctree(Octree octree)
      Description copied from interface: OctreeVisitor
      The main inspection method to be implemented by specific visitors.
      Specified by:
      visitOctree in interface AvgMeshVisitor
      Specified by:
      visitOctree in interface OctreeVisitor
      Parameters:
      octree - octree to be visited
    • getAveragedMeshModel

      public MeshModel getAveragedMeshModel()
      Description copied from interface: AvgMeshVisitor
      Returns the averaged mesh model
      Specified by:
      getAveragedMeshModel in interface AvgMeshVisitor
      Returns:
      averaged mesh model
    • getNumInspectedFacets

      protected int getNumInspectedFacets()
    • getTransformations

      protected Map<MeshFacet,List<Double>> getTransformations()
    • setAvgMeshModel

      protected void setAvgMeshModel(MeshModel avgMeshModel)
    • setNumInspectedFacets

      protected void setNumInspectedFacets(int numInspectedFacets)
    • singleRayIntersection

      protected double singleRayIntersection(Octree octree, Ray ray)
      Computes ray intersection and returns its distance, either positive or negative. Returns NaN if no intersection was found.
      Parameters:
      octree - Octree
      ray - Ray
      Returns:
      distance to the intersection point.