Commit 608c6fbd authored by Daniel Schramm's avatar Daniel Schramm
Browse files

Unnecessarily repeated computation of feature point weights eliminated

parent 9b0c8eb1
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -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