forked from 1b-agent/opencadstudio-upstream
Align UNION solid properties palette
This commit is contained in:
1 parent
a59ea47990
commit
5857ffa2bd
2 files changed
+25
-10
No files matched your search
+10
-10
@@ -440,15 +440,15 @@ impl OpenCADStudio {
|
|||||||
let display_entity = dispatch::entity_in_working_plane(contextual.as_ref(), plane);
|
let display_entity = dispatch::entity_in_working_plane(contextual.as_ref(), plane);
|
||||||
let entity = &display_entity;
|
let entity = &display_entity;
|
||||||
let group_names = self.tabs[i].scene.group_names_for_entity(handle);
|
let group_names = self.tabs[i].scene.group_names_for_entity(handle);
|
||||||
let specialized_primitive =
|
let compact_solid =
|
||||||
crate::scene::model::solid_history::has_specialized_primitive_properties(
|
crate::scene::model::solid_history::has_compact_solid_properties(
|
||||||
&self.tabs[i].scene.document,
|
&self.tabs[i].scene.document,
|
||||||
handle,
|
handle,
|
||||||
);
|
);
|
||||||
let mut sections =
|
let mut sections =
|
||||||
dispatch::properties_sectioned(handle, entity, &text_style_names);
|
dispatch::properties_sectioned(handle, entity, &text_style_names);
|
||||||
if specialized_primitive {
|
if compact_solid {
|
||||||
retain_specialized_primitive_sections(&mut sections);
|
retain_compact_solid_sections(&mut sections);
|
||||||
}
|
}
|
||||||
sections.extend(
|
sections.extend(
|
||||||
crate::scene::model::solid_history::primitive_properties(
|
crate::scene::model::solid_history::primitive_properties(
|
||||||
@@ -636,7 +636,7 @@ impl OpenCADStudio {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !specialized_primitive && matches!(
|
if !compact_solid && matches!(
|
||||||
entity,
|
entity,
|
||||||
acadrust::EntityType::Solid3D(_)
|
acadrust::EntityType::Solid3D(_)
|
||||||
| acadrust::EntityType::Region(_)
|
| acadrust::EntityType::Region(_)
|
||||||
@@ -710,7 +710,7 @@ impl OpenCADStudio {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !specialized_primitive {
|
if !compact_solid {
|
||||||
sections.extend(crate::entities::object_data::sections(
|
sections.extend(crate::entities::object_data::sections(
|
||||||
&self.tabs[i].scene.document,
|
&self.tabs[i].scene.document,
|
||||||
&self.tabs[i].scene.object_data_cache,
|
&self.tabs[i].scene.object_data_cache,
|
||||||
@@ -2068,8 +2068,8 @@ impl OpenCADStudio {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if specialized_primitive {
|
if compact_solid {
|
||||||
retain_specialized_primitive_sections(&mut sections);
|
retain_compact_solid_sections(&mut sections);
|
||||||
}
|
}
|
||||||
let title = match entity {
|
let title = match entity {
|
||||||
acadrust::EntityType::Insert(ins) => {
|
acadrust::EntityType::Insert(ins) => {
|
||||||
@@ -2166,7 +2166,7 @@ impl OpenCADStudio {
|
|||||||
.collect();
|
.collect();
|
||||||
let mut sections = aggregate_sections(&local_refs, &text_style_names);
|
let mut sections = aggregate_sections(&local_refs, &text_style_names);
|
||||||
if local_refs.iter().all(|(handle, _)| {
|
if local_refs.iter().all(|(handle, _)| {
|
||||||
crate::scene::model::solid_history::has_specialized_primitive_properties(
|
crate::scene::model::solid_history::has_compact_solid_properties(
|
||||||
&self.tabs[i].scene.document,
|
&self.tabs[i].scene.document,
|
||||||
*handle,
|
*handle,
|
||||||
)
|
)
|
||||||
@@ -3077,7 +3077,7 @@ fn aggregate_solid_history_sections(
|
|||||||
merged
|
merged
|
||||||
}
|
}
|
||||||
|
|
||||||
fn retain_specialized_primitive_sections(
|
fn retain_compact_solid_sections(
|
||||||
sections: &mut Vec<crate::scene::model::object::PropSection>,
|
sections: &mut Vec<crate::scene::model::object::PropSection>,
|
||||||
) {
|
) {
|
||||||
sections.iter_mut().for_each(|section| {
|
sections.iter_mut().for_each(|section| {
|
||||||
|
|||||||
@@ -214,6 +214,21 @@ pub fn has_specialized_primitive_properties(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Solid history results whose public Properties palette is fully described by
|
||||||
|
/// the common entity rows plus [`primitive_properties`]. A generic B-rep has
|
||||||
|
/// no stable primitive dimensions to expose, but it still uses the compact
|
||||||
|
/// Solid History palette rather than the internal ACIS/cache diagnostics.
|
||||||
|
pub fn has_compact_solid_properties(
|
||||||
|
document: &acadrust::CadDocument,
|
||||||
|
handle: acadrust::Handle,
|
||||||
|
) -> bool {
|
||||||
|
has_specialized_primitive_properties(document, handle)
|
||||||
|
|| matches!(
|
||||||
|
document.solid_history_operation(handle),
|
||||||
|
Some(SolidHistoryOperation::Brep(_))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn reference_point(operation: &SolidHistoryOperation) -> Option<glam::DVec3> {
|
pub fn reference_point(operation: &SolidHistoryOperation) -> Option<glam::DVec3> {
|
||||||
match operation {
|
match operation {
|
||||||
SolidHistoryOperation::Box(value) | SolidHistoryOperation::Wedge(value) => world_point(
|
SolidHistoryOperation::Box(value) | SolidHistoryOperation::Wedge(value) => world_point(
|
||||||
|
|||||||
Reference in new issue
Block a user