/[gzz]/gzz/gzz/view/xubuoy.py
ViewVC logotype

Diff of /gzz/gzz/view/xubuoy.py

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

revision 1.9 by benja, Thu Oct 3 12:00:53 2002 UTC revision 1.10 by tjl, Thu Oct 3 12:12:53 2002 UTC
# Line 105  class XuPDFBuoy: Line 105  class XuPDFBuoy:
105          self.eye = 0.2          self.eye = 0.2
106          self.buoyscale = 400          self.buoyscale = 400
107    
108      def add(self, vs, anchorX, anchorY, importance, floater,      def add(self, vs, anchorX, anchorY, importance, buoyparams,
109                          maincs = None, globalview = None,                          maincs, globalview = None,
110                          globalusefancypaper = 0,                          globalusefancypaper = 0,
111                          globalshowtessel = 0):                          globalshowtessel = 0):
112          if not self.cell:          if not self.cell:
113              return              return
114          cell = self.cell          cell = self.cell
115    
116          cs1 = floater.addBuoy(anchorX, anchorY, importance, self.cell.getId(), 0, 0)          # Make a coordinate system at the anchor point.
117            # this is the parent coordsys of the buoy
118            mainlinkspan = self.link[1-self.linkindex].getList()[0]
119            # XXX if cell not everything...
120            mainpage = mainlinkspan.offset() - globalspan.offset()
121            mainp = mainlinkspan.getLocation()
122            mainoffsp = globalspan.getLocation()
123            maind = mainlinkspan.getSize()
124            mainpoint = globalview.paperpoint(mainpage,  mainp.x-mainoffsp.x+0.5*maind.width,
125                                                        mainp.y-mainoffsp.y+0.5*maind.height)
126    
127            main_end_cs = vs.coords.coordsys(maincs, -20, mainpoint[0], mainpoint[1], 0, 0)
128    
129            # Then, make the buoy coordsys
130    
131            cs1 = vs.coords.buoyOnCircle(main_end_cs, *buoyparams)
132            vs.matcher.add(cs1, cell.getId()+"__buo")
133    
134          cs1_zoom= vs.coords.distort(cs1, 0, 0, self.eye, self.eye, self.buoyscale, self.buoyscale)          cs1_zoom= vs.coords.distort(cs1, 0, 0, self.eye, self.eye, self.buoyscale, self.buoyscale)
135          vs.matcher.add(cs1_zoom, cell.getId()+"__bulg")          vs.matcher.add(cs1_zoom, cell.getId()+"__bulg")
136    
# Line 127  class XuPDFBuoy: Line 144  class XuPDFBuoy:
144                  fancy = globalusefancypaper, showTessel = globalshowtessel)                  fancy = globalusefancypaper, showTessel = globalshowtessel)
145    
146          # Then, the xu link connector          # Then, the xu link connector
147          if maincs != None:  
148              mainlinkspan = self.link[1-self.linkindex].getList()[0]          link_end_cs = vs.coords.coordsys(cs1_trans, -20, self.pctr[0], self.pctr[1], 0, 0)
149              # XXX if cell not everything...  
150              mainpage = mainlinkspan.offset() - globalspan.offset()          vs.matcher.add(main_end_cs, "link"+str(self.link)+str(self.linkindex))
151              mainp = mainlinkspan.getLocation()          vs.matcher.add(link_end_cs, "link"+str(self.link)+str(1-self.linkindex))
152              mainoffsp = globalspan.getLocation()  
153              maind = mainlinkspan.getSize()          print "lineconn!"
154              mainpoint = globalview.paperpoint(mainpage,  mainp.x-mainoffsp.x+0.5*maind.width,          vs.map.put(GLCache.getCallList("""
155                                                          mainp.y-mainoffsp.y+0.5*maind.height)              PushAttrib ENABLE_BIT
156                Disable TEXTURE_2D
157              main_end_cs = vs.coords.coordsys(maincs, -20, mainpoint[0], mainpoint[1], 0, 0)              LineWidth 5
158                Enable BLEND
159              link_end_cs = vs.coords.coordsys(cs1_trans, -20, self.pctr[0], self.pctr[1], 0, 0)              Color 0 0 0 0.6
160            """))
161              vs.matcher.add(main_end_cs, "link"+str(self.link)+str(self.linkindex))          vs.map.put(lineconn, main_end_cs, link_end_cs)
162              vs.matcher.add(link_end_cs, "link"+str(self.link)+str(1-self.linkindex))          vs.map.put(GLCache.getCallList("""
163                PopAttrib
164              print "lineconn!"          """))
             vs.map.put(GLCache.getCallList("""  
                 PushAttrib ENABLE_BIT  
                 Disable TEXTURE_2D  
                 LineWidth 5  
                 Enable BLEND  
                 Color 0 0 0 0.6  
             """))  
             vs.map.put(lineconn, main_end_cs, link_end_cs)  
             vs.map.put(GLCache.getCallList("""  
                 PopAttrib  
             """))  
165    
166      def hit(self, coords, point3):      def hit(self, coords, point3):
167          return self.view.hitClip(coords, point3, self.cliprect)          return self.view.hitClip(coords, point3, self.cliprect)
# Line 210  class XuPDFScene_PDFContext: Line 216  class XuPDFScene_PDFContext:
216    
217          self.ctrx = screensize[0]/2          self.ctrx = screensize[0]/2
218          self.ctry = screensize[1]/2          self.ctry = screensize[1]/2
219          self.rad = screensize[1]/2  
220            self.rad = screensize[1] /  2
221    
222          self.nadir = NadirAngler(self.ctrx, screensize[1]*2)          self.nadir = NadirAngler(self.ctrx, screensize[1]*2)
223          self.clip = 0          self.clip = 0
224          self.selectCS = None          self.selectCS = None
# Line 325  class XuPDFScene_PDFContext: Line 333  class XuPDFScene_PDFContext:
333    
334      def scene(self, vs):      def scene(self, vs):
335          bg(vs)          bg(vs)
336          bf = effects.NadirCircleFloater_NoAnchor(vs, (self.ctrx, self.ctry), self.rad,  
337                          self.nadir, 1)          fbuoyparams = (self.ctrx, self.ctry, self.rad,
338          bfforw = effects.NadirCircleFloater_NoAnchor(vs, (self.ctrx, self.ctry), self.rad,                                  self.ctrx + 1.5*self.rad, self.ctry)
339                          self.nadir, -1)          bbuoyparams = (self.ctrx, self.ctry, self.rad,
340                                    self.ctrx - 1.5*self.rad, self.ctry)
341    
342          print "Context"          print "Context"
343    
344          cs1 = bf.addCentralBuoy(self.cursor.getId())          cs1 = vs.coords.translateXYZ(0, self.ctrx, self.ctry, 100)
345            vs.matcher.add(cs1, self.cursor.getId()+"__FOO")
346    
347    
348          if self.modes[0].movefocus:          if self.modes[0].movefocus:
# Line 373  class XuPDFScene_PDFContext: Line 384  class XuPDFScene_PDFContext:
384              for forwlink in globalforw:              for forwlink in globalforw:
385                  b = XuPDFBuoy(1, (getattr(forwlink, "from"), forwlink.to),                  b = XuPDFBuoy(1, (getattr(forwlink, "from"), forwlink.to),
386                          enfoverlap = enfoverlap)                          enfoverlap = enfoverlap)
387                  b.add(vs, 0, 0, 1, bfforw, maincs = cs1_trans,                  b.add(vs, 0, 0, 1, fbuoyparams, maincs = cs1_trans,
388                          globalview = self.view,                          globalview = self.view,
389                          globalusefancypaper = self.usefancypaper,                          globalusefancypaper = self.usefancypaper,
390                          globalshowtessel = self.showtessel)                          globalshowtessel = self.showtessel)
# Line 381  class XuPDFScene_PDFContext: Line 392  class XuPDFScene_PDFContext:
392              for backlink in globalback:              for backlink in globalback:
393                  b = XuPDFBuoy(0,(getattr(backlink,"from"), backlink.to),                  b = XuPDFBuoy(0,(getattr(backlink,"from"), backlink.to),
394                          enfoverlap = enfoverlap)                          enfoverlap = enfoverlap)
395                  b.add(vs, 0, 0, 1, bf, maincs = cs1_trans,                  b.add(vs, 0, 0, 1, bbuoyparams, maincs = cs1_trans,
396                          globalview = self.view,                          globalview = self.view,
397                          globalusefancypaper = self.usefancypaper,                          globalusefancypaper = self.usefancypaper,
398                          globalshowtessel = self.showtessel)                          globalshowtessel = self.showtessel)

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