line on first layer then spheres
Some checks failed
CI/CD / wol (push) Has been cancelled
CI/CD / build (push) Has been cancelled

This commit is contained in:
2025-08-21 23:14:39 +02:00
parent 6a63ff5d0b
commit 552a330feb
3 changed files with 56 additions and 38 deletions

View File

@@ -15,7 +15,7 @@ class SphereGraphicsItem(QGraphicsEllipseItem):
SPHERE_WIDTH = 30
def __init__(self, x_pos: int, y_pos: int) -> None:
def __init__(self, x_pos: int, y_pos: int, color: Qt.GlobalColor = Qt.GlobalColor.darkBlue) -> None:
"""Create a sphere
Args:
@@ -32,7 +32,7 @@ class SphereGraphicsItem(QGraphicsEllipseItem):
self.y_pos = y_pos - self.SPHERE_WIDTH / 2
logging.debug(f"sphere at {self.x_pos}:{self.y_pos}")
brush = QBrush(Qt.GlobalColor.darkBlue)
brush = QBrush(color)
self.setBrush(brush)
pen = QPen(Qt.GlobalColor.blue)
pen.setWidth(3)
@@ -42,6 +42,15 @@ class SphereGraphicsItem(QGraphicsEllipseItem):
def boundingRect(self) -> QRectF:
return QRectF(self.x_pos, self.y_pos, self.SPHERE_WIDTH, self.SPHERE_WIDTH)
class HPSphereGraphicsItem(SphereGraphicsItem):
def __init__(self, x_pos: int, y_pos: int) -> None:
super().__init__(x_pos, y_pos, Qt.GlobalColor.darkGreen)
class StrenghSphereGraphicsItem(SphereGraphicsItem):
def __init__(self, x_pos: int, y_pos: int) -> None:
super().__init__(x_pos, y_pos, Qt.GlobalColor.darkRed)
class ArcGraphicsItem(QGraphicsItem):
"""Circle arc."""
@@ -72,7 +81,7 @@ class ArcGraphicsItem(QGraphicsItem):
self.width = width
self.angle_start = angle_start
self.angle_end = angle_end
self.draw_angle_start = int(angle_start / 16)
self.draw_angle_start = int(angle_start * 16)
self.draw_angle_end = int(angle_end * 16)
logging.debug(
"arc from %s:%s of %s from %s° to %s°",