Skip to content
Snippets Groups Projects
Commit 9c78eab3 authored by Daniel Schramm's avatar Daniel Schramm
Browse files

Using visitor for computation of weighted Hausdorff distance

parent 7f1992d1
No related branches found
No related tags found
No related merge requests found
...@@ -2,9 +2,10 @@ package cz.fidentis.analyst.distance; ...@@ -2,9 +2,10 @@ package cz.fidentis.analyst.distance;
import cz.fidentis.analyst.canvas.Canvas; import cz.fidentis.analyst.canvas.Canvas;
import cz.fidentis.analyst.core.ControlPanelAction; import cz.fidentis.analyst.core.ControlPanelAction;
import cz.fidentis.analyst.visitors.mesh.HausdorffDistance; import cz.fidentis.analyst.visitors.face.HausdorffDistancePrioritized;
import cz.fidentis.analyst.visitors.mesh.HausdorffDistance.Strategy; import cz.fidentis.analyst.visitors.mesh.HausdorffDistance.Strategy;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.util.Map;
import javax.swing.JComboBox; import javax.swing.JComboBox;
import javax.swing.JTabbedPane; import javax.swing.JTabbedPane;
import javax.swing.JToggleButton; import javax.swing.JToggleButton;
...@@ -19,7 +20,7 @@ public class DistanceAction extends ControlPanelAction { ...@@ -19,7 +20,7 @@ public class DistanceAction extends ControlPanelAction {
/* /*
* Attributes handling the state * Attributes handling the state
*/ */
private HausdorffDistance visitor = null; private HausdorffDistancePrioritized visitor = null;
private String strategy = DistancePanel.STRATEGY_POINT_TO_POINT; private String strategy = DistancePanel.STRATEGY_POINT_TO_POINT;
private boolean relativeDist = false; private boolean relativeDist = false;
...@@ -81,9 +82,13 @@ public class DistanceAction extends ControlPanelAction { ...@@ -81,9 +82,13 @@ public class DistanceAction extends ControlPanelAction {
throw new UnsupportedOperationException(strategy); throw new UnsupportedOperationException(strategy);
} }
if (visitor == null) { if (visitor == null) {
this.visitor = new HausdorffDistance(getPrimaryDrawableFace().getModel(), useStrategy, relativeDist, true); this.visitor = new HausdorffDistancePrioritized(getPrimaryDrawableFace().getModel(),
getSecondaryDrawableFace().getModel().compute(visitor); Map.of(), // TODO temporary!!
useStrategy,
relativeDist,
true);
// getSecondaryDrawableFace().getModel().compute(visitor); // TODO temporary!!
} }
getSecondaryDrawableFace().setHeatMap(visitor.getDistances()); getSecondaryDrawableFace().setHeatMap(visitor.getDistances());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment