MCPcopy Create free account
hub / github.com/PJLab-ADG/OASim / Circle

Class Circle

limsim/utils/obstacles.py:101–129  ·  view source on GitHub ↗

A class representing a circle shape.

Source from the content-addressed store, hash-verified

99
100
101class Circle(Shape):
102 """
103 A class representing a circle shape.
104 """
105
106 def __init__(self, radius: float) -> None:
107 super().__init__()
108 self._radius: float = radius
109
110 @property
111 def radius(self) -> float:
112 return self._radius
113
114 def plotSelf(self, node: dpg.node, center: np.ndarray, ex: float,
115 ey: float, ctf: CoordTF):
116 """
117 Plots the circle shape.
118
119 Args:
120 node: The node to plot the shape on.
121 ex: The x-coordinate of the observer.
122 ey: The y-coordinate of the observer.
123 """
124 cx, cy = ctf.dpgCoord(center[0], center[1], ex, ey)
125 dpg.draw_circle((cx, cy),
126 CoordTF.zoomScale * self.radius,
127 color=(235, 47, 6),
128 fill=(229, 80, 57, 20),
129 parent=node)
130
131
132class ObsType(IntEnum):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected