Commit d2010a03 authored by Libor's avatar Libor
Browse files

Output of draw.py now goes just to one file.

parent 76dbbcef
Loading
Loading
Loading
Loading
+28 −7
Original line number Diff line number Diff line
@@ -2,7 +2,15 @@ import re
from pyx import *

filename = "nodesLevel_"
depth = 2
depth = 5
colors = [
    color.cmyk.Yellow,
    color.rgb.green,
    color.rgb.blue,
    color.rgb.red,
    color.rgb.black
]
c = canvas.canvas()
for i in range(depth):
    with open(filename + str(i), 'r') as f:
        lines = f.readlines()
@@ -38,11 +46,24 @@ for i in range(depth):
    stepy = lengthy / rectsy
    print(str(stepx))
    print(str(stepy))
    c = canvas.canvas()
    for state in states:
        if state.get("state"):
        if state.get("state") and i < depth - 1:
            c.stroke(path.rect(state.get("x") * stepx, 
                               state.get("y") * stepy, 
                               stepx,
                               stepy), 
                     [deco.filled([colors[i]])])
        elif i == 0:
            c.stroke(path.rect(state.get("x") * stepx,
                               state.get("y") * stepy,
                               stepx,
                               stepy),
                     [deco.filled([color.rgb.white])])
        elif i == depth - 1:
            c.fill(path.rect(state.get("x") * stepx,
                             state.get("y") * stepy,
                             stepx,
                             stepy))
    c.writePDFfile(filename + str(i)) 
                             stepy),
                   [deco.filled([color.rgb.black])])
c.writePDFfile(filename)