forked from 1b-agent/opencadstudio-upstream
feat(properties): conform entity property groups to PROPERTIES.md
Rewrite each entity's property builder to the per-entity group/row spec: the correct sections (Geometry, Misc, Text, Pattern, Lines & Arrows, Leaders, Block, …) with the spec's rows and real computed values — Diameter, Circumference, Area, Delta X/Y/Z, Angle, Total angle, Arc length, Radius ratio, etc. — plus apply routing for the editable rows. Covers ~26 entities (Line, Circle, Arc, Point, Ellipse, Spline, polylines, Ray/XLine, Insert, Text, MText, Hatch, Leader, MultiLeader, Tolerance, Solid, Solid3D/Region/Body, meshes, MLine, Raster/Wipeout, Underlay, Table, Viewport, Attribute, OLE). The 3D Visualization/Material group and the full Dimension spec are deferred (they need document access for material/dimstyle name resolution). Rows whose data is not in the pinned acadrust revision are shown as empty placeholders, to be filled when the dependency is bumped. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
b2b2bfb246
commit
b9cebab951
26 files changed
+1917
-1558
No files matched your search
+25
-36
@@ -79,42 +79,30 @@ fn properties(ole: &Ole2Frame) -> Vec<PropSection> {
|
||||
OleObjectType::Embedded => "Embedded",
|
||||
OleObjectType::Static => "Static",
|
||||
};
|
||||
vec![PropSection {
|
||||
title: "Geometry".into(),
|
||||
props: vec![
|
||||
ro("Type", "ole_type", type_str),
|
||||
edit("Upper Left X", "ole_ulx", ole.upper_left_corner.x),
|
||||
edit("Upper Left Y", "ole_uly", ole.upper_left_corner.y),
|
||||
edit("Lower Right X", "ole_lrx", ole.lower_right_corner.x),
|
||||
edit("Lower Right Y", "ole_lry", ole.lower_right_corner.y),
|
||||
ro("Version", "ole_version", ole.version.to_string()),
|
||||
ro(
|
||||
"Source App",
|
||||
"ole_source_app",
|
||||
if ole.source_application.is_empty() {
|
||||
"(unknown)".to_string()
|
||||
} else {
|
||||
ole.source_application.clone()
|
||||
},
|
||||
),
|
||||
ro(
|
||||
"Data Size",
|
||||
"ole_data_size",
|
||||
format!("{} bytes", ole.binary_data.len()),
|
||||
),
|
||||
ro("DWG Mode", "ole_dwg_mode", ole.dwg_mode.to_string()),
|
||||
ro(
|
||||
"DWG Trailing Byte",
|
||||
"ole_dwg_trailing",
|
||||
format!("{:#04x}", ole.dwg_trailing_byte),
|
||||
),
|
||||
ro(
|
||||
"Paper Space",
|
||||
"ole_paper_space",
|
||||
if ole.is_paper_space { "Yes" } else { "No" },
|
||||
),
|
||||
],
|
||||
}]
|
||||
let width = (ole.lower_right_corner.x - ole.upper_left_corner.x).abs();
|
||||
let height = (ole.upper_left_corner.y - ole.lower_right_corner.y).abs();
|
||||
vec![
|
||||
PropSection {
|
||||
title: "Geometry".into(),
|
||||
props: vec![
|
||||
edit("Position X", "ole_ulx", ole.upper_left_corner.x),
|
||||
edit("Position Y", "ole_uly", ole.upper_left_corner.y),
|
||||
edit("Position Z", "ole_ulz", ole.upper_left_corner.z),
|
||||
ro("Width", "ole_width", format!("{:.4}", width)),
|
||||
ro("Height", "ole_height", format!("{:.4}", height)),
|
||||
ro("Scale width", "ole_scale_width", String::new()),
|
||||
ro("Scale height", "ole_scale_height", String::new()),
|
||||
ro("Lock aspect", "ole_lock_aspect", String::new()),
|
||||
],
|
||||
},
|
||||
PropSection {
|
||||
title: "Misc".into(),
|
||||
props: vec![
|
||||
ro("Type", "ole_type", type_str),
|
||||
ro("Plot quality", "ole_plot_quality", String::new()),
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
fn apply_geom_prop(ole: &mut Ole2Frame, field: &str, value: &str) {
|
||||
@@ -124,6 +112,7 @@ fn apply_geom_prop(ole: &mut Ole2Frame, field: &str, value: &str) {
|
||||
match field {
|
||||
"ole_ulx" => ole.upper_left_corner.x = v,
|
||||
"ole_uly" => ole.upper_left_corner.y = v,
|
||||
"ole_ulz" => ole.upper_left_corner.z = v,
|
||||
"ole_lrx" => ole.lower_right_corner.x = v,
|
||||
"ole_lry" => ole.lower_right_corner.y = v,
|
||||
_ => {}
|
||||
|
||||
Reference in new issue
Block a user