def createccarrow(self): """ createccarrow() """ length = 20 if self.shape.cut_cor == 40: self.ccarrow = None elif self.shape.cut_cor == 41: self.ccarrow = Arrow(startp=self.startp, length=length, angle=self.angle + pi / 2, color=QtGui.QColor(200, 200, 255), pencolor=QtGui.QColor(200, 100, 255)) self.ccarrow.setParentItem(self) else: self.ccarrow = Arrow(startp=self.startp, length=length, angle=self.angle - pi / 2, color=QtGui.QColor(200, 200, 255), pencolor=QtGui.QColor(200, 100, 255)) self.ccarrow.setParentItem(self)
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_st_en_points(1) arrow = Arrow(startp=end, length=length, angle=end_ang, color=QtGui.QColor(0, 245, 100), pencolor=QtGui.QColor(0, 180, 50), dir=1) arrow.hide() 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_st_en_points(0) arrow = Arrow(startp=start, length=length, angle=start_ang, color=QtGui.QColor(50, 200, 255), pencolor=QtGui.QColor(50, 100, 255)) arrow.hide() return arrow
def addexprouteen(self): """ This function initialises the Arrows of the export route order and its numbers. @param shapes_st_en_points: The start and end points of the shapes. @param route: The order of the shapes to be plotted. """ x_st = g.config.vars.Plane_Coordinates['axis1_start_end'] y_st = g.config.vars.Plane_Coordinates['axis2_start_end'] st = self.expprv en = Point(x=x_st, y=y_st) self.expcol = QtCore.Qt.darkRed self.routearrows.append( Arrow(startp=st, endp=en, color=self.expcol, pencolor=self.expcol)) self.addItem(self.routearrows[-1])
def addexproute(self, exp_order, layer_nr): """ This function initialises the Arrows of the export route order and its numbers. @param shapes_st_en_points: The start and end points of the shapes. @param route: The order of the shapes to be plotted. """ x_st = g.config.vars.Plane_Coordinates['axis1_start_end'] y_st = g.config.vars.Plane_Coordinates['axis2_start_end'] start = Point(x=x_st, y=y_st) ende = Point(x=x_st, y=y_st) #shapes_st_en_points.append([start,ende]) #Print the optimised route for shape_nr in range(len(exp_order)): st = self.expprv [en, dummy] = self.shapes[exp_order[shape_nr]].get_st_en_points(0) [self.expprv, dummy] = self.shapes[exp_order[shape_nr]].get_st_en_points(1) # st=shapes_st_en_points[route[st_nr]][1] # en=shapes_st_en_points[route[en_nr]][0] self.routearrows.append( Arrow(startp=st, endp=en, 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.routetext[-1]) self.addItem(self.routearrows[-1])