diff --git a/modeling-cmds/openapi/api.json b/modeling-cmds/openapi/api.json index 1654f017..5723be0e 100644 --- a/modeling-cmds/openapi/api.json +++ b/modeling-cmds/openapi/api.json @@ -7798,6 +7798,27 @@ "type" ] }, + { + "description": "Finds a suitable set of arguments that can be passed to CreateRegion to resolve this very region.", + "type": "object", + "properties": { + "region_id": { + "description": "Which region to resolve", + "type": "string", + "format": "uuid" + }, + "type": { + "type": "string", + "enum": [ + "region_get_resolvable_intersection_info" + ] + } + }, + "required": [ + "region_id", + "type" + ] + }, { "description": "Create a region with a query point. The region should have an ID taken from the ID of the 'CreateRegionFromQueryPoint' modeling command.", "type": "object", diff --git a/modeling-cmds/src/def_enum.rs b/modeling-cmds/src/def_enum.rs index b43f2a23..74e755f8 100644 --- a/modeling-cmds/src/def_enum.rs +++ b/modeling-cmds/src/def_enum.rs @@ -2635,6 +2635,17 @@ define_modeling_cmd_enum! { pub version: RegionVersion, } + /// Finds a suitable set of arguments that can be passed to CreateRegion to resolve this very region. + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] + #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] + pub struct RegionGetResolvableIntersectionInfo { + /// Which region to resolve + pub region_id: Uuid, + } + /// Create a region with a query point. /// The region should have an ID taken from the ID of the /// 'CreateRegionFromQueryPoint' modeling command. diff --git a/modeling-cmds/src/ok_response.rs b/modeling-cmds/src/ok_response.rs index 20455937..1f8b9df0 100644 --- a/modeling-cmds/src/ok_response.rs +++ b/modeling-cmds/src/ok_response.rs @@ -1335,6 +1335,22 @@ define_ok_modeling_cmd_response_enum! { pub region_mapping: HashMap, } + /// The response from the 'RegionGetResolvableIntersectionInfo'. + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] + pub struct RegionGetResolvableIntersectionInfo { + /// The UUID of the walking curve that borders the queried region + pub segment: Uuid, + /// The UUID of the curve that intersects the walking curve that also borders the queried region + pub intersection_segment: Uuid, + /// Disambiguator providing the index of the intersection. Can be non-zero if the two curves intersect multiple times + pub intersection_index: u32, + /// The total number of intersections between the two curves. + pub intersection_count: u32, + /// True if the region lies within the clockwise interior of the two intersections (inside a "right" turn from the segment to the intersection segment) + pub curve_clockwise: bool, + } + /// The response from the 'CreateRegionFromQueryPoint'. /// The region should have an ID taken from the ID of the /// 'CreateRegionFromQueryPoint' modeling command.