forked from 1b-agent/opencadstudio-upstream
feat: node graph overlay; move to opencadcodec/opencadkernel/opencadgraph
The codec and kernel repositories and crates are renamed opencadcodec and opencadkernel. Inside OCS they are depended on under short keys, so code reads `codec::`, `kernel::` and the new `graph::` (opencadgraph, the node graph engine). File-format and protocol spellings stay as they were: the ACIS product id `acadrust`, the ACADRUST_* switches and the plugin version keys `acadrust_version` / `acadrust_source`. A button left of MCP on the command line opens a translucent node graph over the viewport, with a palette of object, input, math, logic, list, text and geometry nodes added by click or drag. An object node owns drawing entities and its rows are the Properties panel's own rows for them: the single-object page is extracted from refresh_properties as entity_property_sections, values use the control protocol's property_json, and writes go through set_property_value with a property target override, so the panel, MCP and the graph share one read/write path. A list reaching an object row makes one entity per element. Each graph action is one undo step; the canvas pans and zooms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
56c04408d6
commit
f537aff75c
430 files changed
+9925
-8540
No files matched your search
@@ -4,9 +4,9 @@ use crate::entities::dim_override;
|
||||
use crate::scene::viewport_ref::{AcceptedSnap, MeasurementScale, ViewportFrame};
|
||||
use crate::scene::Scene;
|
||||
use crate::snap::{SnapResult, SnapType};
|
||||
use acadrust::entities::{Circle, Dimension, Line, Viewport};
|
||||
use acadrust::types::{Handle, Vector3};
|
||||
use acadrust::{CadDocument, EntityType};
|
||||
use codec::entities::{Circle, Dimension, Line, Viewport};
|
||||
use codec::types::{Handle, Vector3};
|
||||
use codec::{CadDocument, EntityType};
|
||||
use glam::DVec3;
|
||||
|
||||
fn fixture() -> (OpenCADStudio, Handle, ViewportFrame) {
|
||||
@@ -127,7 +127,7 @@ fn viewport_dimension_imported_paper_owner_does_not_require_layout_objects() {
|
||||
finish_aligned(&mut app, line, frame);
|
||||
let doc = &mut app.tabs[app.active_tab].scene.document;
|
||||
doc.objects
|
||||
.retain(|_, object| !matches!(object, acadrust::objects::ObjectType::Layout(_)));
|
||||
.retain(|_, object| !matches!(object, codec::objects::ObjectType::Layout(_)));
|
||||
assert!(crate::entities::dimension::dimension_in_paper_space(
|
||||
dimension(doc),
|
||||
doc
|
||||
@@ -156,7 +156,7 @@ fn viewport_dimension_curved_clip_includes_the_exact_boundary() {
|
||||
#[test]
|
||||
fn viewport_dimension_apparent_intersection_extends_only_the_lines() {
|
||||
use crate::scene::dimension_assoc_chain::{feature_point, osnap, FeatureContext};
|
||||
use acadrust::objects::AssocDimensionReference;
|
||||
use codec::objects::AssocDimensionReference;
|
||||
let mut scene = Scene::new();
|
||||
let first = scene.add_entity(EntityType::Line(Line::from_points(
|
||||
Vector3::ZERO,
|
||||
@@ -205,7 +205,7 @@ fn viewport_dimension_creation_preserves_active_units_and_roundtrips() {
|
||||
for factor in [25.4, -25.4] {
|
||||
let (mut app, line, frame) = fixture();
|
||||
let i = app.active_tab;
|
||||
let mut style = acadrust::tables::DimStyle::new("Millimetres");
|
||||
let mut style = codec::tables::DimStyle::new("Millimetres");
|
||||
style.dimlfac = factor;
|
||||
app.tabs[i].scene.document.dim_styles.add(style).unwrap();
|
||||
app.tabs[i].scene.document.header.current_dimstyle_name = "Millimetres".into();
|
||||
@@ -357,7 +357,7 @@ fn viewport_dimension_preview_uses_candidate_scale_only_before_second_pick() {
|
||||
for command in ["DIMLINEAR", "DIMALIGNED"] {
|
||||
let (mut app, model, frame) = fixture();
|
||||
let i = app.active_tab;
|
||||
let mut style = acadrust::tables::DimStyle::new("PreviewUnits");
|
||||
let mut style = codec::tables::DimStyle::new("PreviewUnits");
|
||||
style.dimlfac = 25.4;
|
||||
app.tabs[i].scene.document.dim_styles.add(style).unwrap();
|
||||
app.tabs[i].scene.document.header.current_dimstyle_name = "PreviewUnits".into();
|
||||
@@ -425,8 +425,8 @@ fn viewport_dimension_snap_query_matches_pan_scale_and_twist() {
|
||||
|
||||
#[test]
|
||||
fn viewport_dimension_eligibility_is_shared_and_uses_clipping() {
|
||||
use acadrust::entities::LwPolyline;
|
||||
use acadrust::types::Vector2;
|
||||
use codec::entities::LwPolyline;
|
||||
use codec::types::Vector2;
|
||||
let (mut app, _, first) = fixture();
|
||||
let scene = &mut app.tabs[app.active_tab].scene;
|
||||
let mut overlay = scene.document.get_entity(first.viewport).unwrap().clone();
|
||||
@@ -604,7 +604,7 @@ fn viewport_dimension_association_scale_edit_picture_and_history() {
|
||||
#[test]
|
||||
fn viewport_dimension_unsupported_and_erased_sources_keep_last_picture() {
|
||||
use crate::scene::dimension_assoc::{resolve_reference_chain, ReferenceStatus};
|
||||
use acadrust::objects::AssocDimensionReference;
|
||||
use codec::objects::AssocDimensionReference;
|
||||
let (mut app, line, frame) = fixture();
|
||||
let i = app.active_tab;
|
||||
finish_aligned(&mut app, line, frame);
|
||||
@@ -711,8 +711,8 @@ fn viewport_dimension_intersection_tracks_both_entities() {
|
||||
#[test]
|
||||
fn viewport_dimension_spline_tangency_is_parallel_and_validated() {
|
||||
use crate::scene::dimension_assoc_chain::{feature_point, osnap, FeatureContext};
|
||||
use acadrust::objects::AssocDimensionReference;
|
||||
let mut spline = acadrust::entities::Spline::new();
|
||||
use codec::objects::AssocDimensionReference;
|
||||
let mut spline = codec::entities::Spline::new();
|
||||
spline.degree = 2;
|
||||
spline.control_points = vec![
|
||||
Vector3::ZERO,
|
||||
@@ -757,7 +757,7 @@ fn viewport_dimension_spline_tangency_is_parallel_and_validated() {
|
||||
fn viewport_dimension_external_fixture_keeps_unchanged_measurements() {
|
||||
use crate::scene::ChangeKind;
|
||||
let path = std::env::var("OPENCAD_VIEWPORT_REGRESSION_DXF").expect("regression drawing path");
|
||||
let doc = acadrust::DxfReader::from_file(std::path::Path::new(&path))
|
||||
let doc = codec::DxfReader::from_file(std::path::Path::new(&path))
|
||||
.unwrap()
|
||||
.read()
|
||||
.unwrap();
|
||||
@@ -862,12 +862,12 @@ fn viewport_dimension_fixture_regenerates_and_tracks_an_intersection() {
|
||||
.unwrap()
|
||||
.clone();
|
||||
for types in [(1, 255), (8, 9)] {
|
||||
let acadrust::objects::ObjectType::Associative(object) =
|
||||
let codec::objects::ObjectType::Associative(object) =
|
||||
scene.document.objects.get_mut(&Handle::new(0x304)).unwrap()
|
||||
else {
|
||||
panic!()
|
||||
};
|
||||
let acadrust::objects::AssociativeData::DimensionAssociation(assoc) = &mut object.data
|
||||
let codec::objects::AssociativeData::DimensionAssociation(assoc) = &mut object.data
|
||||
else {
|
||||
panic!()
|
||||
};
|
||||
@@ -917,8 +917,8 @@ fn viewport_dimension_nearest_parameter_survives_source_stretch() {
|
||||
#[test]
|
||||
fn viewport_dimension_nested_block_path_survives_edit_and_copy() {
|
||||
use crate::scene::ChangeKind;
|
||||
use acadrust::entities::Insert;
|
||||
use acadrust::tables::BlockRecord;
|
||||
use codec::entities::Insert;
|
||||
use codec::tables::BlockRecord;
|
||||
let (mut app, _, frame) = fixture();
|
||||
let i = app.active_tab;
|
||||
let scene = &mut app.tabs[i].scene;
|
||||
@@ -987,7 +987,7 @@ fn viewport_dimension_nested_block_path_survives_edit_and_copy() {
|
||||
fn viewport_dimension_hidden_border_and_lock_keep_content_available() {
|
||||
let (mut app, _, frame) = fixture();
|
||||
let scene = &mut app.tabs[app.active_tab].scene;
|
||||
let mut layer = acadrust::tables::Layer::new("Viewport frames");
|
||||
let mut layer = codec::tables::Layer::new("Viewport frames");
|
||||
layer.flags.off = true;
|
||||
scene.document.layers.add(layer).unwrap();
|
||||
let Some(EntityType::Viewport(vp)) = scene.document.get_entity_mut(frame.viewport) else {
|
||||
@@ -1005,9 +1005,9 @@ fn viewport_dimension_hidden_border_and_lock_keep_content_available() {
|
||||
#[test]
|
||||
fn viewport_dimension_perpendicular_uses_transformed_geometry() {
|
||||
use crate::scene::dimension_assoc::{resolve_reference_chain, ReferenceStatus};
|
||||
use acadrust::entities::Insert;
|
||||
use acadrust::objects::AssocDimensionReference;
|
||||
use acadrust::tables::BlockRecord;
|
||||
use codec::entities::Insert;
|
||||
use codec::objects::AssocDimensionReference;
|
||||
use codec::tables::BlockRecord;
|
||||
let mut scene = Scene::new();
|
||||
let mut block = BlockRecord::new("Stretched");
|
||||
block.handle = scene.document.allocate_handle();
|
||||
@@ -1047,7 +1047,7 @@ fn viewport_dimension_perpendicular_uses_transformed_geometry() {
|
||||
|
||||
#[test]
|
||||
fn viewport_dimension_refresh_preserves_explicit_overrides() {
|
||||
use acadrust::xdata::XDataValue;
|
||||
use codec::xdata::XDataValue;
|
||||
let (mut app, line, frame) = fixture();
|
||||
let i = app.active_tab;
|
||||
finish_aligned(&mut app, line, frame);
|
||||
@@ -1094,8 +1094,8 @@ fn viewport_dimension_refresh_preserves_explicit_overrides() {
|
||||
|
||||
#[test]
|
||||
fn viewport_dimension_block_center_keeps_the_circle_source() {
|
||||
use acadrust::entities::Insert;
|
||||
use acadrust::tables::BlockRecord;
|
||||
use codec::entities::Insert;
|
||||
use codec::tables::BlockRecord;
|
||||
let (mut app, _, frame) = fixture();
|
||||
let i = app.active_tab;
|
||||
let scene = &mut app.tabs[i].scene;
|
||||
@@ -1137,8 +1137,8 @@ fn viewport_dimension_block_center_keeps_the_circle_source() {
|
||||
#[test]
|
||||
fn viewport_dimension_angular_object_picks_follow_arc_features() {
|
||||
use crate::scene::{ChangeKind, ReferenceStatus};
|
||||
use acadrust::entities::{Arc, LwPolyline};
|
||||
use acadrust::types::Vector2;
|
||||
use codec::entities::{Arc, LwPolyline};
|
||||
use codec::types::Vector2;
|
||||
for bulged in [false, true] {
|
||||
let (mut app, _, frame) = fixture();
|
||||
let i = app.active_tab;
|
||||
@@ -1242,7 +1242,7 @@ fn start_centerline_dimension(
|
||||
Vector3::new(55.0, 40.0, 0.0),
|
||||
Vector3::new(55.0, 60.0, 0.0),
|
||||
)));
|
||||
let mut style = acadrust::tables::DimStyle::new("CenterlineUnits");
|
||||
let mut style = codec::tables::DimStyle::new("CenterlineUnits");
|
||||
style.dimlfac = factor;
|
||||
app.tabs[i].scene.document.dim_styles.add(style).unwrap();
|
||||
app.tabs[i].scene.document.header.current_dimstyle_name = "CenterlineUnits".into();
|
||||
@@ -1416,8 +1416,8 @@ fn viewport_dimension_paper_centerline_tracks_each_owning_space() {
|
||||
#[test]
|
||||
fn viewport_dimension_invalid_paths_leave_no_partial_association() {
|
||||
use crate::scene::viewport_ref::SnapSourceRef;
|
||||
use acadrust::entities::{DimensionAligned, Insert};
|
||||
use acadrust::tables::BlockRecord;
|
||||
use codec::entities::{DimensionAligned, Insert};
|
||||
use codec::tables::BlockRecord;
|
||||
|
||||
let (mut app, model, frame) = fixture();
|
||||
let scene = &mut app.tabs[app.active_tab].scene;
|
||||
|
||||
Reference in new issue
Block a user