Ejemplo n.º 1
0
def Display(anyCurve):
    " overall display "
    if _ghl.GEOMETRY_OUTPUT:
        # add diffrent fill and outline to different GeoOut bracnch
        i = _ghl.GeoOut.BranchCount
        _ghl.GeoOut.Add(anyCurve,Path(i))
        _ghl.ColorOut.Add(_ghl.STROKE_COLOR,Path(i))
        if IS_FILL:
            _ghl.GeoOut.Add(_fill_geometry(anyCurve),Path(i))
            _ghl.ColorOut.Add(_ghl.FILL_COLOR,Path(i))
    if _ghl.COLOR_OUTPUT:
        _fill_color(anyCurve,_ghl.IS_FILL,_ghl.IS_STROKE)
Ejemplo n.º 2
0
def Display(anyCurve):
    " overall display "
    if GEOMETRY_OUTPUT:
        # add diffrent fill and outline to different GeoOut bracnch
        is_fill = STYLE.FILL_COLOR.A > 0
        is_stroke = STYLE.STROKE_COLOR.A > 0
        i = GeoOut.BranchCount
        if is_stroke:
            GeoOut.Add(anyCurve,Path(i))
            ColorOut.Add(STYLE.STROKE_COLOR,Path(i))

        if is_fill:
            GeoOut.Add(_fill_geometry(anyCurve),Path(i))
            ColorOut.Add(STYLE.FILL_COLOR,Path(i))
    if COLOR_OUTPUT:
        _fill_color(anyCurve,STYLE.IS_FILL,STYLE.IS_STROKE)
Ejemplo n.º 3
0
 def proc(input, tree, track):
     for i, item in enumerate(input):
         if hasattr(item, '__iter__'):  # if list or tuple
             track.append(i)
             proc(item, tree, track)
             track.pop()
         else:
             tree.Add(item, Path(*track))
Ejemplo n.º 4
0
 def proc(input,tree,track):
     path = Path(Array[int](track))
     if len(input) == 0 and none_and_holes: tree.EnsurePath(path); return
     for i,item in enumerate(input):
         if hasattr(item, '__iter__'): #if list or tuple
             track.append(i); proc(item,tree,track); track.pop()
         else:
             if none_and_holes: tree.Insert(item,path,i)
             elif item is not None: tree.Add(item,path)
Ejemplo n.º 5
0
 def proc(input, tree, track):
     for i, item in enumerate(input):
         if isinstance(item,
                       (list, tuple)):  # don't count iterables like colors
             track.append(i)
             proc(item, tree, track)
             track.pop()
         else:
             tree.Add(item, Path(*track))
Ejemplo n.º 6
0
 def proc(input, tree, track):
     for i, item in enumerate(input):
         if isinstance(
                 item,
             (list, tuple, array.array)):  # ignore iterables like str
             track.append(i)
             proc(item, tree, track)
             track.pop()
         else:
             tree.Add(item, Path(*track))
Ejemplo n.º 7
0
 def process_one_item(items, tree, track):
     path = Path(Array[int](track))
     if len(items) == 0 and none_and_holes:
         tree.EnsurePath(path)
         return
     for i, item in enumerate(items):
         if hasattr(item, '__iter__'):
             track.append(i)
             process_one_item(item, tree, track)
             track.pop()
         else:
             if none_and_holes:
                 tree.Insert(item, path, i)
             elif item is not None:
                 tree.Add(item, path)