diff --git a/models/csharp/GenericModels.cs b/models/csharp/GenericModels.cs index 40cd45d..60b90d2 100644 --- a/models/csharp/GenericModels.cs +++ b/models/csharp/GenericModels.cs @@ -315,6 +315,20 @@ public StringList(string id, string[] values) } +[Serializable] +public struct Vector2Data +{ + public string ID; + public Vector2 Value; + + public Vector2Data(string id, Vector2 value) + { + ID = id; + Value = value; + } +} + + [Serializable] public struct Vector3Data { diff --git a/models/csharp/UrchinModels.cs b/models/csharp/UrchinModels.cs index 0a9dda8..40d6a4d 100644 --- a/models/csharp/UrchinModels.cs +++ b/models/csharp/UrchinModels.cs @@ -22,27 +22,27 @@ public AtlasModel(string name, Vector3 referenceCoord, StructureModel[] areas, C [Serializable] public struct CameraModel { - public float Id; - public string Type; + public string ID; public Vector3 Position; public Vector3 Rotation; public Vector3 Target; public float Zoom; public Vector2 Pan; public CameraMode Mode; + public Color BackgroundColor; public bool Controllable; public bool Main; - public CameraModel(float id, string type, Vector3 position, Vector3 rotation, Vector3 target, float zoom, Vector2 pan, CameraMode mode, bool controllable, bool main) + public CameraModel(string id, Vector3 position, Vector3 rotation, Vector3 target, float zoom, Vector2 pan, CameraMode mode, Color backgroundColor, bool controllable, bool main) { - Id = id; - Type = type; + ID = id; Position = position; Rotation = rotation; Target = target; Zoom = zoom; Pan = pan; Mode = mode; + BackgroundColor = backgroundColor; Controllable = controllable; Main = main; } @@ -141,6 +141,22 @@ public CustomMeshModel(string id, Vector3 position, bool useReference, string ma } +[Serializable] +public struct LineModel +{ + public string ID; + public Vector3[] Positions; + public Color Color; + + public LineModel(string id, Vector3[] positions, Color color) + { + ID = id; + Positions = positions; + Color = color; + } +} + + [Serializable] public struct MeshModel { @@ -202,6 +218,28 @@ public PrimitiveMeshModel(MeshModel[] data) } +[Serializable] +public struct ProbeModel +{ + public string ID; + public Vector3 Position; + public Color Color; + public Vector3 Angles; + public string Style; + public Vector3 Scale; + + public ProbeModel(string id, Vector3 position, Color color, Vector3 angles, string style, Vector3 scale) + { + ID = id; + Position = position; + Color = color; + Angles = angles; + Style = style; + Scale = scale; + } +} + + [Serializable] public struct StructureModel { diff --git a/models/schemas/generic/ColorData.json b/models/schemas/generic/ColorData.json index 0adafbb..46ec915 100644 --- a/models/schemas/generic/ColorData.json +++ b/models/schemas/generic/ColorData.json @@ -1 +1 @@ -{"$defs": {"Color": {"properties": {"r": {"maximum": 1.0, "minimum": 0.0, "title": "R", "type": "number"}, "g": {"maximum": 1.0, "minimum": 0.0, "title": "G", "type": "number"}, "b": {"maximum": 1.0, "minimum": 0.0, "title": "B", "type": "number"}, "a": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "A", "type": "number"}}, "required": ["r", "g", "b"], "title": "Color", "type": "object"}}, "properties": {"ID": {"title": "Id", "type": "string"}, "Value": {"$ref": "#/$defs/Color"}}, "required": ["ID", "Value"], "title": "ColorData", "type": "object"} \ No newline at end of file +{"$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"}}, "properties": {"ID": {"title": "Id", "type": "string"}, "Value": {"$ref": "#/$defs/Color"}}, "required": ["ID", "Value"], "title": "ColorData", "type": "object"} \ No newline at end of file diff --git a/models/schemas/generic/ColorList.json b/models/schemas/generic/ColorList.json index a4c11dc..21b6a21 100644 --- a/models/schemas/generic/ColorList.json +++ b/models/schemas/generic/ColorList.json @@ -1 +1 @@ -{"$defs": {"Color": {"properties": {"r": {"maximum": 1.0, "minimum": 0.0, "title": "R", "type": "number"}, "g": {"maximum": 1.0, "minimum": 0.0, "title": "G", "type": "number"}, "b": {"maximum": 1.0, "minimum": 0.0, "title": "B", "type": "number"}, "a": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "A", "type": "number"}}, "required": ["r", "g", "b"], "title": "Color", "type": "object"}}, "properties": {"ID": {"title": "Id", "type": "string"}, "Values": {"items": {"$ref": "#/$defs/Color"}, "title": "Values", "type": "array"}}, "required": ["ID", "Values"], "title": "ColorList", "type": "object"} \ No newline at end of file +{"$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"}}, "properties": {"ID": {"title": "Id", "type": "string"}, "Values": {"items": {"$ref": "#/$defs/Color"}, "title": "Values", "type": "array"}}, "required": ["ID", "Values"], "title": "ColorList", "type": "object"} \ No newline at end of file diff --git a/models/schemas/generic/IDListColorData.json b/models/schemas/generic/IDListColorData.json index 8ed8748..67db74c 100644 --- a/models/schemas/generic/IDListColorData.json +++ b/models/schemas/generic/IDListColorData.json @@ -1 +1 @@ -{"$defs": {"Color": {"properties": {"r": {"maximum": 1.0, "minimum": 0.0, "title": "R", "type": "number"}, "g": {"maximum": 1.0, "minimum": 0.0, "title": "G", "type": "number"}, "b": {"maximum": 1.0, "minimum": 0.0, "title": "B", "type": "number"}, "a": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "A", "type": "number"}}, "required": ["r", "g", "b"], "title": "Color", "type": "object"}}, "properties": {"IDs": {"items": {"type": "string"}, "title": "Ids", "type": "array"}, "Value": {"$ref": "#/$defs/Color"}}, "required": ["IDs", "Value"], "title": "IDListColorData", "type": "object"} \ No newline at end of file +{"$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"}}, "properties": {"IDs": {"items": {"type": "string"}, "title": "Ids", "type": "array"}, "Value": {"$ref": "#/$defs/Color"}}, "required": ["IDs", "Value"], "title": "IDListColorData", "type": "object"} \ No newline at end of file diff --git a/models/schemas/generic/IDListColorList.json b/models/schemas/generic/IDListColorList.json index b5d23e6..ccf6126 100644 --- a/models/schemas/generic/IDListColorList.json +++ b/models/schemas/generic/IDListColorList.json @@ -1 +1 @@ -{"$defs": {"Color": {"properties": {"r": {"maximum": 1.0, "minimum": 0.0, "title": "R", "type": "number"}, "g": {"maximum": 1.0, "minimum": 0.0, "title": "G", "type": "number"}, "b": {"maximum": 1.0, "minimum": 0.0, "title": "B", "type": "number"}, "a": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "A", "type": "number"}}, "required": ["r", "g", "b"], "title": "Color", "type": "object"}}, "properties": {"IDs": {"items": {"type": "string"}, "title": "Ids", "type": "array"}, "Values": {"items": {"$ref": "#/$defs/Color"}, "title": "Values", "type": "array"}}, "required": ["IDs", "Values"], "title": "IDListColorList", "type": "object"} \ No newline at end of file +{"$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"}}, "properties": {"IDs": {"items": {"type": "string"}, "title": "Ids", "type": "array"}, "Values": {"items": {"$ref": "#/$defs/Color"}, "title": "Values", "type": "array"}}, "required": ["IDs", "Values"], "title": "IDListColorList", "type": "object"} \ No newline at end of file diff --git a/models/schemas/generic/Vector2Data.json b/models/schemas/generic/Vector2Data.json new file mode 100644 index 0000000..c46649d --- /dev/null +++ b/models/schemas/generic/Vector2Data.json @@ -0,0 +1 @@ +{"$defs": {"Vector2": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}}, "title": "Vector2", "type": "object"}}, "properties": {"ID": {"title": "Id", "type": "string"}, "Value": {"$ref": "#/$defs/Vector2"}}, "required": ["ID", "Value"], "title": "Vector2Data", "type": "object"} \ No newline at end of file diff --git a/models/schemas/urchin/AtlasModel.json b/models/schemas/urchin/AtlasModel.json index 2642699..9d63eae 100644 --- a/models/schemas/urchin/AtlasModel.json +++ b/models/schemas/urchin/AtlasModel.json @@ -1 +1 @@ -{"$defs": {"Color": {"properties": {"r": {"maximum": 1.0, "minimum": 0.0, "title": "R", "type": "number"}, "g": {"maximum": 1.0, "minimum": 0.0, "title": "G", "type": "number"}, "b": {"maximum": 1.0, "minimum": 0.0, "title": "B", "type": "number"}, "a": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "A", "type": "number"}}, "required": ["r", "g", "b"], "title": "Color", "type": "object"}, "ColormapModel": {"properties": {"Name": {"title": "Name", "type": "string"}, "Min": {"title": "Min", "type": "number"}, "Max": {"title": "Max", "type": "number"}}, "required": ["Name", "Min", "Max"], "title": "ColormapModel", "type": "object"}, "StructureModel": {"properties": {"Name": {"title": "Name", "type": "string"}, "Acronym": {"title": "Acronym", "type": "string"}, "AtlasId": {"title": "Atlasid", "type": "integer"}, "Color": {"$ref": "#/$defs/Color"}, "Visible": {"default": false, "title": "Visible", "type": "boolean"}, "ColorIntensity": {"default": -1, "title": "Colorintensity", "type": "number"}, "Side": {"default": 0, "title": "Side", "type": "integer"}, "Material": {"default": "default", "title": "Material", "type": "string"}}, "required": ["Name", "Acronym", "AtlasId", "Color"], "title": "StructureModel", "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": {"Name": {"title": "Name", "type": "string"}, "ReferenceCoord": {"allOf": [{"$ref": "#/$defs/Vector3"}], "default": null}, "Areas": {"items": {"$ref": "#/$defs/StructureModel"}, "title": "Areas", "type": "array"}, "Colormap": {"$ref": "#/$defs/ColormapModel"}}, "required": ["Name", "Areas", "Colormap"], "title": "AtlasModel", "type": "object"} \ No newline at end of file +{"$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"}, "ColormapModel": {"properties": {"Name": {"default": "", "title": "Name", "type": "string"}, "Min": {"default": 0, "title": "Min", "type": "number"}, "Max": {"default": 1, "title": "Max", "type": "number"}}, "title": "ColormapModel", "type": "object"}, "StructureModel": {"properties": {"Name": {"title": "Name", "type": "string"}, "Acronym": {"title": "Acronym", "type": "string"}, "AtlasId": {"title": "Atlasid", "type": "integer"}, "Color": {"$ref": "#/$defs/Color"}, "Visible": {"default": false, "title": "Visible", "type": "boolean"}, "ColorIntensity": {"default": -1, "title": "Colorintensity", "type": "number"}, "Side": {"default": 0, "title": "Side", "type": "integer"}, "Material": {"default": "default", "title": "Material", "type": "string"}}, "required": ["Name", "Acronym", "AtlasId", "Color"], "title": "StructureModel", "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": {"Name": {"title": "Name", "type": "string"}, "ReferenceCoord": {"allOf": [{"$ref": "#/$defs/Vector3"}], "default": null}, "Areas": {"items": {"$ref": "#/$defs/StructureModel"}, "title": "Areas", "type": "array"}, "Colormap": {"$ref": "#/$defs/ColormapModel"}}, "required": ["Name", "Areas", "Colormap"], "title": "AtlasModel", "type": "object"} \ No newline at end of file diff --git a/models/schemas/urchin/CameraModel.json b/models/schemas/urchin/CameraModel.json index 24ee15a..5a4e45a 100644 --- a/models/schemas/urchin/CameraModel.json +++ b/models/schemas/urchin/CameraModel.json @@ -1 +1 @@ -{"$defs": {"CameraMode": {"enum": ["orthographic", "perspective"], "title": "CameraMode", "type": "string"}, "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": {"Id": {"title": "Id", "type": "number"}, "Type": {"title": "Type", "type": "string"}, "Position": {"$ref": "#/$defs/Vector3"}, "Rotation": {"$ref": "#/$defs/Vector3"}, "Target": {"$ref": "#/$defs/Vector3"}, "Zoom": {"title": "Zoom", "type": "number"}, "Pan": {"$ref": "#/$defs/Vector2"}, "Mode": {"$ref": "#/$defs/CameraMode"}, "Controllable": {"title": "Controllable", "type": "boolean"}, "Main": {"title": "Main", "type": "boolean"}}, "required": ["Id", "Type", "Position", "Rotation", "Target", "Zoom", "Pan", "Mode", "Controllable", "Main"], "title": "CameraModel", "type": "object"} \ No newline at end of file +{"$defs": {"CameraMode": {"enum": ["orthographic", "perspective"], "title": "CameraMode", "type": "string"}, "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"}, "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": {"ID": {"title": "Id", "type": "string"}, "Position": {"allOf": [{"$ref": "#/$defs/Vector3"}], "default": null}, "Rotation": {"allOf": [{"$ref": "#/$defs/Vector3"}], "default": {"x": 0.0, "y": 0.0, "z": 0.0}}, "Target": {"allOf": [{"$ref": "#/$defs/Vector3"}], "default": null}, "Zoom": {"default": 16, "title": "Zoom", "type": "number"}, "Pan": {"allOf": [{"$ref": "#/$defs/Vector2"}], "default": {"x": 0.0, "y": 0.0}}, "Mode": {"allOf": [{"$ref": "#/$defs/CameraMode"}], "default": "orthographic"}, "BackgroundColor": {"allOf": [{"$ref": "#/$defs/Color"}], "default": {"r": 1.0, "g": 1.0, "b": 1.0, "a": 1.0}}, "Controllable": {"default": true, "title": "Controllable", "type": "boolean"}, "Main": {"default": false, "title": "Main", "type": "boolean"}}, "required": ["ID"], "title": "CameraModel", "type": "object"} \ No newline at end of file diff --git a/models/schemas/urchin/ColormapModel.json b/models/schemas/urchin/ColormapModel.json index a50fa83..e903a2b 100644 --- a/models/schemas/urchin/ColormapModel.json +++ b/models/schemas/urchin/ColormapModel.json @@ -1 +1 @@ -{"properties": {"Name": {"title": "Name", "type": "string"}, "Min": {"title": "Min", "type": "number"}, "Max": {"title": "Max", "type": "number"}}, "required": ["Name", "Min", "Max"], "title": "ColormapModel", "type": "object"} \ No newline at end of file +{"properties": {"Name": {"default": "", "title": "Name", "type": "string"}, "Min": {"default": 0, "title": "Min", "type": "number"}, "Max": {"default": 1, "title": "Max", "type": "number"}}, "title": "ColormapModel", "type": "object"} \ No newline at end of file diff --git a/models/schemas/urchin/CustomMeshModel.json b/models/schemas/urchin/CustomMeshModel.json index 1609b06..d414c6e 100644 --- a/models/schemas/urchin/CustomMeshModel.json +++ b/models/schemas/urchin/CustomMeshModel.json @@ -1 +1 @@ -{"$defs": {"Color": {"properties": {"r": {"maximum": 1.0, "minimum": 0.0, "title": "R", "type": "number"}, "g": {"maximum": 1.0, "minimum": 0.0, "title": "G", "type": "number"}, "b": {"maximum": 1.0, "minimum": 0.0, "title": "B", "type": "number"}, "a": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "A", "type": "number"}}, "required": ["r", "g", "b"], "title": "Color", "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": {"ID": {"title": "Id", "type": "string"}, "Position": {"$ref": "#/$defs/Vector3"}, "UseReference": {"title": "Usereference", "type": "boolean"}, "Material": {"title": "Material", "type": "string"}, "Scale": {"$ref": "#/$defs/Vector3"}, "Color": {"$ref": "#/$defs/Color"}}, "required": ["ID", "Position", "UseReference", "Material", "Scale", "Color"], "title": "CustomMeshModel", "type": "object"} \ No newline at end of file +{"$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"}, "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": {"ID": {"title": "Id", "type": "string"}, "Position": {"$ref": "#/$defs/Vector3"}, "UseReference": {"title": "Usereference", "type": "boolean"}, "Material": {"title": "Material", "type": "string"}, "Scale": {"$ref": "#/$defs/Vector3"}, "Color": {"$ref": "#/$defs/Color"}}, "required": ["ID", "Position", "UseReference", "Material", "Scale", "Color"], "title": "CustomMeshModel", "type": "object"} \ No newline at end of file diff --git a/models/schemas/urchin/LineModel.json b/models/schemas/urchin/LineModel.json new file mode 100644 index 0000000..09b5383 --- /dev/null +++ b/models/schemas/urchin/LineModel.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"}, "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": {"ID": {"title": "Id", "type": "string"}, "Positions": {"default": [], "items": {"$ref": "#/$defs/Vector3"}, "title": "Positions", "type": "array"}, "Color": {"allOf": [{"$ref": "#/$defs/Color"}], "default": {"r": 1.0, "g": 1.0, "b": 1.0, "a": 1.0}}}, "required": ["ID"], "title": "LineModel", "type": "object"} \ No newline at end of file diff --git a/models/schemas/urchin/MeshModel.json b/models/schemas/urchin/MeshModel.json index 3ad781d..c534dcd 100644 --- a/models/schemas/urchin/MeshModel.json +++ b/models/schemas/urchin/MeshModel.json @@ -1 +1 @@ -{"$defs": {"Color": {"properties": {"r": {"maximum": 1.0, "minimum": 0.0, "title": "R", "type": "number"}, "g": {"maximum": 1.0, "minimum": 0.0, "title": "G", "type": "number"}, "b": {"maximum": 1.0, "minimum": 0.0, "title": "B", "type": "number"}, "a": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "A", "type": "number"}}, "required": ["r", "g", "b"], "title": "Color", "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": {"ID": {"title": "Id", "type": "string"}, "Shape": {"title": "Shape", "type": "string"}, "Position": {"$ref": "#/$defs/Vector3"}, "Color": {"$ref": "#/$defs/Color"}, "Scale": {"$ref": "#/$defs/Vector3"}, "Material": {"title": "Material", "type": "string"}, "Interactive": {"title": "Interactive", "type": "boolean"}}, "required": ["ID", "Shape", "Position", "Color", "Scale", "Material", "Interactive"], "title": "MeshModel", "type": "object"} \ No newline at end of file +{"$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"}, "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": {"ID": {"title": "Id", "type": "string"}, "Shape": {"title": "Shape", "type": "string"}, "Position": {"$ref": "#/$defs/Vector3"}, "Color": {"$ref": "#/$defs/Color"}, "Scale": {"$ref": "#/$defs/Vector3"}, "Material": {"title": "Material", "type": "string"}, "Interactive": {"title": "Interactive", "type": "boolean"}}, "required": ["ID", "Shape", "Position", "Color", "Scale", "Material", "Interactive"], "title": "MeshModel", "type": "object"} \ No newline at end of file diff --git a/models/schemas/urchin/ParticleGroupModel.json b/models/schemas/urchin/ParticleGroupModel.json index 009831f..c89c2cb 100644 --- a/models/schemas/urchin/ParticleGroupModel.json +++ b/models/schemas/urchin/ParticleGroupModel.json @@ -1 +1 @@ -{"$defs": {"Color": {"properties": {"r": {"maximum": 1.0, "minimum": 0.0, "title": "R", "type": "number"}, "g": {"maximum": 1.0, "minimum": 0.0, "title": "G", "type": "number"}, "b": {"maximum": 1.0, "minimum": 0.0, "title": "B", "type": "number"}, "a": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "A", "type": "number"}}, "required": ["r", "g", "b"], "title": "Color", "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": {"ID": {"title": "Id", "type": "string"}, "Scale": {"$ref": "#/$defs/Vector3"}, "Shape": {"title": "Shape", "type": "string"}, "Material": {"title": "Material", "type": "string"}, "Xs": {"items": {"type": "number"}, "title": "Xs", "type": "array"}, "Ys": {"items": {"type": "number"}, "title": "Ys", "type": "array"}, "Zs": {"items": {"type": "number"}, "title": "Zs", "type": "array"}, "Colors": {"items": {"$ref": "#/$defs/Color"}, "title": "Colors", "type": "array"}}, "required": ["ID", "Scale", "Shape", "Material", "Xs", "Ys", "Zs", "Colors"], "title": "ParticleGroupModel", "type": "object"} \ No newline at end of file +{"$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"}, "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": {"ID": {"title": "Id", "type": "string"}, "Scale": {"$ref": "#/$defs/Vector3"}, "Shape": {"title": "Shape", "type": "string"}, "Material": {"title": "Material", "type": "string"}, "Xs": {"items": {"type": "number"}, "title": "Xs", "type": "array"}, "Ys": {"items": {"type": "number"}, "title": "Ys", "type": "array"}, "Zs": {"items": {"type": "number"}, "title": "Zs", "type": "array"}, "Colors": {"items": {"$ref": "#/$defs/Color"}, "title": "Colors", "type": "array"}}, "required": ["ID", "Scale", "Shape", "Material", "Xs", "Ys", "Zs", "Colors"], "title": "ParticleGroupModel", "type": "object"} \ No newline at end of file diff --git a/models/schemas/urchin/PrimitiveMeshModel.json b/models/schemas/urchin/PrimitiveMeshModel.json index 5e3be2f..d4613fd 100644 --- a/models/schemas/urchin/PrimitiveMeshModel.json +++ b/models/schemas/urchin/PrimitiveMeshModel.json @@ -1 +1 @@ -{"$defs": {"Color": {"properties": {"r": {"maximum": 1.0, "minimum": 0.0, "title": "R", "type": "number"}, "g": {"maximum": 1.0, "minimum": 0.0, "title": "G", "type": "number"}, "b": {"maximum": 1.0, "minimum": 0.0, "title": "B", "type": "number"}, "a": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "A", "type": "number"}}, "required": ["r", "g", "b"], "title": "Color", "type": "object"}, "MeshModel": {"properties": {"ID": {"title": "Id", "type": "string"}, "Shape": {"title": "Shape", "type": "string"}, "Position": {"$ref": "#/$defs/Vector3"}, "Color": {"$ref": "#/$defs/Color"}, "Scale": {"$ref": "#/$defs/Vector3"}, "Material": {"title": "Material", "type": "string"}, "Interactive": {"title": "Interactive", "type": "boolean"}}, "required": ["ID", "Shape", "Position", "Color", "Scale", "Material", "Interactive"], "title": "MeshModel", "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": {"Data": {"items": {"$ref": "#/$defs/MeshModel"}, "title": "Data", "type": "array"}}, "required": ["Data"], "title": "PrimitiveMeshModel", "type": "object"} \ No newline at end of file +{"$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"}, "MeshModel": {"properties": {"ID": {"title": "Id", "type": "string"}, "Shape": {"title": "Shape", "type": "string"}, "Position": {"$ref": "#/$defs/Vector3"}, "Color": {"$ref": "#/$defs/Color"}, "Scale": {"$ref": "#/$defs/Vector3"}, "Material": {"title": "Material", "type": "string"}, "Interactive": {"title": "Interactive", "type": "boolean"}}, "required": ["ID", "Shape", "Position", "Color", "Scale", "Material", "Interactive"], "title": "MeshModel", "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": {"Data": {"items": {"$ref": "#/$defs/MeshModel"}, "title": "Data", "type": "array"}}, "required": ["Data"], "title": "PrimitiveMeshModel", "type": "object"} \ No newline at end of file diff --git a/models/schemas/urchin/ProbeModel.json b/models/schemas/urchin/ProbeModel.json new file mode 100644 index 0000000..6eef15b --- /dev/null +++ b/models/schemas/urchin/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"}, "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": {"ID": {"title": "Id", "type": "string"}, "Position": {"$ref": "#/$defs/Vector3"}, "Color": {"$ref": "#/$defs/Color"}, "Angles": {"$ref": "#/$defs/Vector3"}, "Style": {"title": "Style", "type": "string"}, "Scale": {"$ref": "#/$defs/Vector3"}}, "required": ["ID", "Position", "Color", "Angles", "Style", "Scale"], "title": "ProbeModel", "type": "object"} \ No newline at end of file diff --git a/models/schemas/urchin/StructureModel.json b/models/schemas/urchin/StructureModel.json index 6299584..899b9ee 100644 --- a/models/schemas/urchin/StructureModel.json +++ b/models/schemas/urchin/StructureModel.json @@ -1 +1 @@ -{"$defs": {"Color": {"properties": {"r": {"maximum": 1.0, "minimum": 0.0, "title": "R", "type": "number"}, "g": {"maximum": 1.0, "minimum": 0.0, "title": "G", "type": "number"}, "b": {"maximum": 1.0, "minimum": 0.0, "title": "B", "type": "number"}, "a": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "A", "type": "number"}}, "required": ["r", "g", "b"], "title": "Color", "type": "object"}}, "properties": {"Name": {"title": "Name", "type": "string"}, "Acronym": {"title": "Acronym", "type": "string"}, "AtlasId": {"title": "Atlasid", "type": "integer"}, "Color": {"$ref": "#/$defs/Color"}, "Visible": {"default": false, "title": "Visible", "type": "boolean"}, "ColorIntensity": {"default": -1, "title": "Colorintensity", "type": "number"}, "Side": {"default": 0, "title": "Side", "type": "integer"}, "Material": {"default": "default", "title": "Material", "type": "string"}}, "required": ["Name", "Acronym", "AtlasId", "Color"], "title": "StructureModel", "type": "object"} \ No newline at end of file +{"$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"}}, "properties": {"Name": {"title": "Name", "type": "string"}, "Acronym": {"title": "Acronym", "type": "string"}, "AtlasId": {"title": "Atlasid", "type": "integer"}, "Color": {"$ref": "#/$defs/Color"}, "Visible": {"default": false, "title": "Visible", "type": "boolean"}, "ColorIntensity": {"default": -1, "title": "Colorintensity", "type": "number"}, "Side": {"default": 0, "title": "Side", "type": "integer"}, "Material": {"default": "default", "title": "Material", "type": "string"}}, "required": ["Name", "Acronym", "AtlasId", "Color"], "title": "StructureModel", "type": "object"} \ No newline at end of file diff --git a/src/vbl_aquarium/models/generic.py b/src/vbl_aquarium/models/generic.py index 3fd2205..1440dd6 100644 --- a/src/vbl_aquarium/models/generic.py +++ b/src/vbl_aquarium/models/generic.py @@ -2,7 +2,7 @@ from pydantic import Field -from vbl_aquarium.models.unity import Color, Vector3 +from vbl_aquarium.models.unity import Color, Vector2, Vector3 from vbl_aquarium.utils.vbl_base_model import VBLBaseModel @@ -10,6 +10,9 @@ class IDData(VBLBaseModel): id: str = Field(..., alias="ID") +class Vector2Data(VBLBaseModel): + id: str = Field(alias= "ID") + value: Vector2 class Vector3Data(VBLBaseModel): id: str = Field(..., alias="ID") diff --git a/src/vbl_aquarium/models/unity.py b/src/vbl_aquarium/models/unity.py index d0ed4e1..8cade0c 100644 --- a/src/vbl_aquarium/models/unity.py +++ b/src/vbl_aquarium/models/unity.py @@ -5,9 +5,9 @@ class Color(BaseModel): - r: Annotated[float, Field(ge=0, le=1)] - g: Annotated[float, Field(ge=0, le=1)] - b: Annotated[float, Field(ge=0, le=1)] + r: Annotated[float, Field(default=1, ge=0, le=1)] + g: Annotated[float, Field(default=1, ge=0, le=1)] + b: Annotated[float, Field(default=1, ge=0, le=1)] a: Annotated[float, Field(default=1, ge=0, le=1)] diff --git a/src/vbl_aquarium/models/urchin.py b/src/vbl_aquarium/models/urchin.py index 0ee2858..d4e8a84 100644 --- a/src/vbl_aquarium/models/urchin.py +++ b/src/vbl_aquarium/models/urchin.py @@ -65,14 +65,14 @@ class CameraMode(str, Enum): orthographic = "orthographic" perspective = "perspective" - id: str - type: str + id: str = Field(alias="ID") position: Vector3 = None - rotation: Vector3 = Vector3(0,0,0) + rotation: Vector3 = Vector3() target: Vector3 = None zoom: float = 16 - pan: Vector2 = Vector2(0,0) + pan: Vector2 = Vector2() mode: CameraMode = CameraMode.orthographic + background_color: Color = Color() # white by default controllable: bool = True main: bool = False @@ -96,6 +96,22 @@ class MeshModel(VBLBaseModel): material: str interactive: bool +# Lines + +class LineModel(VBLBaseModel): + id: str = Field(alias="ID") + positions: list[Vector3] = [] + color: Color = Color() + +# Probes + +class ProbeModel(VBLBaseModel): + id: str = Field(alias="ID") + position: Vector3 + color: Color + angles: Vector3 + style: str + scale: Vector3 # Particle group