From 213b13537384a03b8fb6a799169790fb4fab9879 Mon Sep 17 00:00:00 2001 From: Kenneth Yang <82800265+kjy5@users.noreply.github.com> Date: Sat, 7 Sep 2024 12:54:40 -0700 Subject: [PATCH] chore: Build Models (#47) * chore: Build Models * chore: Autoformat code --------- Co-authored-by: dbirman <7455770+dbirman@users.noreply.github.com> Co-authored-by: kjy5 --- models/csharp/PinpointModels.cs | 14 ++++++++++++++ models/schemas/pinpoint/AffineTransformModel.json | 1 + src/vbl_aquarium/models/pinpoint.py | 4 ++-- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 models/schemas/pinpoint/AffineTransformModel.json diff --git a/models/csharp/PinpointModels.cs b/models/csharp/PinpointModels.cs index 2c1cf6c..94b127a 100644 --- a/models/csharp/PinpointModels.cs +++ b/models/csharp/PinpointModels.cs @@ -1,5 +1,19 @@ using UnityEngine; using System; + +[Serializable] +public struct AffineTransformModel +{ + public Vector3 Scaling; + public Vector3 Rotation; + + public AffineTransformModel(Vector3 scaling, Vector3 rotation) + { + Scaling = scaling; + Rotation = rotation; + } +} + [Serializable] public struct CraniotomyGroup { diff --git a/models/schemas/pinpoint/AffineTransformModel.json b/models/schemas/pinpoint/AffineTransformModel.json new file mode 100644 index 0000000..98d2ca0 --- /dev/null +++ b/models/schemas/pinpoint/AffineTransformModel.json @@ -0,0 +1 @@ +{"$defs": {"Vector3": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}, "z": {"default": 0.0, "title": "Z", "type": "number"}}, "title": "Vector3", "type": "object"}}, "properties": {"Scaling": {"$ref": "#/$defs/Vector3"}, "Rotation": {"$ref": "#/$defs/Vector3"}}, "required": ["Scaling", "Rotation"], "title": "AffineTransformModel", "type": "object"} \ No newline at end of file diff --git a/src/vbl_aquarium/models/pinpoint.py b/src/vbl_aquarium/models/pinpoint.py index 84eee39..df529d3 100644 --- a/src/vbl_aquarium/models/pinpoint.py +++ b/src/vbl_aquarium/models/pinpoint.py @@ -18,9 +18,9 @@ class CraniotomyGroup(VBLBaseModel): data: list[CraniotomyModel] - # TRANSFORM + class AffineTransformModel(VBLBaseModel): scaling: Vector3 - rotation: Vector3 \ No newline at end of file + rotation: Vector3