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
@@ -22,8 +22,8 @@ const DIM_BASE_KEYS: &[&str] = &[
|
||||
];
|
||||
const DIM_READ_ONLY_KEYS: &[&str] = &["subtype", "actual_measurement"];
|
||||
|
||||
fn dimension_subtype_name(dim: &acadrust::entities::Dimension) -> &'static str {
|
||||
use acadrust::entities::Dimension as D;
|
||||
fn dimension_subtype_name(dim: &codec::entities::Dimension) -> &'static str {
|
||||
use codec::entities::Dimension as D;
|
||||
match dim {
|
||||
D::Aligned(_) => "Aligned",
|
||||
D::Linear(_) => "Linear",
|
||||
@@ -38,8 +38,8 @@ fn dimension_subtype_name(dim: &acadrust::entities::Dimension) -> &'static str {
|
||||
}
|
||||
|
||||
/// Subtype-specific fields in stable order.
|
||||
fn dimension_fields(dim: &mut acadrust::entities::Dimension) -> Vec<(&'static str, DimField<'_>)> {
|
||||
use acadrust::entities::Dimension as D;
|
||||
fn dimension_fields(dim: &mut codec::entities::Dimension) -> Vec<(&'static str, DimField<'_>)> {
|
||||
use codec::entities::Dimension as D;
|
||||
use DimField::{B, F, V};
|
||||
match dim {
|
||||
D::Aligned(d) => vec![
|
||||
@@ -120,12 +120,12 @@ fn dimension_required(subtype: &str) -> &'static [&'static str] {
|
||||
}
|
||||
}
|
||||
|
||||
fn dimension_base_mut(dim: &mut acadrust::entities::Dimension) -> &mut acadrust::entities::DimensionBase {
|
||||
fn dimension_base_mut(dim: &mut codec::entities::Dimension) -> &mut codec::entities::DimensionBase {
|
||||
dim.base_mut()
|
||||
}
|
||||
|
||||
fn dim_attachment_point_name(value: acadrust::entities::AttachmentPointType) -> &'static str {
|
||||
use acadrust::entities::AttachmentPointType as A;
|
||||
fn dim_attachment_point_name(value: codec::entities::AttachmentPointType) -> &'static str {
|
||||
use codec::entities::AttachmentPointType as A;
|
||||
match value {
|
||||
A::TopLeft => "TopLeft",
|
||||
A::TopCenter => "TopCenter",
|
||||
@@ -142,8 +142,8 @@ fn dim_attachment_point_name(value: acadrust::entities::AttachmentPointType) ->
|
||||
fn parse_dim_attachment_point(
|
||||
value: &str,
|
||||
vm: &VirtualMachine,
|
||||
) -> PyResult<acadrust::entities::AttachmentPointType> {
|
||||
use acadrust::entities::AttachmentPointType as A;
|
||||
) -> PyResult<codec::entities::AttachmentPointType> {
|
||||
use codec::entities::AttachmentPointType as A;
|
||||
Ok(match value {
|
||||
"TopLeft" => A::TopLeft,
|
||||
"TopCenter" => A::TopCenter,
|
||||
@@ -162,7 +162,7 @@ fn parse_dim_attachment_point(
|
||||
|
||||
fn dimension_to_dict(
|
||||
vm: &VirtualMachine,
|
||||
dimension: &acadrust::entities::Dimension,
|
||||
dimension: &codec::entities::Dimension,
|
||||
) -> PyResult<PyObjectRef> {
|
||||
let mut dim = dimension.clone();
|
||||
let dict = vm.ctx.new_dict();
|
||||
@@ -197,7 +197,7 @@ fn dimension_to_dict(
|
||||
/// Merge `dict` onto `dim`. With `creating`, geometry the subtype needs must
|
||||
/// be present so a script cannot silently default a point to the origin.
|
||||
fn dimension_merge(
|
||||
dim: &mut acadrust::entities::Dimension,
|
||||
dim: &mut codec::entities::Dimension,
|
||||
dict: &rustpython_vm::builtins::PyDictRef,
|
||||
creating: bool,
|
||||
vm: &VirtualMachine,
|
||||
@@ -271,8 +271,8 @@ fn dimension_merge(
|
||||
fn dimension_from_dict(
|
||||
dict: &rustpython_vm::builtins::PyDictRef,
|
||||
vm: &VirtualMachine,
|
||||
) -> PyResult<acadrust::entities::Dimension> {
|
||||
use acadrust::entities::*;
|
||||
) -> PyResult<codec::entities::Dimension> {
|
||||
use codec::entities::*;
|
||||
let subtype = match dict.get_item_opt("subtype", vm)? {
|
||||
Some(v) => v.try_into_value::<String>(vm)?,
|
||||
None => {
|
||||
@@ -299,17 +299,17 @@ fn dimension_from_dict(
|
||||
};
|
||||
dimension_merge(&mut dim, dict, true, vm)?;
|
||||
let base = dimension_base_mut(&mut dim);
|
||||
base.common.handle = acadrust::Handle::new(get_opt_u64(dict, "handle", vm)?);
|
||||
base.common.handle = codec::Handle::new(get_opt_u64(dict, "handle", vm)?);
|
||||
base.common.layer = get_opt_string(dict, "layer", "0", vm)?;
|
||||
base.common.owner_handle = acadrust::Handle::new(get_opt_u64(dict, "owner_handle", vm)?);
|
||||
base.common.owner_handle = codec::Handle::new(get_opt_u64(dict, "owner_handle", vm)?);
|
||||
Ok(dim)
|
||||
}
|
||||
|
||||
fn dimension_apply(
|
||||
existing: &acadrust::entities::Dimension,
|
||||
existing: &codec::entities::Dimension,
|
||||
dict: &rustpython_vm::builtins::PyDictRef,
|
||||
vm: &VirtualMachine,
|
||||
) -> PyResult<acadrust::entities::Dimension> {
|
||||
) -> PyResult<codec::entities::Dimension> {
|
||||
let mut dim = existing.clone();
|
||||
dimension_merge(&mut dim, dict, false, vm)?;
|
||||
let base = dimension_base_mut(&mut dim);
|
||||
|
||||
Reference in new issue
Block a user