def __init__(self, pts, edges, interval=0.01, skip=0): self.interval = interval self.iteration = 0 self.skip = skip Triangulation.__init__(self, pts, edges) # visual #debugging: draw edges, front, triangles self.win = pg.plot() self.graph = pg.GraphItem(pos=pts.copy(), adj=edges.copy(), pen={ 'width': 3, 'color': (0, 100, 0) }) self.win.addItem(self.graph) self.front_line = pg.PlotCurveItem(pen={ 'width': 2, 'dash': [5, 5], 'color': 'y' }) self.win.addItem(self.front_line) self.tri_shapes = {} self.nextStep = False self.win.scene().sigMouseClicked.connect(self.mouseClicked)
def __init__(self, pts, edges, interval=0.01, skip=0): self.interval = interval self.iteration = 0 self.skip = skip Triangulation.__init__(self, pts, edges) # visual #debugging: draw edges, front, triangles self.win = pg.plot() self.graph = pg.GraphItem(pos=pts.copy(), adj=edges.copy(), pen={"width": 3, "color": (0, 100, 0)}) self.win.addItem(self.graph) self.front_line = pg.PlotCurveItem(pen={"width": 2, "dash": [5, 5], "color": "y"}) self.win.addItem(self.front_line) self.tri_shapes = {} self.nextStep = False self.win.scene().sigMouseClicked.connect(self.mouseClicked)
def edge_event(self, *args, **kwargs): self.draw_state() Triangulation._edge_event(self, *args, **kwargs) self.draw_state()
def remove_tri(self, *args, **kwargs): k = Triangulation._remove_tri(self, *args, **kwargs) self.undraw_tri(k)
def add_tri(self, *args, **kwargs): Triangulation._add_tri(self, *args, **kwargs) self.draw_tri(list(self.tris.keys())[-1], source=kwargs.get('source', None))
def edge_event(self, *args, **kwargs): self.draw_state() Triangulation.edge_event(self, *args, **kwargs) self.draw_state()
def remove_tri(self, *args, **kwargs): k = Triangulation.remove_tri(self, *args, **kwargs) self.undraw_tri(k)
def add_tri(self, *args, **kwargs): Triangulation.add_tri(self, *args, **kwargs) self.draw_tri(list(self.tris.keys())[-1], source=kwargs.get('source', None))