/[gzz]/gzz/gzz/view/buoy/buoymanager.py
ViewVC logotype

Diff of /gzz/gzz/view/buoy/buoymanager.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by tjl, Thu Feb 6 12:14:29 2003 UTC revision 1.10 by tjl, Thu Feb 6 12:28:00 2003 UTC
# Line 36  class RealBuoyManager(BuoyLinkListener): Line 36  class RealBuoyManager(BuoyLinkListener):
36          self.vs = vs          self.vs = vs
37          self.cs = { }          self.cs = { }
38    
39          self.nadirCS = vs.translateCS(0, "NADIRORIGIN", 400, 1500)          self.ctrx = vs.size.width / 2
40            self.ctry = vs.size.height / 7 * 3
41    
42            mainsize = vs.size.width * .5
43    
44            self.nadirCS = vs.translateCS(0, "NADIRORIGIN", self.ctrx,
45                        1.5 * vs.size.height)
46    
47          vs.put(background((.5,.8,.5)))          vs.put(background((.5,.8,.5)))
48    
49          center = vs.translateCS(0, "Center", 400, 300)          center = vs.translateCS(0, "Center", self.ctrx, self.ctry)
50    
51          main = vs.orthoBoxCS(center, "MAINVP", 0,          main = vs.orthoBoxCS(center, "MAINVP", 0,
52                                  -100, -100, .2, .2, 1000, 1000)                                  -mainsize/2, -mainsize/2, 1, 1, mainsize, mainsize)
53          self.vs.activate(main)          self.vs.activate(main)
54    
55          self.mainNode.renderMain(vs, self.nadir(main))          self.mainNode.renderMain(vs, self.nadir(main))
# Line 51  class RealBuoyManager(BuoyLinkListener): Line 57  class RealBuoyManager(BuoyLinkListener):
57    
58    
59      def link(self, direction, anchorCS, otherNode, linkId, otherAnchor):      def link(self, direction, anchorCS, otherNode, linkId, otherAnchor):
60          x = 400          x = self.ctrx
61          r = 200          r = self.ctrx * .75
62          if dir > 0:          if dir > 0:
63              buoy = self.vs.coords.buoyOnCircle(0, anchorCS,              buoy = self.vs.coords.buoyOnCircle(0, anchorCS,
64                                  x, 300, r,                                  x, self.ctry, r,
65                                  x-r, 300,                                  x-r, self.ctry,
66                                  0.1)                                  0.1)
67          else:          else:
68              buoy = self.vs.coords.buoyOnCircle(0, anchorCS,              buoy = self.vs.coords.buoyOnCircle(0, anchorCS,
69                                  x, 300, r,                                  x, self.ctry, r,
70                                  x+r, 300,                                  x+r, self.ctry,
71                                  0.1)                                  0.1)
72          self.vs.matcher.add(buoy, linkId)          self.vs.matcher.add(buoy, linkId)
73          into = self.vs.orthoBoxCS(buoy, "V", 0, 0, 0, .5, .5, 150, 150)          into = self.vs.orthoBoxCS(buoy, "V", -100, 0, 0, .5, .5, 150, 150)
74          into = self.nadir(into)          into = self.nadir(into)
75          self.vs.activate(into)          self.vs.activate(into)
76          self.cs[into] = (otherNode, linkId, otherAnchor)          self.cs[into] = (otherNode, linkId, otherAnchor)

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26