9 |
|
|
10 |
import gzz |
import gzz |
11 |
|
|
12 |
|
print "LOADING BUOYMANAGER" |
13 |
|
|
14 |
class RealBuoyManager(BuoyLinkListener): |
class RealBuoyManager(BuoyLinkListener): |
15 |
"""Manage buoys through the new APIs |
"""Manage buoys through the new APIs |
16 |
|
|
26 |
""" |
""" |
27 |
self.mainNode = initBuoyviewnodetype.createMainNode( |
self.mainNode = initBuoyviewnodetype.createMainNode( |
28 |
initLinkId, initAnchor, self) |
initLinkId, initAnchor, self) |
29 |
|
def nadir(self, cs): |
30 |
|
n = self.vs.coords.nadirUnitSq(cs, self.nadirCS) |
31 |
|
self.vs.matcher.add(cs, n, "NADIR") |
32 |
|
return n |
33 |
def scene(self, vs): |
def scene(self, vs): |
34 |
|
print "SCENE" |
35 |
self.vs = vs |
self.vs = vs |
36 |
|
|
37 |
|
self.nadirCS = vs.translateCS(0, "NADIRORIGIN", 400, 1500) |
38 |
|
|
39 |
vs.put(background((.5,.8,.5))) |
vs.put(background((.5,.8,.5))) |
40 |
|
|
41 |
main = vs.orthoBoxCS(0, "MAINVP", 0, 300, 200, .3, .3, 200, 200) |
main = vs.orthoBoxCS(0, "MAINVP", 0, 300, 200, .3, .3, 200, 200) |
42 |
self.mainNode.renderMain(vs, main) |
|
43 |
|
self.mainNode.renderMain(vs, self.nadir(main)) |
44 |
|
|
45 |
|
|
46 |
def link(self, direction, anchorCS, otherNode, linkId, otherAnchor): |
def link(self, direction, anchorCS, otherNode, linkId, otherAnchor): |
47 |
|
x = 400 |
48 |
|
r = 200 |
49 |
if dir > 0: |
if dir > 0: |
50 |
buoy = self.vs.coords.buoyOnCircle(0, anchorCS, |
buoy = self.vs.coords.buoyOnCircle(0, anchorCS, |
51 |
400, 300, 150, |
x, 300, r, |
52 |
250, 300, |
x-r, 300, |
53 |
30) |
0.1) |
54 |
else: |
else: |
55 |
buoy = self.vs.coords.buoyOnCircle(0, anchorCS, |
buoy = self.vs.coords.buoyOnCircle(0, anchorCS, |
56 |
400, 300, 150, |
x, 300, r, |
57 |
550, 300, |
x+r, 300, |
58 |
30) |
0.1) |
59 |
self.vs.matcher.add(buoy, linkId) |
self.vs.matcher.add(buoy, linkId) |
60 |
otherNode.renderBuoy(self.vs, buoy, linkId, otherAnchor) |
buoy = self.nadir(buoy) |
61 |
|
into = self.vs.orthoBoxCS(buoy, "V", 0, 0, 0, .5, .5, 1, 1) |
62 |
|
otherNode.renderBuoy(self.vs, into, linkId, otherAnchor) |
63 |
|
|
64 |
def key(self, key): |
def key(self, key): |
65 |
|
gzz.client.AbstractUpdateManager.chg() |
66 |
pass |
pass |