forked from 1b-agent/opencadstudio-upstream
feat(statusbar): isolate / hide objects with status pill
Add a hidden-entity set to the scene that the tessellation visibility test skips, so hidden objects neither render nor hit-test. New commands ISOLATEOBJECTS (show only the selection), HIDEOBJECTS (hide the selection) and UNISOLATEOBJECTS (restore). An ISO status pill lights up while anything is hidden and restores everything on click. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
243a0bc923
commit
e0e7897952
5 files changed
+106
No files matched your search
@@ -332,6 +332,44 @@ impl OpenCADStudio {
|
||||
}
|
||||
}
|
||||
|
||||
// ISOLATEOBJECTS — hide every object except the current selection
|
||||
"ISOLATEOBJECTS" => {
|
||||
if self.tabs[i].scene.selected.is_empty() {
|
||||
self.command_line
|
||||
.push_error("ISOLATEOBJECTS: select the objects to isolate first.");
|
||||
} else {
|
||||
let n = self.tabs[i].scene.selected.len();
|
||||
self.tabs[i].scene.isolate_selected();
|
||||
self.command_line.push_info(&format!(
|
||||
"Isolated {n} object(s). UNISOLATEOBJECTS to restore."
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
// HIDEOBJECTS — hide the current selection
|
||||
"HIDEOBJECTS" => {
|
||||
if self.tabs[i].scene.selected.is_empty() {
|
||||
self.command_line
|
||||
.push_error("HIDEOBJECTS: select the objects to hide first.");
|
||||
} else {
|
||||
let n = self.tabs[i].scene.selected.len();
|
||||
self.tabs[i].scene.hide_selected();
|
||||
self.command_line
|
||||
.push_info(&format!("Hid {n} object(s). UNISOLATEOBJECTS to restore."));
|
||||
}
|
||||
}
|
||||
|
||||
// UNISOLATEOBJECTS — bring back everything hidden by Isolate / Hide
|
||||
"UNISOLATEOBJECTS" => {
|
||||
if self.tabs[i].scene.is_isolation_active() {
|
||||
self.tabs[i].scene.end_isolation();
|
||||
self.command_line
|
||||
.push_info("Isolation ended — all objects shown.");
|
||||
} else {
|
||||
self.command_line.push_info("No hidden objects.");
|
||||
}
|
||||
}
|
||||
|
||||
// LAYUNISO — restore all layers that were turned off by LAYISO (turn all on)
|
||||
"LAYUNISO" => {
|
||||
self.push_undo_snapshot(i, "LAYUNISO");
|
||||
|
||||
@@ -1159,6 +1159,7 @@ impl OpenCADStudio {
|
||||
self.clean_screen,
|
||||
tab.scene.document.header.insertion_units,
|
||||
self.units_popup_open,
|
||||
tab.scene.is_isolation_active(),
|
||||
&self.statusbar_config,
|
||||
)
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user