ocs_doc_api: Phase 5 typed raster image create

- CreateRasterImage(RasterImageSpec) op (append-only).
- backend add_raster_image (RasterImage with file_path/insertion/u/v/size; the
  scene auto-registers the ImageDefinition on add_entity).
- facade create_raster_image; spec RasterImage constructor; api_reference +
  binding_schema regenerated; mocks + baseline.
- Test phase5_create_raster_image_registers_definition (asserts definition_handle
  auto-registered + 4-corner bounds) -> 610 host lib + 3 consistency green.
- Phase 5 complete.
This commit is contained in:
Sebastian committed 2026-09-06 10:28:51 +02:00
1 parent e6c132e0eb
commit 46a5922520
12 files changed
+109 -6

No files matched your search

+3
View File
@@ -144,6 +144,9 @@ impl DocApiBackend for MockBackend {
fn block_entities(&self, _block_name: &str) -> ApiResult<Vec<EntityView>> {
Ok(Vec::new())
}
fn add_raster_image(&mut self, _spec: &ocs_doc_api::ops::RasterImageSpec) -> ApiResult<ObjectId> {
Ok(self.alloc("RasterImage"))
}
fn set_viewport_view(&mut self, id: ObjectId, view_target: [f64; 3], view_height: f64) -> ApiResult<()> {
if !self.entity_exists(id) {
return Err(ApiError::UnknownId(id));
@@ -60,6 +60,9 @@ fn operation_variants() -> Vec<String> {
Operation::CreateDimensionLinear(ocs_doc_api::ops::DimensionSpec { first_point: [0.0; 3], second_point: [0.0; 3], definition_point: [0.0; 3] }),
Operation::SetAttribute { id: ObjectId::from_u64(0), tag: String::new(), value: String::new() },
Operation::SetViewportView { id: ObjectId::from_u64(0), view_target: [0.0; 3], view_height: 0.0 },
Operation::CreateRasterImage(ocs_doc_api::ops::RasterImageSpec {
file_path: String::new(), insertion_point: [0.0; 3], u_vector: [0.0; 3], v_vector: [0.0; 3], size: [0.0; 2],
}),
];
// Derive the variant names by serializing a probe of each and reading the
// bincode variant index -> name map is not available; instead match by
@@ -147,6 +150,7 @@ const OPERATION_BASELINE: &[&str] = &[
"CreateDimensionLinear",
"SetAttribute",
"SetViewportView",
"CreateRasterImage",
];
/// Recorded baseline of the `Query` variant order.