diff --git a/Comparison/src/main/java/cz/fidentis/analyst/visitors/face/HausdorffDistancePrioritized.java b/Comparison/src/main/java/cz/fidentis/analyst/visitors/face/HausdorffDistancePrioritized.java index f9b4f90e7ae63cade08434ffa9da2ccd55d227de..3078c7753b11f5dc8adeb31c163d7dbbc39018bd 100644 --- a/Comparison/src/main/java/cz/fidentis/analyst/visitors/face/HausdorffDistancePrioritized.java +++ b/Comparison/src/main/java/cz/fidentis/analyst/visitors/face/HausdorffDistancePrioritized.java @@ -44,8 +44,8 @@ public class HausdorffDistancePrioritized extends HumanFaceVisitor { private final Set<FeaturePointType> featurePointTypes; - private final Map<FeaturePointType, Map<MeshFacet, List<Double>>> priorities = new HashMap<>(); - private final Map<FeaturePointType, Map<MeshFacet, Double>> featurePointWeights = new HashMap<>(); + private final Map<HumanFace, Map<FeaturePointType, Map<MeshFacet, List<Double>>>> priorities = new HashMap<>(); + private final Map<HumanFace, Map<FeaturePointType, Map<MeshFacet, Double>>> featurePointWeights = new HashMap<>(); /** * Constructor. @@ -179,27 +179,11 @@ public class HausdorffDistancePrioritized extends HumanFaceVisitor { return distanceVisitor.getNearestPoints(); } - /** - * Returns priorities of points of the visited faces' mesh facets with respect to - * the given feature point types. - * - * Keys in the (outer) map contain types of feature points according to which the Hausdorff - * distances are prioritized. - * For each feature point type, a map of priorities of vertices of the visited - * faces' mesh facets is stored. - * Keys in this (inner) map contain mesh facets of the visited human faces. - * For each facet of the visited human face, a list of priorities is stored. - * The order of priorities corresponds to the order of vertices - * in the visited facet, i.e., the i-th value is the priority of the i-th vertex - * of the visited face's facet. - * - * @return Priorities of all points of all the visited human faces' facets - */ - public Map<FeaturePointType, Map<MeshFacet, List<Double>>> getPriorities() { + public Map<HumanFace, Map<FeaturePointType, Map<MeshFacet, List<Double>>>> getPriorities() { return Collections.unmodifiableMap(priorities); } - public Map<FeaturePointType, Map<MeshFacet, Double>> getFeaturePointWeights() { + public Map<HumanFace, Map<FeaturePointType, Map<MeshFacet, Double>>> getFeaturePointWeights() { return Collections.unmodifiableMap(featurePointWeights); } @@ -250,11 +234,13 @@ public class HausdorffDistancePrioritized extends HumanFaceVisitor { final PrioritySphere priorityVisitor = new PrioritySphere(featurePoint.getPosition(), computeSphereRadius(humanFace)); humanFace.getMeshModel().compute(priorityVisitor, inParallel()); - synchronized(this) { + synchronized (this) { // Retrieve results from the visitor's internal structure - priorities.computeIfAbsent(fpType, featurePointType -> new HashMap<>()) + priorities.computeIfAbsent(humanFace, face -> new HashMap<>()) + .computeIfAbsent(fpType, featurePointType -> new HashMap<>()) .putAll(priorityVisitor.getPriorities()); - featurePointWeights.computeIfAbsent(fpType, featurePointType -> new HashMap<>()) + featurePointWeights.computeIfAbsent(humanFace, face -> new HashMap<>()) + .computeIfAbsent(fpType, featurePointType -> new HashMap<>()) .putAll(priorityVisitor.getWeightedDistances()); } }