From 608c6fbdee4729d0c479fe1c4c9782fc70b34da1 Mon Sep 17 00:00:00 2001 From: Daniel Schramm <xschramm@fi.muni.cz> Date: Wed, 22 Sep 2021 16:30:17 +0200 Subject: [PATCH] Unnecessarily repeated computation of feature point weights eliminated --- .../java/cz/fidentis/analyst/distance/DistanceAction.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/GUI/src/main/java/cz/fidentis/analyst/distance/DistanceAction.java b/GUI/src/main/java/cz/fidentis/analyst/distance/DistanceAction.java index d1d4d488..1498dc4c 100644 --- a/GUI/src/main/java/cz/fidentis/analyst/distance/DistanceAction.java +++ b/GUI/src/main/java/cz/fidentis/analyst/distance/DistanceAction.java @@ -125,6 +125,8 @@ public class DistanceAction extends ControlPanelAction { relativeDist, true); getSecondaryDrawableFace().getHumanFace().accept(visitor); + + setFeaturePointWeigths(); hausdorffDistance = null; } @@ -132,7 +134,6 @@ public class DistanceAction extends ControlPanelAction { if (hausdorffDistance == null) { hausdorffDistance = getWeightedDistance(); setHausdorffDistanceStatistics(); - setFeaturePointWeigths(); } getSecondaryDrawableFace().setHeatMap(hausdorffDistance); } @@ -189,11 +190,6 @@ public class DistanceAction extends ControlPanelAction { * the weights of feature points used to calculate the weighted Hausdorff distance. */ private void setFeaturePointWeigths() { - if (!weightedDist) { - controlPanel.updateFeaturePointWeights(Map.of()); - return; - } - controlPanel.updateFeaturePointWeights( visitor.getFeaturePointWeights() .get(getSecondaryDrawableFace().getHumanFace()) // Get FP weights for the secondary face -- GitLab