def addexproute(self, exp_order, layer_nr): """ This function initialises the Arrows of the export route order and its numbers. """ for shape_nr in range(len(exp_order)): shape = self.shapes[exp_order[shape_nr]] st = self.expprv en = None # if hasattr(shape.geos[0], "type") and shape.geos[0].type is "Circle": # en,self.expprv = shape.geos[0].O,shape # else: en, self.expprv = shape.get_start_end_points_physical() if (hasattr(shape.geos[0], "type") and shape.geos[0].type is "Circle"): self.expcol = QtCore.Qt.darkGreen self.routearrows.append( Arrow(startp=en, endp=st, color=self.expcol, pencolor=self.expcol)) self.expcol = QtCore.Qt.darkGray self.routetext.append( RouteText(text=("%s,%s" % (layer_nr, shape_nr + 1)), startp=en)) # self.routetext[-1].ItemIgnoresTransformations self.addItem(self.routearrows[-1]) self.addItem(self.routetext[-1])
def addexprouteen(self): st = self.expprv en = Point(g.config.vars.Plane_Coordinates['axis1_start_end'], g.config.vars.Plane_Coordinates['axis2_start_end']) self.expcol = QtCore.Qt.darkRed self.routearrows.append( Arrow(startp=en, endp=st, color=self.expcol, pencolor=self.expcol)) self.addItem(self.routearrows[-1])
def __init__( self, pos: Tuple[int, int], width: int, height: int, action: Callable, args: List[Any], initial_arg: Any, ) -> None: super().__init__() self.pos_x = pos[0] self.pos_y = pos[1] self.width = width self.height = height self.action = action self.args = args self.current = initial_arg self.left_arrow = Arrow((pos[0] - 4, pos[1]), height, left=True) self.right_arrow = Arrow((pos[0] + width + 4, pos[1]), height) self.update_color()
def createenarrow(self, shape): """ This function creates the Arrows at the end point of a shape when the shape is selected. @param shape: The shape for which the Arrow shall be created. """ length = 20 end, end_ang = shape.get_start_end_points_physical(False, True) arrow = Arrow(startp=end, length=length, angle=end_ang, color=QColor(0, 245, 100), pencolor=QColor(0, 180, 50), startarrow=False) return arrow
def createstarrow(self, shape): """ This function creates the Arrows at the end point of a shape when the shape is selected. @param shape: The shape for which the Arrow shall be created. """ length = 20 start, start_ang = shape.get_start_end_points_physical(True, True) arrow = Arrow(startp=start, length=length, angle=start_ang, color=QColor(50, 200, 255), pencolor=QColor(50, 100, 255)) return arrow