diff --git a/models/csharp/UrchinModels.cs b/models/csharp/UrchinModels.cs index 40d6a4d..a04c1f5 100644 --- a/models/csharp/UrchinModels.cs +++ b/models/csharp/UrchinModels.cs @@ -265,3 +265,23 @@ public StructureModel(string name, string acronym, int atlasId, Color color, boo } } + +[Serializable] +public struct TextModel +{ + public string ID; + public string Text; + public Color Color; + public int FontSize; + public Vector2 Position; + + public TextModel(string id, string text, Color color, int fontSize, Vector2 position) + { + ID = id; + Text = text; + Color = color; + FontSize = fontSize; + Position = position; + } +} + diff --git a/models/schemas/urchin/TextModel.json b/models/schemas/urchin/TextModel.json new file mode 100644 index 0000000..da6b097 --- /dev/null +++ b/models/schemas/urchin/TextModel.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"}, "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"}, "Text": {"title": "Text", "type": "string"}, "Color": {"allOf": [{"$ref": "#/$defs/Color"}], "default": {"r": 0.0, "g": 0.0, "b": 0.0, "a": 1.0}}, "FontSize": {"default": 12, "title": "Fontsize", "type": "integer"}, "Position": {"allOf": [{"$ref": "#/$defs/Vector2"}], "default": {"x": 0.0, "y": 0.0}}}, "required": ["ID", "Text"], "title": "TextModel", "type": "object"} \ No newline at end of file diff --git a/src/vbl_aquarium/models/urchin.py b/src/vbl_aquarium/models/urchin.py index d4e8a84..7e1af60 100644 --- a/src/vbl_aquarium/models/urchin.py +++ b/src/vbl_aquarium/models/urchin.py @@ -128,6 +128,14 @@ class ParticleGroupModel(VBLBaseModel): colors: list[Color] +# Text + +class TextModel(VBLBaseModel): + id: str = Field(alias="ID") + text: str + color: Color = Color(r = 0, g = 0, b = 0) + font_size: int = 12 + position: Vector2 = Vector2() # Utilities