forked from 1b-agent/opencadstudio-upstream
Feat: Phase 1.5 — viewport count in status bar + REVCLOUD command
Status bar: shows "N VP" pill (with tooltip) when in a paper layout that has user viewports (id > 1). New Scene::viewport_count() method. REVCLOUD: closed LwPolyline with arc bumps (bulge = 0.5) along each edge. Click polygon corners, Enter to close into a revision cloud shape. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
1 parent
c9719bacdf
commit
1572d0c38f
3 files changed
+34
-1
No files matched your search
@@ -228,6 +228,24 @@ impl Scene {
|
||||
})
|
||||
}
|
||||
|
||||
/// Count of user viewports (id > 1) in the current layout.
|
||||
pub fn viewport_count(&self) -> usize {
|
||||
if self.current_layout == "Model" {
|
||||
return 0;
|
||||
}
|
||||
let layout_block = self.current_layout_block_handle();
|
||||
if layout_block.is_null() {
|
||||
return 0;
|
||||
}
|
||||
self.document.entities().filter(|e| {
|
||||
if let EntityType::Viewport(vp) = e {
|
||||
vp.id > 1 && vp.common.owner_handle == layout_block
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}).count()
|
||||
}
|
||||
|
||||
/// Sorted list of layout names: "Model" first, then paper layouts by tab order.
|
||||
pub fn layout_names(&self) -> Vec<String> {
|
||||
let mut names = vec!["Model".to_string()];
|
||||
|
||||
Reference in new issue
Block a user