forked from 1b-agent/opencadstudio-upstream
ocs_doc_api: Phase 2b-a (Text/MText annotations)
- CreateText/CreateMText/SetTextContent ops + GetTextContent query (append-only). - backend add_text/add_mtext/set_text_content/text_content (Text.value/MText.value). - facade create_text/create_mtext + Text/MText handles with content()/set_content(). - Text/MText coarse bounds + transform (insertion point); ensure_transformable. - spec Text/MText families; api_reference + binding_schema regenerated; mocks. - can_modify backend hook (exists + not-locked) for SetTextContent validation. - consistency baseline extended with the appended variants. - Test phase2b_text_mtext_create_content_transform -> 605 host lib + 3 consistency green.
This commit is contained in:
1 parent
1925a83a25
commit
fc0e2c2c9d
16 files changed
+449
-4
No files matched your search
@@ -87,6 +87,32 @@ B-rep solid. Host resolves bodies via the solid_models cache (lift-on-miss from
|
||||
|
||||
- **create_xline**(`origin: [f64; 3], direction: [f64; 3]`) -> `XLine`
|
||||
|
||||
## `Text` (acadrust `Text`, collection `curves`)
|
||||
|
||||
Single-line text annotation. content()/set_content() read+replace the value; transform moves insertion point.
|
||||
|
||||
### Constructors (`doc.curves()`)
|
||||
|
||||
- **create_text**(`value: &str, insertion_point: [f64; 3], height: f64, rotation: f64`) -> `Text`
|
||||
|
||||
### Methods
|
||||
|
||||
- **content**(``) -> `String` — query `GetTextContent`
|
||||
- **set_content**(`value: &str`) -> `()` — op `SetTextContent`
|
||||
|
||||
## `MText` (acadrust `MText`, collection `curves`)
|
||||
|
||||
Multi-line text annotation. content()/set_content() read+replace the value; transform moves insertion point.
|
||||
|
||||
### Constructors (`doc.curves()`)
|
||||
|
||||
- **create_mtext**(`value: &str, insertion_point: [f64; 3], height: f64`) -> `MText`
|
||||
|
||||
### Methods
|
||||
|
||||
- **content**(``) -> `String` — query `GetTextContent`
|
||||
- **set_content**(`value: &str`) -> `()` — op `SetTextContent`
|
||||
|
||||
## `Entity` (acadrust `Insert`, collection `entities`)
|
||||
|
||||
Block reference. Place an existing BlockRecord by name; transform moves its insert point.
|
||||
|
||||
@@ -188,6 +188,76 @@
|
||||
"methods": [],
|
||||
"name": "XLine"
|
||||
},
|
||||
{
|
||||
"acadrust_variant": "Text",
|
||||
"collection": "curves",
|
||||
"handle": "Text",
|
||||
"methods": [
|
||||
{
|
||||
"args": [],
|
||||
"bulk": false,
|
||||
"fixed": null,
|
||||
"kind": "query",
|
||||
"name": "content",
|
||||
"op": null,
|
||||
"query": "GetTextContent",
|
||||
"read_only": true,
|
||||
"returns": "String"
|
||||
},
|
||||
{
|
||||
"args": [
|
||||
{
|
||||
"name": "value",
|
||||
"ty": "&str"
|
||||
}
|
||||
],
|
||||
"bulk": false,
|
||||
"fixed": null,
|
||||
"kind": "op",
|
||||
"name": "set_content",
|
||||
"op": "SetTextContent",
|
||||
"query": null,
|
||||
"read_only": false,
|
||||
"returns": "()"
|
||||
}
|
||||
],
|
||||
"name": "Text"
|
||||
},
|
||||
{
|
||||
"acadrust_variant": "MText",
|
||||
"collection": "curves",
|
||||
"handle": "MText",
|
||||
"methods": [
|
||||
{
|
||||
"args": [],
|
||||
"bulk": false,
|
||||
"fixed": null,
|
||||
"kind": "query",
|
||||
"name": "content",
|
||||
"op": null,
|
||||
"query": "GetTextContent",
|
||||
"read_only": true,
|
||||
"returns": "String"
|
||||
},
|
||||
{
|
||||
"args": [
|
||||
{
|
||||
"name": "value",
|
||||
"ty": "&str"
|
||||
}
|
||||
],
|
||||
"bulk": false,
|
||||
"fixed": null,
|
||||
"kind": "op",
|
||||
"name": "set_content",
|
||||
"op": "SetTextContent",
|
||||
"query": null,
|
||||
"read_only": false,
|
||||
"returns": "()"
|
||||
}
|
||||
],
|
||||
"name": "MText"
|
||||
},
|
||||
{
|
||||
"acadrust_variant": "Insert",
|
||||
"collection": "entities",
|
||||
@@ -270,7 +340,9 @@
|
||||
"Ellipse",
|
||||
"Spline",
|
||||
"Ray",
|
||||
"XLine"
|
||||
"XLine",
|
||||
"Text",
|
||||
"MText"
|
||||
],
|
||||
"root": "DocApi"
|
||||
},
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::id::ObjectId;
|
||||
use crate::ops::{BoolOp, Curve2Spec, EntitySpec, InsertSpec, PlacementSpec, SolidPrimitive, ViewportSpec};
|
||||
use crate::ops::{BoolOp, Curve2Spec, EntitySpec, InsertSpec, MTextSpec, PlacementSpec, SolidPrimitive, TextSpec, ViewportSpec};
|
||||
|
||||
/// A typed write operation (plan §5). Each variant is ONE atomic host call = one
|
||||
/// undo step. Append new variants at the END only.
|
||||
@@ -32,4 +32,8 @@ pub enum Operation {
|
||||
CreateInsert(InsertSpec),
|
||||
// paper-space
|
||||
CreateViewport(ViewportSpec),
|
||||
// annotations
|
||||
CreateText(TextSpec),
|
||||
CreateMText(MTextSpec),
|
||||
SetTextContent { id: ObjectId, value: String },
|
||||
}
|
||||
@@ -19,4 +19,6 @@ pub enum Query {
|
||||
/// Whether two entities' bounds overlap (two-phase conditional modelling).
|
||||
GetIntersects { a: ObjectId, b: ObjectId },
|
||||
GetGeometryRevision,
|
||||
/// The text content of a Text/MText annotation.
|
||||
GetTextContent { id: ObjectId },
|
||||
}
|
||||
Reference in new issue
Block a user