forked from 1b-agent/opencadstudio-upstream
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:
1 parent
e6c132e0eb
commit
46a5922520
12 files changed
+109
-6
No files matched your search
@@ -509,6 +509,19 @@ impl CurveCollection {
|
||||
let (s, id) = self.create_curve(Curve2Spec::XLine { origin, direction })?;
|
||||
Ok(XLine::new(s, id))
|
||||
}
|
||||
/// A RASTER_IMAGE placed at `insertion_point` (host auto-registers the image definition).
|
||||
pub fn create_raster_image(&self, file_path: &str, insertion_point: [f64; 3], u_vector: [f64; 3], v_vector: [f64; 3], size: [f64; 2]) -> ApiResult<Entity> {
|
||||
let receipt = self.session.apply_op(Operation::CreateRasterImage(crate::ops::RasterImageSpec {
|
||||
file_path: file_path.to_string(),
|
||||
insertion_point,
|
||||
u_vector,
|
||||
v_vector,
|
||||
size,
|
||||
}))?;
|
||||
let id = receipt.outcome.and_then(|o| o.new_id()).ok_or_else(|| ApiError::Transport("create_raster_image returned no id".into()))?;
|
||||
Ok(Entity::new(self.session.clone(), id))
|
||||
}
|
||||
|
||||
/// A solid (or pattern) HATCH over a single closed polyline boundary.
|
||||
pub fn create_hatch(&self, boundary: &[[f64; 2]], solid: bool) -> ApiResult<Entity> {
|
||||
let receipt = self.session.apply_op(Operation::CreateHatch(crate::ops::HatchSpec {
|
||||
|
||||
Reference in new issue
Block a user