forked from 1b-agent/opencadstudio-upstream
Point clouds: attach dialog, crop toolbar, stylize, palette rows
POINTCLOUDATTACH opens the Attach Point Cloud dialog after the file is chosen; its Attach button lives in the Attach Underlay list instead of a separate Insert panel. A selected cloud brings the crop tools to the right-edge toolbar. POINTCLOUDSTYLIZE sets the stylization with the reference's prompts, the External References palette lists point clouds (unload, reload, detach, path), and definitions keep the header extents. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3afd547e28
commit
c2d9ac5ae2
48 files changed
+1711
-83
No files matched your search
@@ -59,6 +59,24 @@ pub fn pdf_underlay_tools(kind: codec::entities::UnderlayType) -> Vec<ToolDef> {
|
||||
tools
|
||||
}
|
||||
|
||||
/// Point cloud tools: the three crops, showing, inverting and removing
|
||||
/// them, and the palette.
|
||||
pub fn point_cloud_tools() -> Vec<ToolDef> {
|
||||
vec![
|
||||
tool("_PCCROPRECT", "Rectangular\nCrop", CLIP),
|
||||
tool("_PCCROPPOLY", "Polygonal\nCrop", CLIP),
|
||||
tool("_PCCROPCIRC", "Circular\nCrop", CLIP),
|
||||
tool(
|
||||
"_PCCROPSHOW",
|
||||
"Show\nCropping",
|
||||
include_bytes!("../../../assets/icons/underlay_frames.svg"),
|
||||
),
|
||||
tool("_PCCROPINVERT", "Invert\nCropping", CLIP),
|
||||
tool("_PCUNCROP", "Remove All\nCropping", UNCLIP),
|
||||
tool("EXTERNALREFERENCES", "External\nReferences", crate::ui::icons::FOLDER_OPEN),
|
||||
]
|
||||
}
|
||||
|
||||
/// External reference tools: edit, open, clipping and the palette.
|
||||
pub fn xref_tools() -> Vec<ToolDef> {
|
||||
vec![
|
||||
@@ -90,6 +108,15 @@ impl Ribbon {
|
||||
self.xref_ctx
|
||||
}
|
||||
|
||||
/// Only point clouds are selected: whether the first shows its crops.
|
||||
pub fn set_point_cloud_context(&mut self, context: Option<bool>) {
|
||||
self.point_cloud_ctx = context;
|
||||
}
|
||||
|
||||
pub fn point_cloud_context(&self) -> Option<bool> {
|
||||
self.point_cloud_ctx
|
||||
}
|
||||
|
||||
/// Select a tab by its module id.
|
||||
pub fn select_by_id(&mut self, id: &str) -> bool {
|
||||
match self.modules.iter().position(|m| m.id() == id) {
|
||||
|
||||
@@ -26,7 +26,7 @@ pub(crate) use draw_panel::tools as panel_tools;
|
||||
mod modify_panel;
|
||||
mod color_dropdown;
|
||||
mod context_tools;
|
||||
pub use context_tools::{pdf_underlay_tools, xref_tools, UnderlayContext};
|
||||
pub use context_tools::{pdf_underlay_tools, point_cloud_tools, xref_tools, UnderlayContext};
|
||||
use widgets::{StyleContext, *};
|
||||
pub(crate) use widgets::{REDO_HISTORY_ID, UNDO_HISTORY_ID};
|
||||
mod collapse;
|
||||
@@ -109,6 +109,8 @@ pub struct Ribbon {
|
||||
underlay_ctx: Option<UnderlayContext>,
|
||||
/// Only xrefs are selected.
|
||||
xref_ctx: bool,
|
||||
/// Only point clouds are selected: whether the first shows its crops.
|
||||
point_cloud_ctx: Option<bool>,
|
||||
/// XDWGFADECTL as the Reference slide-out shows it (negative = off).
|
||||
pub xref_fade: i32,
|
||||
}
|
||||
@@ -206,6 +208,7 @@ impl Ribbon {
|
||||
collapse_tight: Arc::new(AtomicBool::new(false)),
|
||||
underlay_ctx: None,
|
||||
xref_ctx: false,
|
||||
point_cloud_ctx: None,
|
||||
xref_fade: 50,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user