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:
Hakan SevenandClaude Opus 5.5 committed 2026-09-25 07:34:23 +03:00
1 parent 56c04408d6
commit f537aff75c
430 files changed
+9925 -8540

No files matched your search

+36 -36
View File
@@ -18,8 +18,8 @@ use crate::scene::{
self, hover_id, CubeRegion, Scene, VIEWCUBE_DRAW_PX, VIEWCUBE_PAD, VIEWCUBE_PX,
};
use crate::ui::PropertiesPanel;
use acadrust::types::Color as AcadColor;
use acadrust::{EntityType as AcadEntityType, Handle};
use codec::types::Color as AcadColor;
use codec::{EntityType as AcadEntityType, Handle};
use iced::time::Instant;
use iced::{mouse, Point, Task};
use std::sync::Arc;
@@ -459,7 +459,7 @@ impl OpenCADStudio {
}
pub(in crate::app) fn sync_render_mode_to_active_tile(&mut self, i: usize) {
use acadrust::entities::ViewportRenderMode as M;
use codec::entities::ViewportRenderMode as M;
if self.tabs[i].scene.current_layout != "Model" {
return;
}
@@ -863,9 +863,9 @@ impl OpenCADStudio {
pub(super) fn on_set_render_mode(
&mut self,
mode: acadrust::entities::ViewportRenderMode,
mode: codec::entities::ViewportRenderMode,
) -> Task<Message> {
use acadrust::entities::ViewportRenderMode as M;
use codec::entities::ViewportRenderMode as M;
let i = self.active_tab;
let label = match mode {
M::Wireframe2D => "Wireframe 2D",
@@ -909,7 +909,7 @@ impl OpenCADStudio {
pub(super) fn on_cursor_moved(
&mut self,
p: Point,
expected_viewport: Option<acadrust::Handle>,
expected_viewport: Option<codec::Handle>,
) -> Task<Message> {
if self.color_pick_target.is_some() {
return Task::none();
@@ -2605,7 +2605,7 @@ impl OpenCADStudio {
} else {
self.tabs[i].scene.set_hover_highlight(None);
}
let hover_handle = hovered.unwrap_or(acadrust::Handle::NULL);
let hover_handle = hovered.unwrap_or(codec::Handle::NULL);
let wants_entity = self.tabs[i]
.active_cmd
.as_ref()
@@ -2973,12 +2973,12 @@ impl OpenCADStudio {
}
}
use acadrust::types::Vector3;
use codec::types::Vector3;
let v3 = |d: glam::DVec3| Vector3::new(d.x, d.y, d.z);
{
let ucs = self.tabs[i]
.active_ucs
.get_or_insert_with(|| acadrust::tables::Ucs::new("*ACTIVE*"));
.get_or_insert_with(|| codec::tables::Ucs::new("*ACTIVE*"));
match kind {
crate::app::UcsGripKind::Origin => {
ucs.origin = v3(world);
@@ -3065,7 +3065,7 @@ impl OpenCADStudio {
None
};
let same_basis =
|a: Option<&acadrust::tables::Ucs>, b: Option<&acadrust::tables::Ucs>| match (a, b) {
|a: Option<&codec::tables::Ucs>, b: Option<&codec::tables::Ucs>| match (a, b) {
(None, None) => true,
(Some(a), Some(b)) => {
a.origin == b.origin
@@ -4084,7 +4084,7 @@ impl OpenCADStudio {
if bounded_pick
&& matches!(
self.tabs[i].scene.document.get_entity(handle),
Some(acadrust::EntityType::Solid3D(_)),
Some(codec::EntityType::Solid3D(_)),
)
{
// The aperture caught an edge outside its face.
@@ -4102,7 +4102,7 @@ impl OpenCADStudio {
if uses_surface_point && entity_pick_point.is_finite() {
if matches!(
self.tabs[i].scene.document.get_entity(handle),
Some(acadrust::EntityType::Solid3D(_))
Some(codec::EntityType::Solid3D(_))
) {
self.tabs[i]
.scene
@@ -4173,7 +4173,7 @@ impl OpenCADStudio {
)
});
let (scale, angle) = match entity {
Some(acadrust::EntityType::Hatch(hatch)) => (
Some(codec::EntityType::Hatch(hatch)) => (
hatch.pattern_scale as f32,
hatch.pattern_angle.to_degrees() as f32,
),
@@ -5321,7 +5321,7 @@ properties={:.1}ms picked={}",
// If the double-click was not on editable text, keep the existing
// paper-space behaviour and try to enter the clicked viewport.
let wire_hit: Option<acadrust::Handle> = raw_wire_hit.and_then(|h| {
let wire_hit: Option<codec::Handle> = raw_wire_hit.and_then(|h| {
if let Some(AcadEntityType::Viewport(vp)) =
self.tabs[i].scene.document.get_entity(h)
{
@@ -5611,7 +5611,7 @@ properties={:.1}ms picked={}",
pub(super) fn on_viewport_click(
&mut self,
expected_viewport: Option<acadrust::Handle>,
expected_viewport: Option<codec::Handle>,
) -> Task<Message> {
let i = self.active_tab;
if self.tabs[i].scene.active_viewport != expected_viewport
@@ -5887,7 +5887,7 @@ properties={:.1}ms picked={}",
let is_solid = hovered.is_some_and(|handle| {
matches!(
self.tabs[i].scene.document.get_entity(handle),
Some(acadrust::EntityType::Solid3D(_)),
Some(codec::EntityType::Solid3D(_)),
)
});
// An aperture may catch an edge beside, rather than on, a face.
@@ -5903,7 +5903,7 @@ properties={:.1}ms picked={}",
.document
.entities()
.filter_map(|entity| {
matches!(entity, acadrust::EntityType::Solid3D(_))
matches!(entity, codec::EntityType::Solid3D(_))
.then_some(entity.common().handle)
})
.collect::<Vec<_>>();
@@ -6221,7 +6221,7 @@ properties={:.1}ms picked={}",
.map(|style| style.name.clone())
.unwrap_or_default();
for obj in self.tabs[i].scene.document.objects.values_mut() {
if let acadrust::objects::ObjectType::Layout(l) = obj {
if let codec::objects::ObjectType::Layout(l) = obj {
if l.name == new_name {
l.flags = layout_flags;
crate::scene::apply_default_page_setup(l, &plot_style);
@@ -6554,7 +6554,7 @@ mod selection_preview_tests {
#[test]
fn lower_endpoint_drag_previews_connected_tangent_profile_and_keeps_top_fixed() {
use crate::scene::parametric_constraints::{ConstraintKind, ParametricRef, ParametricScope};
use acadrust::{entities::{Arc, Line}, types::Vector3, EntityType};
use codec::{entities::{Arc, Line}, types::Vector3, EntityType};
let mut app = OpenCADStudio::new_for_test();
app.automation_op(r#"{"op":"new"}"#);
@@ -6676,7 +6676,7 @@ mod selection_preview_tests {
#[test]
fn grip_moves_keep_perpendicular_constraints_live_and_undoable() {
use crate::scene::parametric_constraints::{ConstraintKind, ParametricRef};
use acadrust::{entities::Line, types::Vector3, EntityType};
use codec::{entities::Line, types::Vector3, EntityType};
let mut app = OpenCADStudio::new_for_test();
app.automation_op(r#"{"op":"new"}"#);
@@ -6756,7 +6756,7 @@ mod selection_preview_tests {
#[test]
fn constrained_rectangle_grips_distinguish_perpendicular_corner_and_free_ends() {
use crate::scene::parametric_constraints::{ConstraintKind, ParametricRef, ParametricScope};
use acadrust::{entities::LwPolyline, types::Vector2, EntityType};
use codec::{entities::LwPolyline, types::Vector2, EntityType};
let mut app = OpenCADStudio::new_for_test();
app.automation_op(r#"{"op":"new"}"#);
@@ -6843,7 +6843,7 @@ mod selection_preview_tests {
#[test]
fn axis_constrained_line_grip_changes_length_and_translates_normal_to_axis() {
use crate::scene::parametric_constraints::{ConstraintKind, ParametricRef, ParametricScope};
use acadrust::{entities::Line, types::Vector3, EntityType};
use codec::{entities::Line, types::Vector3, EntityType};
for vertical in [false, true] {
let mut app = OpenCADStudio::new_for_test();
@@ -6878,7 +6878,7 @@ mod selection_preview_tests {
#[test]
fn xline_direction_grip_drag_changes_direction() {
use acadrust::{types::Vector3, EntityType};
use codec::{types::Vector3, EntityType};
let mut app = OpenCADStudio::new_for_test();
app.automation_op(r#"{"op":"new"}"#);
let i = app.active_tab;
@@ -6886,7 +6886,7 @@ mod selection_preview_tests {
// Base away from the model origin so the UCS icon cannot swallow
// the press (it sits at the origin in a fresh drawing).
let handle = app.tabs[i].scene.add_entity(EntityType::XLine(
acadrust::entities::XLine::new(
codec::entities::XLine::new(
Vector3::new(100.0, 50.0, 0.0),
Vector3::new(0.0, 1.0, 0.0),
),
@@ -6921,7 +6921,7 @@ mod selection_preview_tests {
#[test]
fn constraint_glyph_tooltip_appears_after_hover_dwell() {
use crate::scene::parametric_constraints::{ConstraintKind, ParametricRef, ParametricScope};
use acadrust::{entities::Line, types::Vector3, EntityType};
use codec::{entities::Line, types::Vector3, EntityType};
let mut app = OpenCADStudio::new_for_test();
app.automation_op(r#"{"op":"new"}"#);
@@ -6965,10 +6965,10 @@ mod selection_preview_tests {
#[cfg(target_os = "linux")]
#[test]
fn hyperlink_click_respects_existing_pointer_owners() {
use acadrust::entities::Line;
use acadrust::types::Vector3;
use acadrust::xdata::{ExtendedDataRecord, XDataValue};
use acadrust::EntityType;
use codec::entities::Line;
use codec::types::Vector3;
use codec::xdata::{ExtendedDataRecord, XDataValue};
use codec::EntityType;
use glam::DVec3;
for mode in ["link", "plain", "pan", "orbit", "zoom", "grip", "command"] {
@@ -7064,7 +7064,7 @@ mod selection_preview_tests {
/// point all carry the snapped Z instead of dropping to the XY plane.
#[test]
fn line_snap_to_3d_endpoint_keeps_elevation() {
use acadrust::{entities::Line, types::Vector3, EntityType};
use codec::{entities::Line, types::Vector3, EntityType};
use crate::snap::SnapType;
let mut app = OpenCADStudio::new_for_test();
@@ -7117,7 +7117,7 @@ mod selection_preview_tests {
/// separate 3D master toggle — the 2D Node mode must not catch them.
#[test]
fn line_snaps_to_box_corner() {
use acadrust::{entities::Solid3D, EntityType};
use codec::{entities::Solid3D, EntityType};
use crate::snap::SnapType;
let mut app = OpenCADStudio::new_for_test();
@@ -7212,7 +7212,7 @@ mod selection_preview_tests {
/// Vertex mode is configured — and the 2D system must not catch them.
#[test]
fn box_corner_ignores_3d_master_off() {
use acadrust::{entities::Solid3D, EntityType};
use codec::{entities::Solid3D, EntityType};
use crate::snap::SnapType;
let mut app = OpenCADStudio::new_for_test();
@@ -7280,7 +7280,7 @@ mod selection_preview_tests {
/// for the box's planar faces).
#[test]
fn line_snaps_to_box_face_center() {
use acadrust::{entities::Solid3D, EntityType};
use codec::{entities::Solid3D, EntityType};
use crate::snap::SnapType;
let mut app = OpenCADStudio::new_for_test();
@@ -7347,7 +7347,7 @@ mod selection_preview_tests {
/// Nearest-to-face catches an interior face point with no base point.
#[test]
fn line_snaps_to_box_face_nearest() {
use acadrust::{entities::Solid3D, EntityType};
use codec::{entities::Solid3D, EntityType};
use crate::snap::SnapType;
let mut app = OpenCADStudio::new_for_test();
@@ -7416,7 +7416,7 @@ mod selection_preview_tests {
/// grey-box (real mesh, real helper) since it needs no event plumbing.
#[test]
fn face_perpendicular_needs_base_and_interior_foot() {
use acadrust::{entities::Solid3D, EntityType};
use codec::{entities::Solid3D, EntityType};
let mut app = OpenCADStudio::new_for_test();
app.automation_op(r#"{"op":"new"}"#);
@@ -7493,7 +7493,7 @@ mod selection_preview_tests {
/// Edge midpoints snap as their own 3D type at the segment centre.
#[test]
fn line_snaps_to_box_edge_midpoint() {
use acadrust::{entities::Solid3D, EntityType};
use codec::{entities::Solid3D, EntityType};
use crate::snap::SnapType;
let mut app = OpenCADStudio::new_for_test();