Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Build Models #23

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": {"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": {"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/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 src/vbl_aquarium/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def remove_ignored_classes(module):

# Move using statement to top
output = "using System;\n" + output

if "using UnityEngine;" in output:
output = "using UnityEngine;\n" + output.replace("using UnityEngine;", "")

Expand Down
2 changes: 2 additions & 0 deletions src/vbl_aquarium/models/dock.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ class UploadModel(VBLBaseModel):
data: str
password: str


class DownloadModel(VBLBaseModel):
password: str


# Models for sending save/load messages
class SaveModel(VBLBaseModel):
bucket: str
Expand Down
13 changes: 8 additions & 5 deletions src/vbl_aquarium/models/urchin.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,20 @@ class CameraMode(str, Enum):
id: str
type: str
position: Vector3 = None
rotation: Vector3 = Vector3(0,0,0)
rotation: Vector3 = Vector3(0, 0, 0)
target: Vector3 = None
zoom: float = 16
pan: Vector2 = Vector2(0,0)
pan: Vector2 = Vector2(0, 0)
mode: CameraMode = CameraMode.orthographic
controllable: bool = True
main: bool = False


class CameraRotationModel(VBLBaseModel):
start_rotation: Vector3
end_rotation: Vector3


# Individual mesh neuron


Expand Down Expand Up @@ -114,8 +116,9 @@ class ParticleGroupModel(VBLBaseModel):


# Utilities



class ColormapModel(VBLBaseModel):
name: str = ''
name: str = ""
min: float = 0
max: float = 1
max: float = 1
Loading