GUI Entities
- class discopygal.gui.RCircleSegment.RCircleSegment(radius: float, center_x: float, center_y: float, start_angle: float, end_angle: float, clockwise, line_width: float, line_color=2, fill_color=19)
A class that represents a circle segment on screen (as a Qt5 object) A circle segment is a non-linear connected curve that is contained in some circle In this representation, it is made of a circle plus start and end angles
- Parameters:
radius (
float
) – radius of circlecenter_x (
float
) – x position of circle centercenter_y (
float
) – y position of circle centerstart_angle (
float
) – start angle of circle segmentend_angle (
float
) – end angle of circle segmentclockwise (
bool
) – draw from start to end clockwise or counter-clockwiseline_width (
int
) – width of the boundary of the circle segmentline_color (
QtGui.QColor
) – color of the circle segmentfill_color (
QtGui.QColor
) – color of the interior of circle
- class discopygal.gui.RDisc.RDisc(r, x, y, color, line_color, line_width)
A class that represents a disc on screen (as a Qt5 object)
- Parameters:
r (
float
) – radius of discx (
float
) – x location of discy (
float
) – y location of disccolor (
QtGui.QColor
) – color of the interior of discline_color (
QtGui.QColor
) – color of the boundary of discline_width (
int
) – width of the boundary of disc
- x()
Return x position of the center of disc
- Returns:
x position of the center of disc
- Return type:
float
- y()
Return y position of the center of disc
- Returns:
y position of the center of disc
- Return type:
float
- class discopygal.gui.RDiscRobot.RDiscRobot(r: float, x: float, y: float, color, line_width: float, line_color=2, text='')
A class that represents a disc robot on screen (as a Qt5 object) Similar to RDisc, but has text description (number) capability
- Parameters:
r (
float
) – radius of discx (
float
) – x location of discy (
float
) – y location of disccolor (
QtGui.QColor
) – color of the interior of discline_width (
int
) – width of the boundary of disctext (
str
) – the text description (number) of the robot
- set_text(text: str)
Set the robot’s text description (number)
- Parameters:
text (
str
) – robot text description
- x() float
Return x position of the center of disc robot
- Returns:
x position of the center of disc robot
- Return type:
float
- y() float
Return y position of the center of disc robot
- Returns:
y position of the center of disc robot
- Return type:
float
- class discopygal.gui.RPolygon.RPolygon(points, line_color, fill_color, line_width, text='', pos=None)
A class that represents a polygon on screen (as a Qt5 object)
- Parameters:
points (list<(
float
,float
)>) – list of points of the polygonline_color (
QtGui.QColor
) – color of the boundary of polygonfill_color (
QtGui.QColor
) – color of the interior of polygonline_width (
int
) – width of the boundary of polygonpos (
QtCore.QPointF
) – initial position of polygon (used for animation). If none first vertex is chosen.
- points()
Return a list of polygon’s vertices
- Returns:
list polygon vertices
- Return type:
list<
QPointF
>
- x()
Return x position of the first vertex in polygon
- Returns:
x position of the first vertex in polygon
- Return type:
float
- y()
Return y position of the first vertex in polygon
- Returns:
y position of the first vertex in polygon
- Return type:
float
- class discopygal.gui.RPolygonWithHoles.RPolygonWithHoles(points, holes, line_color, fill_color, line_width)
A class that represents a polygon with holes on screen (as a Qt5 object)
- Parameters:
points (list<(
float
,float
)>) – list of points of the polygonholes (list<list<(
float
,float
)>>) – list of holes, each hole is a list of pointsline_color (
QtGui.QColor
) – color of the boundary of polygonfill_color (
QtGui.QColor
) – color of the interior of polygonline_width (
int
) – width of the boundary of polygon
- points()
Return a list of polygon’s vertices
- Returns:
list polygon vertices
- Return type:
list<
QPointF
>
- x()
Return x position of the first vertex in polygon
- Returns:
x position of the first vertex in polygon
- Return type:
float
- y()
Return y position of the first vertex in polygon
- Returns:
y position of the first vertex in polygon
- Return type:
float
- class discopygal.gui.RSegment_angle.RSegment_angle(x1, y1, l, a, line_color, line_width)
A class that represents an angled linear segment on screen (as a Qt5 object) The segment is defined with its start position, its length and the angle (Instead of start and end position like in RSegment)
- Parameters:
x1 (
float
) – x position of start endpointy1 (
float
) – y position of start endpointl (
float
) – length of the segmenta (
float
) – angle (in radians) af the segmentline_color (
QtGui.QColor
) – color of the segmentline_width (
int
) – width of segment
- angle()
Return the angle of the segment
- Returns:
angle of segment
- Return type:
float
- x()
Return x position of the start endpoint of segment
- Returns:
x position of the start endpoint of segment
- Return type:
float
- y()
Return y position of the start endpoint of segment
- Returns:
y position of the start endpoint of segment
- Return type:
float
- class discopygal.gui.RSegment.RSegment(x1, y1, x2, y2, color, line_width, opacity)
A class that represents a linear segment on screen (as a Qt5 object) The segment is defined with its start and end positions of endpoints (Instead of start position, length and angle like in RSegment_angle)
- Parameters:
x1 (
float
) – x position of start endpointy1 (
float
) – y position of start endpointx2 (
float
) – x position of end endpointy2 (
float
) – y position of end endpointcolor (
QtGui.QColor
) – color of the segmentline_width (
int
) – width of segment
- x()
Return x position of the start endpoint of segment
- Returns:
x position of the start endpoint of segment
- Return type:
float
- y()
Return y position of the start endpoint of segment
- Returns:
y position of the start endpoint of segment
- Return type:
float
- class discopygal.gui.RText.RText(text, x, y, size, color)
A class that represents a text label on screen (as a Qt5 object)
- Parameters:
text (
str
) – text labelx (
float
) – x position of text labely (
float
) – y position of text labelsize (
int
) – size of labelcolor (
QtGui.QColor
) – color of the label