Commit db366b33 authored by yannick legoc's avatar yannick legoc
Browse files

Limit the reference axes display to the visible components and improved the...

Limit the reference axes display to the visible components and improved the switch between partial views
parent 7eb06ebf
......@@ -697,6 +697,8 @@ public class Nomad3DEditor extends Application {
public void setComponentAsRoot(Component component) {
Nomad3DEditor.getInstance().getModel().getRoot().resetVisible(component);
menuBar.setDisplayedRoot(component);
}
}
......@@ -2910,7 +2910,7 @@ public class EditorMenuBar extends MenuBar {
return;
}
Nomad3DEditor.getInstance().getModel().getRoot().focusSelection(Nomad3DEditor.getInstance().getModel().getSelection(), showType);
Nomad3DEditor.getInstance().getModel().getDisplayedRoot().focusSelection(Nomad3DEditor.getInstance().getModel().getSelection(), showType);
Nomad3DEditor.getInstance().getModel().clearSelection();
updateWalls();
......@@ -2964,12 +2964,12 @@ public class EditorMenuBar extends MenuBar {
// Restore the expanded state of the tree items.
Nomad3DEditor.getInstance().expandTreeView(newRootComponent.getTreeItem(), itemStates);
Nomad3DEditor.getInstance().getModel().setDisplayedRoot(newRootComponent);
updateAxes();
updateWalls();
updateSystem();
updateFocus();
Nomad3DEditor.getInstance().getModel().setDisplayedRoot(newRootComponent);
}
/**
......@@ -2979,15 +2979,20 @@ public class EditorMenuBar extends MenuBar {
private void updateScene() {
updateScene(Nomad3DEditor.getInstance().getModel().getDisplayedRoot());
}
public void setDisplayedRoot(Component component) {
if (component == null) {
updateScene(Nomad3DEditor.getInstance().getModel().getRoot());
}
else {
updateScene(component);
}
// Save the expanded state of the tree items.
HashMap<String, Boolean> itemStates = Nomad3DEditor.getInstance().getTreeViewExpandedStates(component.getTreeItem());
// Change the root tree item.
Nomad3DEditor.getInstance().getHierarchyView().setRoot(component.getTreeItem());
// Restore the expanded state of the tree items.
Nomad3DEditor.getInstance().expandTreeView(component.getTreeItem(), itemStates);
// Set the displayed root.
Nomad3DEditor.getInstance().getModel().setDisplayedRoot(component);
}
}
......@@ -62,6 +62,7 @@ public class HierarchyCell extends CheckBoxTreeCell<Component> {
// Get the component.
Component component = getItem();
// Set it as the displayed root.
Nomad3DEditor.getInstance().setComponentAsRoot(component);
}
});
......@@ -71,7 +72,8 @@ public class HierarchyCell extends CheckBoxTreeCell<Component> {
MenuItem displayAllTheComponentsItem = new MenuItem("Display All The Components");
displayAllTheComponentsItem.setOnAction(new EventHandler<ActionEvent>() {
public void handle(ActionEvent t) {
Nomad3DEditor.getInstance().setComponentAsRoot(null);
// Reset with the root component.
Nomad3DEditor.getInstance().setComponentAsRoot(Nomad3DEditor.getInstance().getModel().getRoot());
}
});
......
......@@ -47,6 +47,11 @@ public class ReferenceAxisListDisplay {
// Copy the loaded reference axis because its coordinates are in the local frame.
ReferenceAxis axis = new ReferenceAxis(a);
// Do not show the reference axes attached to invisible components.
if (axis.getComponent() != null && !axis.getComponent().isVisible()) {
continue;
}
// Apply the parent component transform to have the coordinates in the global frame.
axis.applyTransform();
......
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