forked from 1b-agent/opencadstudio-upstream
Merge pull request #1751 from ramox81/codex/adjust-parity
ADJUST: images and underlays, -IMAGEADJUST and PDF/DWF/DGNADJUST
This commit is contained in:
commit
f6fc244430
33 files changed
+903
-312
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user