line on first layer then spheres
This commit is contained in:
@@ -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°",
|
||||
|
||||
Reference in New Issue
Block a user