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
+20
-20
@@ -69,7 +69,7 @@ struct SilhouetteChunk {
|
||||
|
||||
struct SilhouetteSourceGroup {
|
||||
color: [f32; 4],
|
||||
sources: Vec<cadkernel::brep::mesh::SilhouetteSource>,
|
||||
sources: Vec<kernel::brep::mesh::SilhouetteSource>,
|
||||
instance_buffers: Vec<(wgpu::Buffer, u32)>,
|
||||
}
|
||||
use device_capabilities::DeviceCapabilities;
|
||||
@@ -273,11 +273,11 @@ pub struct Pipeline {
|
||||
/// GPU buffer. `Some(false)` = regular wires, `Some(true)` = mesh edges.
|
||||
pub(crate) wire_arena_fallback: std::sync::Arc<Vec<WireGpu>>,
|
||||
pub(crate) wire_arena_fallback_kind: Option<bool>,
|
||||
pub(crate) wire_arena_fallback_handles: rustc_hash::FxHashSet<acadrust::Handle>,
|
||||
pub(crate) wire_arena_fallback_handles: rustc_hash::FxHashSet<codec::Handle>,
|
||||
/// The Model content id both arenas currently mirror (`u64::MAX` = none).
|
||||
pub(crate) wire_arena_id: u64,
|
||||
/// Handles that contributed to this slot's retained analytical uploads.
|
||||
pub(crate) partition_contributors: rustc_hash::FxHashSet<acadrust::Handle>,
|
||||
pub(crate) partition_contributors: rustc_hash::FxHashSet<codec::Handle>,
|
||||
/// The draw-depth generation those uploads baked. A full depth rebuild
|
||||
/// reassigns every label, so they stop being reusable when it moves.
|
||||
pub(crate) partition_depth_generation: u64,
|
||||
@@ -322,14 +322,14 @@ pub struct Pipeline {
|
||||
/// repacked here, keeping the rest of a multi-million-triangle scene resident.
|
||||
gpu_mesh_dynamic: Vec<mesh_gpu::MeshBatchChunk>,
|
||||
mesh_disabled_chunks: rustc_hash::FxHashSet<usize>,
|
||||
mesh_dynamic_handles: rustc_hash::FxHashSet<acadrust::Handle>,
|
||||
mesh_dynamic_handles: rustc_hash::FxHashSet<codec::Handle>,
|
||||
/// Wire content generation whose geometry the static+dynamic mesh state
|
||||
/// mirrors. It gates replay of the same per-entity journal handoff.
|
||||
pub cached_mesh_content_id: u64,
|
||||
/// Draw ranges for each entity inside the resident mesh chunks. Highlight
|
||||
/// overlays reuse these buffers instead of uploading duplicate geometry.
|
||||
mesh_ranges_by_handle:
|
||||
rustc_hash::FxHashMap<acadrust::Handle, Vec<MeshResidentRange>>,
|
||||
rustc_hash::FxHashMap<codec::Handle, Vec<MeshResidentRange>>,
|
||||
mesh_highlight_draws: Vec<MeshHighlightDraw>,
|
||||
/// `(geometry_epoch, selection_generation)` the highlight overlay was built for.
|
||||
pub cached_highlight_key: (u64, u64),
|
||||
@@ -2724,8 +2724,8 @@ impl Pipeline {
|
||||
device: &wgpu::Device,
|
||||
queue: &wgpu::Queue,
|
||||
wires: &[WireModel],
|
||||
selected: &rustc_hash::FxHashSet<acadrust::Handle>,
|
||||
hovered: &rustc_hash::FxHashSet<acadrust::Handle>,
|
||||
selected: &rustc_hash::FxHashSet<codec::Handle>,
|
||||
hovered: &rustc_hash::FxHashSet<codec::Handle>,
|
||||
annotation_context_wires: &[WireModel],
|
||||
depth_map: &rustc_hash::FxHashMap<u64, [f32; 2]>,
|
||||
selected_tint: Option<[f32; 4]>,
|
||||
@@ -2907,8 +2907,8 @@ analytic={:.1} regular={:.1} blocks={:.1}",
|
||||
device: &wgpu::Device,
|
||||
queue: &wgpu::Queue,
|
||||
wires: &[WireModel],
|
||||
selected: &rustc_hash::FxHashSet<acadrust::Handle>,
|
||||
hovered: &rustc_hash::FxHashSet<acadrust::Handle>,
|
||||
selected: &rustc_hash::FxHashSet<codec::Handle>,
|
||||
hovered: &rustc_hash::FxHashSet<codec::Handle>,
|
||||
annotation_context_wires: &[WireModel],
|
||||
depth_map: &rustc_hash::FxHashMap<u64, [f32; 2]>,
|
||||
selected_tint: Option<[f32; 4]>,
|
||||
@@ -3210,20 +3210,20 @@ analytic={:.1} regular={:.1} blocks={:.1}",
|
||||
for generator in generators {
|
||||
if let Some(transform) = source.instance_transform {
|
||||
let origin =
|
||||
transform.apply(acadrust::types::Vector3::ZERO);
|
||||
transform.apply(codec::types::Vector3::ZERO);
|
||||
let vectors = [
|
||||
transform.apply_rotation(
|
||||
acadrust::types::Vector3::UNIT_X,
|
||||
codec::types::Vector3::UNIT_X,
|
||||
),
|
||||
transform.apply_rotation(
|
||||
acadrust::types::Vector3::UNIT_Y,
|
||||
codec::types::Vector3::UNIT_Y,
|
||||
),
|
||||
transform.apply_rotation(
|
||||
acadrust::types::Vector3::UNIT_Z,
|
||||
codec::types::Vector3::UNIT_Z,
|
||||
),
|
||||
];
|
||||
if let Some(transformed) =
|
||||
cadkernel::brep::mesh::transform_silhouette_affine(
|
||||
kernel::brep::mesh::transform_silhouette_affine(
|
||||
&generator.source,
|
||||
vectors.map(|vector| [vector.x, vector.y, vector.z]),
|
||||
[origin.x, origin.y, origin.z],
|
||||
@@ -3252,7 +3252,7 @@ analytic={:.1} regular={:.1} blocks={:.1}",
|
||||
let compute_group = |group: &SilhouetteSourceGroup| {
|
||||
let mut points = Vec::new();
|
||||
for source in &group.sources {
|
||||
points.extend(cadkernel::brep::mesh::silhouette(
|
||||
points.extend(kernel::brep::mesh::silhouette(
|
||||
source,
|
||||
[view.x, view.y, view.z],
|
||||
));
|
||||
@@ -3599,7 +3599,7 @@ analytic={:.1} regular={:.1} blocks={:.1}",
|
||||
device: &wgpu::Device,
|
||||
queue: &wgpu::Queue,
|
||||
meshes: &[MeshLodSet],
|
||||
changes: &[(acadrust::Handle, crate::scene::ChangeKind)],
|
||||
changes: &[(codec::Handle, crate::scene::ChangeKind)],
|
||||
) -> bool {
|
||||
let started = iced::time::Instant::now();
|
||||
if self.gpu_mesh_batch.is_empty() || changes.is_empty() {
|
||||
@@ -3669,15 +3669,15 @@ analytic={:.1} regular={:.1} blocks={:.1}",
|
||||
/// chunk buffers; changing hover never allocates or uploads mesh geometry.
|
||||
pub fn update_mesh_highlight(
|
||||
&mut self,
|
||||
selected: &rustc_hash::FxHashSet<acadrust::Handle>,
|
||||
hovered: &rustc_hash::FxHashSet<acadrust::Handle>,
|
||||
selected: &rustc_hash::FxHashSet<codec::Handle>,
|
||||
hovered: &rustc_hash::FxHashSet<codec::Handle>,
|
||||
edge_wires: &[WireModel],
|
||||
) {
|
||||
let edge_handles: rustc_hash::FxHashSet<acadrust::Handle> = edge_wires
|
||||
let edge_handles: rustc_hash::FxHashSet<codec::Handle> = edge_wires
|
||||
.iter()
|
||||
.filter_map(|wire| wire.name.strip_prefix("mesh-edge:"))
|
||||
.filter_map(|value| value.parse::<u64>().ok())
|
||||
.map(acadrust::Handle::new)
|
||||
.map(codec::Handle::new)
|
||||
.collect();
|
||||
let mut out = Vec::new();
|
||||
for handle in selected
|
||||
|
||||
Reference in new issue
Block a user