22 |
paper = vob.gl.SpecialPapers.selectionPaper(None); |
paper = vob.gl.SpecialPapers.selectionPaper(None); |
23 |
whiteground = vob.gl.GLRen.createFixedPaperQuad(paper, 0, 0, 1, 1, 0, 10, 10, 10); |
whiteground = vob.gl.GLRen.createFixedPaperQuad(paper, 0, 0, 1, 1, 0, 10, 10, 10); |
24 |
|
|
|
|
|
25 |
class MindMapMainNode2D(ff.view.buoy.MainNode2D): |
class MindMapMainNode2D(ff.view.buoy.MainNode2D): |
26 |
def __init__(self, plane, view2d, focus, controller): |
def __init__(self, plane, view2d, focus, controller): |
27 |
ff.view.buoy.MainNode2D.__init__(self, plane, view2d, controller); |
ff.view.buoy.MainNode2D.__init__(self, plane, view2d, controller); |
28 |
|
self.context = None |
29 |
|
|
30 |
def init(self, fen, nodeview): |
def init(self, fen, nodeview): |
31 |
self.fen, self.viewfunc = fen, nodeview |
self.fen, self.viewfunc = fen, nodeview |
32 |
|
|
69 |
def place(self, node, vs, cs): |
def place(self, node, vs, cs): |
70 |
p = self.viewfunc.f(self.fen.graph, node) |
p = self.viewfunc.f(self.fen.graph, node) |
71 |
|
|
72 |
cs_background = vs.orthoCS(cs,'WHITE_GROUND',0, 0,0, p.getWidth(), p.getHeight()) |
cs_background = vs.orthoCS(cs,'WHITE_GROUND',0, 0, 0, p.getWidth(), p.getHeight()) |
73 |
vs.put(whiteground, cs_background) |
vs.put(whiteground, cs_background) |
74 |
|
|
75 |
cs = vs.orthoBoxCS(cs,node,0, 0,0, 1,1, p.getWidth(), p.getHeight()) |
cs = vs.orthoBoxCS(cs,node,0, 0, 0, 1,1, p.getWidth(), p.getHeight()) |
76 |
p.place(vs, cs) |
p.place(vs, cs) |
77 |
vs.coords.activate(cs) |
vs.coords.activate(cs) |
78 |
|
|
79 |
|
# draw cursor |
80 |
|
if self.context and self.context.getAccursed() == node: |
81 |
|
self.context.drawCursor(vs, node, cs) |
82 |
|
|
83 |
class MindNet: |
class MindNet: |
84 |
""" Keeps up nodes in hashmap of 'linked to' nodes in hashmap. |
""" Keeps up nodes in hashmap of 'linked to' nodes in hashmap. |
85 |
Point-to-point list of connections. """ |
Point-to-point list of connections. """ |
106 |
self.alphContent = ff.util.AlphContent(fen) |
self.alphContent = ff.util.AlphContent(fen) |
107 |
self.box = None |
self.box = None |
108 |
self.nodef = nodef |
self.nodef = nodef |
109 |
|
self.context = None |
110 |
|
|
111 |
### fillet set up |
### fillet set up |
112 |
self.angle = 1 |
self.angle = 1 |
113 |
self.thick = 1 |
self.thick = 1 |
213 |
vs.matcher.add(self.matchingParent, cs, node) |
vs.matcher.add(self.matchingParent, cs, node) |
214 |
self.putNodeContent(vs, node, cs) |
self.putNodeContent(vs, node, cs) |
215 |
|
|
|
|
|
216 |
def getLinks(self, fen, node): |
def getLinks(self, fen, node): |
217 |
""" Get all links available with node.""" |
""" Get all links available with node.""" |
218 |
links = [] |
links = [] |
272 |
x,y = xy[0], xy[1] |
x,y = xy[0], xy[1] |
273 |
|
|
274 |
s = self.getNodeSize(deepnes) |
s = self.getNodeSize(deepnes) |
275 |
print 'size', s |
if (dbg): print 'size', s |
276 |
cs = vs.orthoBoxCS(into,'foo'+str(key),0, x-s/2.0,y-s/2.0, 1,1, s,s) |
cs = vs.orthoBoxCS(into,'foo'+str(key),0, x-s/2.0,y-s/2.0, 1,1, s,s) |
277 |
if dbg: |
if dbg: |
278 |
p('come:',x0,y0, angle, dirAngle) |
p('come:',x0,y0, angle, dirAngle) |
304 |
p.place(vs, cs) |
p.place(vs, cs) |
305 |
vs.coords.activate(cs) |
vs.coords.activate(cs) |
306 |
|
|
307 |
|
# draw cursor |
308 |
|
if self.context and self.context.getAccursed() == node: |
309 |
|
into = jarray.zeros(3, 'f') |
310 |
|
vs.coords.transformPoints3(cs, [0,0,0], into) |
311 |
|
cs = vs.orthoCS(0, 0, -100, into[0], into[1], 1, 1) |
312 |
|
self.context.drawCursor(vs, node, cs) |
313 |
|
|
314 |
|
|