91 |
|
|
92 |
def getMainNode(self): |
def getMainNode(self): |
93 |
return self.mainNode |
return self.mainNode |
94 |
def _nadir(self, cs): |
def drawscene(self, vs, mainboxinto, into, buoyinto): |
|
n = self.vs.coords.nadirUnitSq(cs, self.nadirCS) |
|
|
self.vs.matcher.add(cs, n, "NADIR") |
|
|
return n |
|
|
def drawscene(self, vs, mainboxinto, into, buoyinto, nadirCS): |
|
95 |
self.vs = vs |
self.vs = vs |
|
self.nadirCS = nadirCS |
|
96 |
self.buoyinto = buoyinto |
self.buoyinto = buoyinto |
97 |
self.cs = { } |
self.cs = { } |
98 |
|
|
163 |
dbg1 = self.vs.unitSqCS(into, "U") |
dbg1 = self.vs.unitSqCS(into, "U") |
164 |
self.vs.put(coloredQuad((0,1,0)), dbg1) |
self.vs.put(coloredQuad((0,1,0)), dbg1) |
165 |
|
|
|
into = self._nadir(into) |
|
166 |
self.vs.activate(into) |
self.vs.activate(into) |
167 |
|
|
168 |
### Render the buoy, get back anchor cs |
### Render the buoy, get back anchor cs |
171 |
self.cs[into] = (otherNode, linkId, otherAnchor, into) |
self.cs[into] = (otherNode, linkId, otherAnchor, into) |
172 |
|
|
173 |
if anchorCS >= 0: |
if anchorCS >= 0: |
174 |
|
# anchorCS < 0 when there is no anchor, e.g., for ttconnector |
175 |
|
# in FenPDF |
176 |
self.vs.map.put(lineconn, self.vs.unitSqCS(anchorCS, "UN"), |
self.vs.map.put(lineconn, self.vs.unitSqCS(anchorCS, "UN"), |
177 |
self.vs.unitSqCS(otherAnchorCS, "UN")) |
self.vs.unitSqCS(otherAnchorCS, "UN")) |
178 |
|
|
254 |
return sc |
return sc |
255 |
self.vs = vs |
self.vs = vs |
256 |
|
|
|
nadirCS = vs.translateCS(0, "NADIRORIGIN", |
|
|
.5 * vs.size.width, |
|
|
3.0 * vs.size.height) |
|
|
|
|
257 |
vs.put(background((.36, .74, 1.0))) |
vs.put(background((.36, .74, 1.0))) |
258 |
|
|
|
# XXX Should we take these geometries through nadir? |
|
|
|
|
259 |
geoms = self.geometer.place(vs) |
geoms = self.geometer.place(vs) |
260 |
|
|
261 |
for i in range(0, len(self.singles)): |
for i in range(0, len(self.singles)): |
262 |
self.singles[i].drawscene(vs, |
self.singles[i].drawscene(vs, |
263 |
geoms[i][0], |
geoms[i][0], |
264 |
geoms[i][1], |
geoms[i][1], |
265 |
geoms[i][2], |
geoms[i][2]) |
|
nadirCS) |
|
266 |
|
|
267 |
def mouse(self, ev): |
def mouse(self, ev): |
268 |
""" Returns true if buoymanager has eaten the event ;)""" |
""" Returns true if buoymanager has eaten the event ;)""" |