Skip to content

Commit

Permalink
feat: adding new models for urchin and Vector2
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Apr 4, 2024
1 parent 4e0eeee commit 1d23797
Show file tree
Hide file tree
Showing 20 changed files with 99 additions and 25 deletions.
14 changes: 14 additions & 0 deletions models/csharp/GenericModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
48 changes: 43 additions & 5 deletions models/csharp/UrchinModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion models/schemas/generic/ColorData.json
Original file line number Diff line number Diff line change
@@ -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"}
{"$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"}
2 changes: 1 addition & 1 deletion models/schemas/generic/ColorList.json
Original file line number Diff line number Diff line change
@@ -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"}
{"$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"}
2 changes: 1 addition & 1 deletion models/schemas/generic/IDListColorData.json
Original file line number Diff line number Diff line change
@@ -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"}
{"$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"}
2 changes: 1 addition & 1 deletion models/schemas/generic/IDListColorList.json
Original file line number Diff line number Diff line change
@@ -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"}
{"$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"}
1 change: 1 addition & 0 deletions models/schemas/generic/Vector2Data.json
Original file line number Diff line number Diff line change
@@ -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"}
2 changes: 1 addition & 1 deletion models/schemas/urchin/AtlasModel.json
Original file line number Diff line number Diff line change
@@ -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"}
{"$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"}
2 changes: 1 addition & 1 deletion models/schemas/urchin/CameraModel.json
Original file line number Diff line number Diff line change
@@ -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"}
{"$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"}
2 changes: 1 addition & 1 deletion models/schemas/urchin/ColormapModel.json
Original file line number Diff line number Diff line change
@@ -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"}
{"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"}
2 changes: 1 addition & 1 deletion models/schemas/urchin/CustomMeshModel.json
Original file line number Diff line number Diff line change
@@ -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"}
{"$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"}
1 change: 1 addition & 0 deletions models/schemas/urchin/LineModel.json
Original file line number Diff line number Diff line change
@@ -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"}
Loading

0 comments on commit 1d23797

Please sign in to comment.