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

Hasdorff distance recalculated immediately when feature point highlighted

parent efded212
No related branches found
No related tags found
No related merge requests found
......@@ -167,26 +167,23 @@ public class DistanceAction extends ControlPanelAction {
break;
case DistancePanel.ACTION_COMMAND_SET_DISTANCE_STRATEGY:
strategy = (String) ((JComboBox) ae.getSource()).getSelectedItem();
this.visitor = null; // recompute
updateHausdorffDistanceInformation();
recompute();
break;
case DistancePanel.ACTION_COMMAND_RELATIVE_ABSOLUTE_DIST:
this.relativeDist = ((JToggleButton) ae.getSource()).isSelected();
this.visitor = null; // recompute
updateHausdorffDistanceInformation();
recompute();
break;
case DistancePanel.ACTION_COMMAND_FEATURE_POINT_HIGHLIGHT:
highlightFeaturePoint((LoadedActionEvent) ae);
recompute();
break;
case DistancePanel.ACTION_COMMAND_FEATURE_POINT_SELECT_ALL:
highlightAllFeaturePoints(true);
this.visitor = null; // recompute
updateHausdorffDistanceInformation();
recompute();
break;
case DistancePanel.ACTION_COMMAND_FEATURE_POINT_SELECT_NONE:
highlightAllFeaturePoints(false);
this.visitor = null; // recompute
updateHausdorffDistanceInformation();
recompute();
break;
case DistancePanel.ACTION_COMMAND_FEATURE_POINT_HOVER_IN:
hoverFeaturePoint((LoadedActionEvent) ae, true);
......@@ -198,8 +195,7 @@ public class DistanceAction extends ControlPanelAction {
resizeFeaturePoint((LoadedActionEvent) ae);
break;
case DistancePanel.ACTION_COMMAND_DISTANCE_RECOMPUTE:
this.visitor = null; // recompute
updateHausdorffDistanceInformation();
recompute();
break;
default:
// to nothing
......@@ -207,6 +203,15 @@ public class DistanceAction extends ControlPanelAction {
renderScene();
}
/**
* Recalculates the Hausdorff distance and updates all GUI elements
* of {@link DistancePanel}.
*/
private void recompute() {
this.visitor = null;
updateHausdorffDistanceInformation();
}
/**
* (Re)calculates the Hausdorff distance and updates the heat map of the secondary face
* as well as values of all appropriate GUI elements of {@link DistancePanel}.
......
......@@ -113,10 +113,9 @@ public class DistancePanel extends ControlPanel {
final JCheckBox checkBox = fpBuilder.addCheckBox(
selectedFPs.contains(featurePointType),
createListener(action, ACTION_COMMAND_DISTANCE_RECOMPUTE)
createListener(action, ACTION_COMMAND_FEATURE_POINT_HIGHLIGHT, i)
);
checkBox.setText(featurePointType.getName());
checkBox.addActionListener(createListener(action, ACTION_COMMAND_FEATURE_POINT_HIGHLIGHT, i));
final int index = i;
checkBox.addMouseListener(new MouseAdapter() {
@Override
......
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