Skip to content

Commit

Permalink
SIMPLE-6384 Added rotation attribute to ellipse and rectangle annotat…
Browse files Browse the repository at this point in the history
…ions (#96)
  • Loading branch information
tmikuska authored May 2, 2024
1 parent 51e9901 commit 1764e70
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions virl2_client/models/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ def __init__(
self._color = WHITE
self._x2 = 100
self._y2 = 100
self._rotation = 0
if annotation_data:
self.update(annotation_data, push_to_server=False)

Expand Down Expand Up @@ -466,6 +467,19 @@ def y2(self, value: int) -> None:
self._set_annotation_property("y2", value)
self._y2 = value

@property
def rotation(self) -> int:
"""Rotation of an object, in degrees."""
self._lab.sync_topology_if_outdated()
return self._rotation

@rotation.setter
@locked
def rotation(self, value: int) -> None:
"""Set rotation of an object, in degrees."""
self._set_annotation_property("rotation", value)
self._rotation = value


class AnnotationEllipse(Annotation):
"""
Expand All @@ -485,6 +499,7 @@ def __init__(
self._color = WHITE
self._x2 = 100
self._y2 = 100
self._rotation = 0
if annotation_data:
self.update(annotation_data, push_to_server=False)

Expand Down Expand Up @@ -514,6 +529,19 @@ def y2(self, value: int) -> None:
self._set_annotation_property("y2", value)
self._y2 = value

@property
def rotation(self) -> int:
"""Rotation of an object, in degrees."""
self._lab.sync_topology_if_outdated()
return self._rotation

@rotation.setter
@locked
def rotation(self, value: int) -> None:
"""Set rotation of an object, in degrees."""
self._set_annotation_property("rotation", value)
self._rotation = value


class AnnotationLine(Annotation):
"""
Expand Down

0 comments on commit 1764e70

Please sign in to comment.