예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
 def edge_event(self, *args, **kwargs):
     self.draw_state()
     Triangulation._edge_event(self, *args, **kwargs)
     self.draw_state()
예제 #4
0
 def remove_tri(self, *args, **kwargs):
     k = Triangulation._remove_tri(self, *args, **kwargs)
     self.undraw_tri(k)
예제 #5
0
 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))
예제 #6
0
 def edge_event(self, *args, **kwargs):
     self.draw_state()
     Triangulation.edge_event(self, *args, **kwargs)
     self.draw_state()
예제 #7
0
 def remove_tri(self, *args, **kwargs):
     k = Triangulation.remove_tri(self, *args, **kwargs)
     self.undraw_tri(k)
예제 #8
0
 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))