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
@@ -1,15 +1,15 @@
|
||||
use acadrust::entities::Dimension;
|
||||
use acadrust::objects::{
|
||||
use codec::entities::Dimension;
|
||||
use codec::objects::{
|
||||
AssocDimensionAssociation, AssocDimensionReference, AssociativeData, AssociativeObject,
|
||||
ObjectType,
|
||||
};
|
||||
use acadrust::types::{Handle, Transform, Vector3};
|
||||
use acadrust::EntityType;
|
||||
use cadkernel::geom2d::{
|
||||
use codec::types::{Handle, Transform, Vector3};
|
||||
use codec::EntityType;
|
||||
use kernel::geom2d::{
|
||||
angle_within_arc, arc as tessellate_arc, arc_span, closest_point, Arc as KernelArc, BulgeArc,
|
||||
Circle as KernelCircle, Curve as KernelCurve, DEFAULT_SEGMENTS_PER_RADIAN,
|
||||
};
|
||||
use cadkernel::space::Plane;
|
||||
use kernel::space::Plane;
|
||||
use std::f64::consts::TAU;
|
||||
|
||||
use crate::command::DimensionAssociationSource;
|
||||
@@ -103,7 +103,7 @@ type DPoint = [f64; 3];
|
||||
|
||||
/// The shared-contract vector (`glam`) as the codec's vector. `AcceptedSnap`
|
||||
/// speaks `glam` because the snap engine does; everything stored in a
|
||||
/// drawing speaks `acadrust`.
|
||||
/// drawing speaks `opencadcodec`.
|
||||
fn dvec3(point: glam::DVec3) -> Vector3 {
|
||||
Vector3::new(point.x, point.y, point.z)
|
||||
}
|
||||
@@ -214,7 +214,7 @@ fn ocs_point(x: f64, y: f64, elevation: f64, normal: Vector3) -> Vector3 {
|
||||
Vector3::new(point.0, point.1, point.2)
|
||||
}
|
||||
|
||||
fn circle_curve(circle: &acadrust::entities::Circle) -> KernelCurve {
|
||||
fn circle_curve(circle: &codec::entities::Circle) -> KernelCurve {
|
||||
KernelCurve::Circle(KernelCircle {
|
||||
centre: [circle.center.x, circle.center.y],
|
||||
radius: circle.radius,
|
||||
@@ -808,7 +808,7 @@ fn remap_plane_offset(
|
||||
/// reference whose actual source had been erased. Walking the chain asks the
|
||||
/// question that was meant — is the geometry still there.
|
||||
pub(crate) fn dimension_is_associative(
|
||||
document: &acadrust::CadDocument,
|
||||
document: &codec::CadDocument,
|
||||
dimension: Handle,
|
||||
) -> bool {
|
||||
document.objects.values().any(|object| {
|
||||
@@ -829,7 +829,7 @@ pub(crate) fn dimension_is_associative(
|
||||
}
|
||||
|
||||
pub(crate) fn constraint_from_associative_dimension(
|
||||
document: &acadrust::CadDocument,
|
||||
document: &codec::CadDocument,
|
||||
handle: Handle,
|
||||
) -> Option<(
|
||||
super::parametric_constraints::ConstraintKind,
|
||||
@@ -916,7 +916,7 @@ pub(crate) fn constraint_from_associative_dimension(
|
||||
}
|
||||
|
||||
pub(crate) fn radial_extension_points(
|
||||
document: &acadrust::CadDocument,
|
||||
document: &codec::CadDocument,
|
||||
dimension: Handle,
|
||||
gap: f64,
|
||||
extension: f64,
|
||||
@@ -2243,7 +2243,7 @@ impl Scene {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use acadrust::entities::{Circle, DimensionDiameter};
|
||||
use codec::entities::{Circle, DimensionDiameter};
|
||||
|
||||
#[test]
|
||||
fn diameter_angle_sync_records_the_association_for_undo() {
|
||||
@@ -2307,7 +2307,7 @@ fn centroid_shift(before: [Option<Vector3>; 2], after: [Option<Vector3>; 2]) ->
|
||||
Vector3::new(delta.x / count, delta.y / count, delta.z / count)
|
||||
}
|
||||
|
||||
fn linear_measurement(linear: &acadrust::entities::DimensionLinear) -> f64 {
|
||||
fn linear_measurement(linear: &codec::entities::DimensionLinear) -> f64 {
|
||||
let plane = plane_from_normal(linear.first_point, linear.base.normal);
|
||||
let first = plane
|
||||
.project(dpoint(linear.first_point))
|
||||
@@ -2392,11 +2392,11 @@ fn feature_reference(
|
||||
}
|
||||
|
||||
fn persisted_measurement_scale(
|
||||
doc: &acadrust::CadDocument,
|
||||
doc: &codec::CadDocument,
|
||||
entity: &EntityType,
|
||||
) -> Option<MeasurementScale> {
|
||||
use crate::entities::dim_override;
|
||||
use acadrust::xdata::XDataValue;
|
||||
use codec::xdata::XDataValue;
|
||||
let EntityType::Dimension(dimension) = entity else {
|
||||
return None;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user