ADJUST: images and underlays, -IMAGEADJUST and PDF/DWF/DGNADJUST

ADJUST gathers raster images or PDF/DWF/DGN underlays (other objects are
dropped silently, pickfirst is used, a mixed set is refused), then asks the
image option (Brightness default) or the underlay option (last used), with
value prompts that offer the image's own value or the session's last
underlay fade/contrast, and Monochrome Yes/No. Invalid values re-prompt.
One undo step. -IMAGEADJUST, PDFADJUST, DWFADJUST and DGNADJUST take one
kind each. Raster image Brightness/Contrast/Fade move to an Image Adjust
section as whole numbers with 0-100 validation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
ramox81andClaude Opus 5.5 committed 2026-10-13 15:53:20 +03:00
1 parent b1d4c9bd9b
commit a0a83ad681
32 files changed
+841 -311

No files matched your search

+26
View File
@@ -41,6 +41,9 @@ pub struct SelectObjectsCommand {
/// The command works on associative dimensions only; the host drops
/// everything else from each completed selection.
associative_dimensions_only: bool,
/// The kinds of object the command takes; the host drops the rest of
/// each completed selection silently, and Enter on nothing ends quietly.
keep: Option<fn(&codec::EntityType) -> bool>,
}
impl SelectObjectsCommand {
@@ -57,6 +60,7 @@ impl SelectObjectsCommand {
auto_constrain_settings: false,
prompt_text: None,
associative_dimensions_only: false,
keep: None,
}
}
@@ -74,6 +78,7 @@ impl SelectObjectsCommand {
auto_constrain_settings: false,
prompt_text: None,
associative_dimensions_only: false,
keep: None,
}
}
@@ -91,6 +96,7 @@ impl SelectObjectsCommand {
auto_constrain_settings: false,
prompt_text: None,
associative_dimensions_only: false,
keep: None,
}
}
@@ -108,6 +114,7 @@ impl SelectObjectsCommand {
auto_constrain_settings: false,
prompt_text: None,
associative_dimensions_only: false,
keep: None,
}
}
@@ -131,6 +138,18 @@ impl SelectObjectsCommand {
command
}
/// The command's own wording, keeping only what `keep` accepts.
pub fn filtered(
prompt_cmd: &str,
pending_cmd: &str,
prompt_text: &'static str,
keep: fn(&codec::EntityType) -> bool,
) -> Self {
let mut command = Self::with_prompt(prompt_cmd, pending_cmd, prompt_text);
command.keep = Some(keep);
command
}
pub fn auto_constrain(pending_cmd: &str) -> Self {
let mut command = Self::new(pending_cmd);
command.auto_constrain_settings = true;
@@ -203,6 +222,10 @@ impl CadCommand for SelectObjectsCommand {
self.associative_dimensions_only
}
fn selection_entity_filter(&self) -> Option<fn(&codec::EntityType) -> bool> {
self.keep
}
fn selection_drops_locked_point_clouds(&self) -> bool {
matches!(
self.pending_cmd.as_str(),
@@ -320,6 +343,9 @@ impl CadCommand for SelectObjectsCommand {
}
return CmdResult::NeedPoint;
}
if self.keep.is_some() && self.handles.is_empty() {
return CmdResult::Relaunch(std::mem::take(&mut self.pending_cmd), Vec::new());
}
if !self.commit_on_enter || self.handles.is_empty() {
return CmdResult::Cancel;
}