From 786e31e3a78341916e209c9d513319c7ae5a8bff Mon Sep 17 00:00:00 2001 From: ramox81 <184937705+ramox81@users.noreply.github.com> Date: Thu, 10 Sep 2026 15:55:11 +0300 Subject: [PATCH] feat: expose Revision Cloud in the Draw expansion --- src/app/commands/draw.rs | 11 +++++++---- src/modules/draw/draw/revcloud.rs | 4 +++- src/ui/ribbon/draw_tools/13_revcloud.rs | 10 ++++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 src/ui/ribbon/draw_tools/13_revcloud.rs diff --git a/src/app/commands/draw.rs b/src/app/commands/draw.rs index 6807abfa1..eba3d682d 100644 --- a/src/app/commands/draw.rs +++ b/src/app/commands/draw.rs @@ -62,7 +62,7 @@ impl OpenCADStudio { return Some(Task::done(Message::ImagePick)); } - "REVCLOUD" => { + "REVCLOUD" | "REVCLOUD_RECTANGULAR" | "REVCLOUD_POLYGONAL" | "REVCLOUD_FREEHAND" => { use crate::modules::draw::draw::revcloud::RevCloudCommand; let view_height = self.tabs[i].scene.camera.borrow().ortho_size() as f64 * 2.0; let default_arc_length = (view_height * 0.0125).max(1.0e-6); @@ -72,9 +72,12 @@ impl OpenCADStudio { .entities() .map(|entity| (entity.common().handle, entity.clone())) .collect(); - let cmd = RevCloudCommand::new(default_arc_length, sources); - self.command_line.push_info(&cmd.prompt()); - self.tabs[i].active_cmd = Some(Box::new(cmd)); + let mut command = RevCloudCommand::new(default_arc_length, sources); + if let Some(mode) = cmd.strip_prefix("REVCLOUD_") { + command.on_text_input(mode); + } + self.command_line.push_info(&command.prompt()); + self.tabs[i].active_cmd = Some(Box::new(command)); } "ATTDEF" => { diff --git a/src/modules/draw/draw/revcloud.rs b/src/modules/draw/draw/revcloud.rs index 8da3960c7..516f0e23a 100644 --- a/src/modules/draw/draw/revcloud.rs +++ b/src/modules/draw/draw/revcloud.rs @@ -933,4 +933,6 @@ fn style_from_entity(entity: &EntityType) -> Option { }) } -inventory::submit!(crate::command::CommandRegistration { names: &["REVCLOUD"] }); +inventory::submit!(crate::command::CommandRegistration { + names: &["REVCLOUD", "REVCLOUD_RECTANGULAR", "REVCLOUD_POLYGONAL", "REVCLOUD_FREEHAND"] +}); diff --git a/src/ui/ribbon/draw_tools/13_revcloud.rs b/src/ui/ribbon/draw_tools/13_revcloud.rs new file mode 100644 index 000000000..cedb4a4f5 --- /dev/null +++ b/src/ui/ribbon/draw_tools/13_revcloud.rs @@ -0,0 +1,10 @@ +Tool { + command: "REVCLOUD", + label: "Revision Cloud", + icon: include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/assets/icons/revcloud.svg")), + options: &[ + ("REVCLOUD_RECTANGULAR", "Rectangular"), + ("REVCLOUD_POLYGONAL", "Polygonal"), + ("REVCLOUD_FREEHAND", "Freehand"), + ], +}