Commit b5e531a5 authored by ronan's avatar ronan
Browse files

A gérer:

x == x ou y == y pour les cercles et les breakpoints
+ finir gestion des edges
parent 8e344782
......@@ -14,3 +14,8 @@ class Edge:
assert(self.p1 is None)
self.p1 = p
def draw(self, screen, fX = 1.0, fY = 1.0):
if self.p0 is not None and self.p1 is not None:
screen.create_line(self.p0.getX() * fX, self.p0.getY() * fY, self.p1.getX() * fX, self.p1.getY() * fY)
if self.p0 is not None:
self.p0.drawF(screen, fX, fY, "Red")
\ No newline at end of file
......@@ -200,4 +200,7 @@ class Vector3D:
def draw(self, screen, color = "black"):
screen.create_oval(self.getX() - 5, self.getY() - 5, self.getX() + 5, self.getY() + 5, fill=color)
#screen.create_line(self.getX(), self.getY(), self.getX(), self.getY() + 1)
\ No newline at end of file
#screen.create_line(self.getX(), self.getY(), self.getX(), self.getY() + 1)
def drawF(self, screen, fX, fY, color = "black"):
screen.create_oval(self.getX()*fX - 5, self.getY()*fY - 5, self.getX()*fX + 5, self.getY()*fY + 5, fill=color)
\ No newline at end of file
......@@ -139,7 +139,7 @@ def clavier(event):
a.draw(canvas)
draw_Pol(canvas, a, ly[0])
canvas.create_text(a.getX() - 10, a.getY() + 12, anchor=W, font="Arial 8", text=str(rE[i]))
"""
E = fortune.events
for i in range(len(E)):
if type(E[i]) == VSite:
......@@ -161,6 +161,15 @@ def clavier(event):
a.setY(E[i].point.getY() * fac.getY())
a.draw(canvas)
canvas.create_text(a.getX() - 10, a.getY() + 12, anchor=W, font="Arial 8", text=str(E[i]))
"""
edgesA = []
for i in range(len(fortune.sites)):
for j in range(len(fortune.sites[i].edges)):
if fortune.sites[i].edges[j] not in edgesA:
edgesA.append(fortune.sites[i].edges[j])
fortune.sites[i].edges[j].draw(canvas, fac.getX(), fac.getY())
fortune.beachLine.draw(canvas, 1000, 100, 6)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment