Commit 9008b5c3 authored by legoc's avatar legoc
Browse files

Saving zero position and move all axes to zero position

parent cdb98132
......@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>fr.ill.ics</groupId>
<artifactId>nomad-3d-editor</artifactId>
<version>0.0.1</version>
<version>0.0.2-SNAPSHOT</version>
<distributionManagement>
<repository>
......@@ -41,7 +41,7 @@
<dependency>
<groupId>fr.ill.ics</groupId>
<artifactId>nomad-3d-commons</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.2-SNAPSHOT</version>
</dependency>
</dependencies>
......
......@@ -142,7 +142,6 @@ public class Nomad3DEditor extends Application {
}
Logger.getLogger("nomad-3d").info("Starting " + TITLE + "...");
// TODO DEBUG
// NomadLinker.getInstance().displayProperties();
model = null;
......
......@@ -534,17 +534,17 @@ public class EditorMenuBar extends MenuBar {
scenePane.addRow(1, calibratePane);
GridPane.setMargin(calibratePane, new Insets(5));
Button minButton = new Button("Set min value");
Button minButton = new Button("Set min");
minButton.setPrefWidth(125);
minButton.setOnAction(minEvent -> {
selectedAxis.setMinValue(selectedAxis.getValue());
});
Button medianButton = new Button("Set median value");
Button medianButton = new Button("Set zero");
medianButton.setPrefWidth(125);
medianButton.setOnAction(medianEvent -> {
selectedAxis.setMedianValue(selectedAxis.getValue());
selectedAxis.setZeroValue(selectedAxis.getValue());
});
Button maxButton = new Button("Set max value");
Button maxButton = new Button("Set max");
maxButton.setPrefWidth(125);
maxButton.setOnAction(maxEvent -> {
selectedAxis.setMaxValue(selectedAxis.getValue());
......@@ -562,12 +562,12 @@ public class EditorMenuBar extends MenuBar {
Button resetButton = new Button("Reset");
resetButton.setPrefWidth(100);
final double minInit = selectedAxis.getMinValue();
final double medianInit = selectedAxis.getMedianValue();
final double zeroInit = selectedAxis.getZeroValue();
final double maxInit = selectedAxis.getMaxValue();
final double valueInit = selectedAxis.getValue();
resetButton.setOnAction(resetEvent -> {
selectedAxis.setMinValue(minInit);
selectedAxis.setMedianValue(medianInit);
selectedAxis.setZeroValue(zeroInit);
selectedAxis.setMaxValue(maxInit);
selectedAxis.move(valueInit - selectedAxis.getValue());
});
......@@ -638,7 +638,7 @@ public class EditorMenuBar extends MenuBar {
nomad3DPane.addRow(i++, new Label("Direction :"), new Label(dirStr));
nomad3DPane.addRow(i++, new Label("Position :"), new Label(posStr));
nomad3DPane.addRow(i++, new Label("Min value :"), new Label(df.format(selectedAxis.getMinValue())));
nomad3DPane.addRow(i++, new Label("Median value :"), new Label(df.format(selectedAxis.getMedianValue())));
nomad3DPane.addRow(i++, new Label("Median value :"), new Label(df.format(selectedAxis.getZeroValue())));
nomad3DPane.addRow(i++, new Label("Max value :"), new Label(df.format(selectedAxis.getMaxValue())));
GridPane nomadPane = new GridPane();
......@@ -1158,7 +1158,7 @@ public class EditorMenuBar extends MenuBar {
if (System.getProperty("os.name").toUpperCase().startsWith("WIN")) {
blenderExe = "C:\\Program Files\\Blender Foundation\\Blender\\blender.exe";
}
// TODO get this from somewhere
double decimateRatio = 0.5;
String converterPath = ".." + File.separator + "nomad-3d-converter";
......@@ -1323,7 +1323,7 @@ public class EditorMenuBar extends MenuBar {
if (System.getProperty("os.name").toUpperCase().startsWith("WIN")) {
blenderExe = "C:\\Program Files\\Blender Foundation\\Blender\\blender.exe";
}
// TODO get this from somewhere
double decimateRatio = 0.5;
String converterPath = ".." + File.separator + "nomad-3d-converter";
......@@ -1563,6 +1563,7 @@ public class EditorMenuBar extends MenuBar {
}
});
this.showConfig = new Menu("Show configuration");
MenuItem resetMoveItem = new MenuItem("Reset movement");
resetMoveItem.setAccelerator(new KeyCodeCombination(KeyCode.R, KeyCombination.SHIFT_DOWN));
resetMoveItem.setOnAction(new EventHandler<ActionEvent>() {
......@@ -1571,6 +1572,16 @@ public class EditorMenuBar extends MenuBar {
Nomad3DEditor.getInstance().getModel().resetMovement();
}
});
MenuItem moveToZeroItem = new MenuItem("Move to zero");
moveToZeroItem.setAccelerator(new KeyCodeCombination(KeyCode.Z, KeyCombination.SHIFT_DOWN));
moveToZeroItem.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
Nomad3DEditor.getInstance().getModel().setToZeroAxisTransform();
}
});
MenuItem statsItem = new MenuItem("Statistics");
statsItem.setAccelerator(new KeyCodeCombination(KeyCode.S, KeyCombination.SHIFT_DOWN));
statsItem.setOnAction(new EventHandler<ActionEvent>() {
......@@ -1624,7 +1635,7 @@ public class EditorMenuBar extends MenuBar {
new SeparatorMenuItem(),
showAxesItem, showSystemItem, showWallsItem,
new SeparatorMenuItem(),
this.showConfig, resetMoveItem,
this.showConfig, resetMoveItem, moveToZeroItem,
new SeparatorMenuItem(),
statsItem);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment