From 59faec445194d56c92461629be861101a62d1c0e Mon Sep 17 00:00:00 2001 From: dbirman <7455770+dbirman@users.noreply.github.com> Date: Tue, 24 Sep 2024 04:09:32 +0000 Subject: [PATCH] chore: Build Models --- models/csharp/PinpointModels.cs | 100 +++++++++++++++--- .../pinpoint/AffineTransformModel.json | 2 +- models/schemas/pinpoint/CraniotomyGroup.json | 1 - models/schemas/pinpoint/CraniotomyModel.json | 2 +- models/schemas/pinpoint/InsertionModel.json | 1 + models/schemas/pinpoint/ProbeModel.json | 1 + models/schemas/pinpoint/RigModel.json | 1 + models/schemas/pinpoint/SceneModel.json | 1 + 8 files changed, 91 insertions(+), 18 deletions(-) delete mode 100644 models/schemas/pinpoint/CraniotomyGroup.json create mode 100644 models/schemas/pinpoint/InsertionModel.json create mode 100644 models/schemas/pinpoint/ProbeModel.json create mode 100644 models/schemas/pinpoint/RigModel.json create mode 100644 models/schemas/pinpoint/SceneModel.json diff --git a/models/csharp/PinpointModels.cs b/models/csharp/PinpointModels.cs index 94b127a..bba4416 100644 --- a/models/csharp/PinpointModels.cs +++ b/models/csharp/PinpointModels.cs @@ -4,44 +4,114 @@ [Serializable] public struct AffineTransformModel { + public string Name; + public string Prefix; public Vector3 Scaling; public Vector3 Rotation; - public AffineTransformModel(Vector3 scaling, Vector3 rotation) + public AffineTransformModel(string name, string prefix, Vector3 scaling, Vector3 rotation) { + Name = name; + Prefix = prefix; Scaling = scaling; Rotation = rotation; } } + [Serializable] -public struct CraniotomyGroup +public struct CraniotomyModel { - public string Atlas; - public CraniotomyModel[] Data; + public int Index; + public Vector2 Size; + public Vector3 Position; - public CraniotomyGroup(string atlas, CraniotomyModel[] data) + public CraniotomyModel(int index, Vector2 size, Vector3 position) { - Atlas = atlas; - Data = data; + Index = index; + Size = size; + Position = position; } } [Serializable] -public struct CraniotomyModel +public struct InsertionModel { - public int Index; - public Vector2 Size; public Vector3 Position; - public bool Rectangle; + public Vector3 Angles; + public string AtlasName; + public string TransformName; + public Vector3 ReferenceCoord; - public CraniotomyModel(int index, Vector2 size, Vector3 position, bool rectangle) + public InsertionModel(Vector3 position, Vector3 angles, string atlasName, string transformName, Vector3 referenceCoord) { - Index = index; - Size = size; Position = position; - Rectangle = rectangle; + Angles = angles; + AtlasName = atlasName; + TransformName = transformName; + ReferenceCoord = referenceCoord; + } +} + + +[Serializable] +public struct ProbeModel +{ + public InsertionModel Insertion; + public string Uuid; + public string Name; + public Color Color; + + public ProbeModel(InsertionModel insertion, string uuid, string name, Color color) + { + Insertion = insertion; + Uuid = uuid; + Name = name; + Color = color; + } +} + + +[Serializable] +public struct RigModel +{ + public string Name; + public string Image; + public Vector3 Position; + public Vector3 Rotation; + public bool Active; + + public RigModel(string name, string image, Vector3 position, Vector3 rotation, bool active) + { + Name = name; + Image = image; + Position = position; + Rotation = rotation; + Active = active; + } +} + +[Serializable] +public struct SceneModel +{ + public string AtlasName; + public string TransformName; + public ProbeModel[] Probes; + public RigModel[] Rigs; + public CraniotomyModel[] Craniotomies; + public string[] SceneData; + public string Settings; + + public SceneModel(string atlasName, string transformName, ProbeModel[] probes, RigModel[] rigs, CraniotomyModel[] craniotomies, string[] sceneData, string settings) + { + AtlasName = atlasName; + TransformName = transformName; + Probes = probes; + Rigs = rigs; + Craniotomies = craniotomies; + SceneData = sceneData; + Settings = settings; } } diff --git a/models/schemas/pinpoint/AffineTransformModel.json b/models/schemas/pinpoint/AffineTransformModel.json index 98d2ca0..62a1f31 100644 --- a/models/schemas/pinpoint/AffineTransformModel.json +++ b/models/schemas/pinpoint/AffineTransformModel.json @@ -1 +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 +{"$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": {"Name": {"title": "Name", "type": "string"}, "Prefix": {"title": "Prefix", "type": "string"}, "Scaling": {"$ref": "#/$defs/Vector3"}, "Rotation": {"$ref": "#/$defs/Vector3"}}, "required": ["Name", "Prefix", "Scaling", "Rotation"], "title": "AffineTransformModel", "type": "object"} \ No newline at end of file diff --git a/models/schemas/pinpoint/CraniotomyGroup.json b/models/schemas/pinpoint/CraniotomyGroup.json deleted file mode 100644 index 6ccead5..0000000 --- a/models/schemas/pinpoint/CraniotomyGroup.json +++ /dev/null @@ -1 +0,0 @@ -{"$defs": {"CraniotomyModel": {"properties": {"Index": {"title": "Index", "type": "integer"}, "Size": {"$ref": "#/$defs/Vector2"}, "Position": {"$ref": "#/$defs/Vector3"}, "Rectangle": {"default": false, "title": "Rectangle", "type": "boolean"}}, "required": ["Index", "Size", "Position"], "title": "CraniotomyModel", "type": "object"}, "Vector2": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}}, "title": "Vector2", "type": "object"}, "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": {"Atlas": {"title": "Atlas", "type": "string"}, "Data": {"items": {"$ref": "#/$defs/CraniotomyModel"}, "title": "Data", "type": "array"}}, "required": ["Atlas", "Data"], "title": "CraniotomyGroup", "type": "object"} \ No newline at end of file diff --git a/models/schemas/pinpoint/CraniotomyModel.json b/models/schemas/pinpoint/CraniotomyModel.json index 9a0e27d..d3dab63 100644 --- a/models/schemas/pinpoint/CraniotomyModel.json +++ b/models/schemas/pinpoint/CraniotomyModel.json @@ -1 +1 @@ -{"$defs": {"Vector2": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}}, "title": "Vector2", "type": "object"}, "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": {"Index": {"title": "Index", "type": "integer"}, "Size": {"$ref": "#/$defs/Vector2"}, "Position": {"$ref": "#/$defs/Vector3"}, "Rectangle": {"default": false, "title": "Rectangle", "type": "boolean"}}, "required": ["Index", "Size", "Position"], "title": "CraniotomyModel", "type": "object"} \ No newline at end of file +{"$defs": {"Vector2": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}}, "title": "Vector2", "type": "object"}, "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": {"Index": {"title": "Index", "type": "integer"}, "Size": {"$ref": "#/$defs/Vector2"}, "Position": {"$ref": "#/$defs/Vector3"}}, "required": ["Index", "Size", "Position"], "title": "CraniotomyModel", "type": "object"} \ No newline at end of file diff --git a/models/schemas/pinpoint/InsertionModel.json b/models/schemas/pinpoint/InsertionModel.json new file mode 100644 index 0000000..4cf7607 --- /dev/null +++ b/models/schemas/pinpoint/InsertionModel.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": {"Position": {"$ref": "#/$defs/Vector3"}, "Angles": {"$ref": "#/$defs/Vector3"}, "AtlasName": {"title": "Atlasname", "type": "string"}, "TransformName": {"title": "Transformname", "type": "string"}, "ReferenceCoord": {"$ref": "#/$defs/Vector3"}}, "required": ["Position", "Angles", "AtlasName", "TransformName", "ReferenceCoord"], "title": "InsertionModel", "type": "object"} \ No newline at end of file diff --git a/models/schemas/pinpoint/ProbeModel.json b/models/schemas/pinpoint/ProbeModel.json new file mode 100644 index 0000000..d0d654b --- /dev/null +++ b/models/schemas/pinpoint/ProbeModel.json @@ -0,0 +1 @@ +{"$defs": {"Color": {"properties": {"r": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "R", "type": "number"}, "g": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "G", "type": "number"}, "b": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "B", "type": "number"}, "a": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "A", "type": "number"}}, "title": "Color", "type": "object"}, "InsertionModel": {"properties": {"Position": {"$ref": "#/$defs/Vector3"}, "Angles": {"$ref": "#/$defs/Vector3"}, "AtlasName": {"title": "Atlasname", "type": "string"}, "TransformName": {"title": "Transformname", "type": "string"}, "ReferenceCoord": {"$ref": "#/$defs/Vector3"}}, "required": ["Position", "Angles", "AtlasName", "TransformName", "ReferenceCoord"], "title": "InsertionModel", "type": "object"}, "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": {"Insertion": {"$ref": "#/$defs/InsertionModel"}, "Uuid": {"title": "Uuid", "type": "string"}, "Name": {"title": "Name", "type": "string"}, "Color": {"$ref": "#/$defs/Color"}}, "required": ["Insertion", "Uuid", "Name", "Color"], "title": "ProbeModel", "type": "object"} \ No newline at end of file diff --git a/models/schemas/pinpoint/RigModel.json b/models/schemas/pinpoint/RigModel.json new file mode 100644 index 0000000..b144da6 --- /dev/null +++ b/models/schemas/pinpoint/RigModel.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": {"Name": {"title": "Name", "type": "string"}, "Image": {"title": "Image", "type": "string"}, "Position": {"allOf": [{"$ref": "#/$defs/Vector3"}], "default": {"x": 0.0, "y": 0.0, "z": 0.0}}, "Rotation": {"allOf": [{"$ref": "#/$defs/Vector3"}], "default": {"x": 0.0, "y": 0.0, "z": 0.0}}, "Active": {"title": "Active", "type": "boolean"}}, "required": ["Name", "Image", "Active"], "title": "RigModel", "type": "object"} \ No newline at end of file diff --git a/models/schemas/pinpoint/SceneModel.json b/models/schemas/pinpoint/SceneModel.json new file mode 100644 index 0000000..e49a467 --- /dev/null +++ b/models/schemas/pinpoint/SceneModel.json @@ -0,0 +1 @@ +{"$defs": {"Color": {"properties": {"r": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "R", "type": "number"}, "g": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "G", "type": "number"}, "b": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "B", "type": "number"}, "a": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "A", "type": "number"}}, "title": "Color", "type": "object"}, "CraniotomyModel": {"properties": {"Index": {"title": "Index", "type": "integer"}, "Size": {"$ref": "#/$defs/Vector2"}, "Position": {"$ref": "#/$defs/Vector3"}}, "required": ["Index", "Size", "Position"], "title": "CraniotomyModel", "type": "object"}, "InsertionModel": {"properties": {"Position": {"$ref": "#/$defs/Vector3"}, "Angles": {"$ref": "#/$defs/Vector3"}, "AtlasName": {"title": "Atlasname", "type": "string"}, "TransformName": {"title": "Transformname", "type": "string"}, "ReferenceCoord": {"$ref": "#/$defs/Vector3"}}, "required": ["Position", "Angles", "AtlasName", "TransformName", "ReferenceCoord"], "title": "InsertionModel", "type": "object"}, "ProbeModel": {"properties": {"Insertion": {"$ref": "#/$defs/InsertionModel"}, "Uuid": {"title": "Uuid", "type": "string"}, "Name": {"title": "Name", "type": "string"}, "Color": {"$ref": "#/$defs/Color"}}, "required": ["Insertion", "Uuid", "Name", "Color"], "title": "ProbeModel", "type": "object"}, "RigModel": {"properties": {"Name": {"title": "Name", "type": "string"}, "Image": {"title": "Image", "type": "string"}, "Position": {"allOf": [{"$ref": "#/$defs/Vector3"}], "default": {"x": 0.0, "y": 0.0, "z": 0.0}}, "Rotation": {"allOf": [{"$ref": "#/$defs/Vector3"}], "default": {"x": 0.0, "y": 0.0, "z": 0.0}}, "Active": {"title": "Active", "type": "boolean"}}, "required": ["Name", "Image", "Active"], "title": "RigModel", "type": "object"}, "Vector2": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}}, "title": "Vector2", "type": "object"}, "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": {"AtlasName": {"title": "Atlasname", "type": "string"}, "TransformName": {"title": "Transformname", "type": "string"}, "Probes": {"items": {"$ref": "#/$defs/ProbeModel"}, "title": "Probes", "type": "array"}, "Rigs": {"items": {"$ref": "#/$defs/RigModel"}, "title": "Rigs", "type": "array"}, "Craniotomies": {"items": {"$ref": "#/$defs/CraniotomyModel"}, "title": "Craniotomies", "type": "array"}, "SceneData": {"items": {"type": "string"}, "title": "Scenedata", "type": "array"}, "Settings": {"title": "Settings", "type": "string"}}, "required": ["AtlasName", "TransformName", "Probes", "Rigs", "Craniotomies", "SceneData", "Settings"], "title": "SceneModel", "type": "object"} \ No newline at end of file