forked from 1b-agent/opencadstudio-upstream
Merge PR #1028: add document API with atomic edits
Add the typed document facade and plugin IPC adapter. Prepare bulk edits before mutation, preserve undo and dirty state, keep profile elevations, validate numeric inputs and session bindings, and generate Python constructors with typed results. Reuse existing entity transforms and profile conversion. Compute mass properties and closed-surface bounds in cadkernel; pin its main revision 6a5e6fc2822f6af6b2611cd605b44437b35158f0. Keep plugin API metadata at version 6. Validation: 646 native application tests, 597 kernel tests, 12 document API tests, 91 plugin API tests, 3 Python tests, default/IPC feature builds and wasm32 check passed.
This commit is contained in:
commit
3385160493
50 files changed
+11481
-6
No files matched your search
@@ -1807,6 +1807,13 @@ pub struct Scene {
|
||||
pub block_meshes: HashMap<Handle, MeshLodSet>,
|
||||
/// Kernel B-reps used by solid operations and exact-geometry saves.
|
||||
pub solid_models: HashMap<Handle, cadkernel::brep::Body>,
|
||||
/// Memoized DocApi volume/centroid per (handle, geometry_epoch) so repeated
|
||||
/// mass queries on the same solid are O(1). Persists across DocApi dispatches.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub doc_api_mass_cache: std::collections::HashMap<Handle, (u64, f64, [f64; 3])>,
|
||||
/// Bounds uncached mass computations in one API request.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub doc_api_cold_tess_used: usize,
|
||||
/// GPU render data for raster images (RasterImage entities), keyed by handle.
|
||||
pub images: HashMap<Handle, ImageModel>,
|
||||
/// The viewport that is currently "entered" (MSPACE mode).
|
||||
@@ -2068,6 +2075,10 @@ impl Scene {
|
||||
material_base_dir: None,
|
||||
block_meshes: HashMap::default(),
|
||||
solid_models: HashMap::default(),
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
doc_api_mass_cache: std::collections::HashMap::default(),
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
doc_api_cold_tess_used: 0,
|
||||
images: HashMap::default(),
|
||||
active_viewport: None,
|
||||
bg_color: [33.0 / 255.0, 40.0 / 255.0, 48.0 / 255.0, 1.0],
|
||||
|
||||
Reference in new issue
Block a user