/[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.23 by tjl, Fri Oct 4 06:54:11 2002 UTC revision 1.24 by tjl, Sat Oct 19 14:28:06 2002 UTC
# Line 74  def bg(vs): Line 74  def bg(vs):
74          End          End
75          Enable TEXTURE_2D          Enable TEXTURE_2D
76      """ % { "w": screensize[0], "h": screensize[1] } ) )      """ % { "w": screensize[0], "h": screensize[1] } ) )
77      fps = vs.coords.coordsys(0, 10, 10, 20, 1.5, 1.5)      fps = vs.coords.ortho(0, 10, 10, 20, 1.5, 1.5)
78      vs.matcher.add(fps, "FPS")      vs.matcher.add(fps, "FPS")
79      vs.map.put(fps_text, fps, 0)      vs.map.put(fps_text, fps, 0)
80            
# Line 100  DEFAULT_TEXT_WIDTH = 200 Line 100  DEFAULT_TEXT_WIDTH = 200
100  def puttext(cell, vs, cs, scale):  def puttext(cell, vs, cs, scale):
101      w = DEFAULT_TEXT_WIDTH * scale      w = DEFAULT_TEXT_WIDTH * scale
102      h = contview.getHeight(cell, w, scale)      h = contview.getHeight(cell, w, scale)
103      cs_t = vs.coords.translateXY(cs, -w/2.0, -h/2.0)      cs_t = vs.coords.translate(cs, -w/2.0, -h/2.0)
104      vs.matcher.add(cs, cell.getId()+"__text")      vs.matcher.add(cs, cell.getId()+"__text")
105      cellview.place(cell, vs, cs_t, w, h, emptyContext, scale)      cellview.place(cell, vs, cs_t, w, h, emptyContext, scale)
106    
# Line 164  class XuPDFBuoy: Line 164  class XuPDFBuoy:
164          else:          else:
165              mainpoint = (0, 0)              mainpoint = (0, 0)
166                            
167          main_end_cs = vs.coords.coordsys(maincs, -20, mainpoint[0], mainpoint[1], 0, 0)          main_end_cs = vs.coords.ortho(maincs, -20, mainpoint[0], mainpoint[1], 0, 0)
168    
169          src = array([mainpoint[0], mainpoint[1], 0], 'f')          cs1 = floater.buoyCoordsys(main_end_cs, self.cell.getId())
         dst = zeros(3, 'f')  
         vs.coords.transformPoints3(maincs, src, dst)  
   
         cs1 = floater.addBuoy(dst[0], dst[1],  
                 importance, self.cell.getId(), 0, 0)  
170    
171    
172          # Then, make the buoy coordsys          # Then, make the buoy coordsys
# Line 183  class XuPDFBuoy: Line 178  class XuPDFBuoy:
178              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)
179              vs.matcher.add(cs1_zoom, cell.getId()+"__bulg")              vs.matcher.add(cs1_zoom, cell.getId()+"__bulg")
180    
181              cs1_trans = vs.coords.translateXY(cs1_zoom, -self.pctr[0], -self.pctr[1])              cs1_trans = vs.coords.translate(cs1_zoom, -self.pctr[0], -self.pctr[1])
182              # cs1_trans = vs.coords.translateXY(cs1_zoom, 0, 0)              # cs1_trans = vs.coords.translate(cs1_zoom, 0, 0)
183              vs.matcher.add(cs1_trans, cell.getId()+"__trans")              vs.matcher.add(cs1_trans, cell.getId()+"__trans")
184    
185              self.cliprect = (self.p0[0], self.p0[1], self.p1[0], self.p1[1])              self.cliprect = (self.p0[0], self.p0[1], self.p1[0], self.p1[1])
# Line 194  class XuPDFBuoy: Line 189  class XuPDFBuoy:
189    
190              # Then, the xu link connector              # Then, the xu link connector
191    
192              link_end_cs = vs.coords.coordsys(cs1_trans, -20, self.pctr[0], self.pctr[1], 0, 0)              link_end_cs = vs.coords.ortho(cs1_trans, -20, self.pctr[0], self.pctr[1], 0, 0)
193                            
194          else:          else:
195              puttext(cell, vs, cs1, 1.2)              puttext(cell, vs, cs1, 1.2)
196                            
197              link_end_cs = vs.coords.coordsys(cs1, -20, 0, 0, 0, 0)              link_end_cs = vs.coords.ortho(cs1, -20, 0, 0, 0, 0)
198    
199          vs.matcher.add(main_end_cs, "link"+str(self.link)+str(self.linkindex))          vs.matcher.add(main_end_cs, "link"+str(self.link)+str(self.linkindex))
200          vs.matcher.add(link_end_cs, "link"+str(self.link)+str(1-self.linkindex))          vs.matcher.add(link_end_cs, "link"+str(self.link)+str(1-self.linkindex))
# Line 279  class XuPDFScene_PDFContext: Line 274  class XuPDFScene_PDFContext:
274          self.ctrx = screensize[0]/2          self.ctrx = screensize[0]/2
275          self.ctry = screensize[1]/2          self.ctry = screensize[1]/2
276    
277          self.rad = screensize[0] * 5/11            self.rad = screensize[0] * 5/12  
278    
279          self.nadir = NadirAngler(self.ctrx, screensize[1]*2)          self.nadir = NadirAngler(self.ctrx, screensize[1]*2)
280          self.clip = 0          self.clip = 0
# Line 497  class XuPDFScene_PDFContext: Line 492  class XuPDFScene_PDFContext:
492          #                   self.rad, projx, self.ctry, 0)          #                   self.rad, projx, self.ctry, 0)
493          # vs.matcher.add(cs1, self.cursor.getId()+"__buo")          # vs.matcher.add(cs1, self.cursor.getId()+"__buo")
494    
495          projdist = 1.5*self.rad          projdist = self.rad
496    
497          bf = effects.NadirCircleFloater(vs, (self.ctrx, self.ctry),          bf = effects.CircleFloater4(vs, 0, (self.ctrx, self.ctry),
498              self.rad, (self.ctrx - projdist, self.ctry), self.nadir)              self.rad, (self.ctrx - projdist, self.ctry))
499          bfforw = effects.NadirCircleFloater(vs, (self.ctrx, self.ctry),          bfforw = effects.CircleFloater4(vs, 0, (self.ctrx, self.ctry),
500              self.rad, (self.ctrx + projdist, self.ctry), self.nadir)              self.rad, (self.ctrx + projdist, self.ctry))
501    
502    
503          cs1 = bf.addCentralBuoy(self.cursor.getId())          cs1 = bf.addCentralBuoy(self.cursor.getId())
# Line 521  class XuPDFScene_PDFContext: Line 516  class XuPDFScene_PDFContext:
516              eye, eye, *(self.modes[0].mag))              eye, eye, *(self.modes[0].mag))
517          vs.matcher.add(cs1_zoom, self.cursor.getId()+"__bulg")          vs.matcher.add(cs1_zoom, self.cursor.getId()+"__bulg")
518    
519          cs1_trans = vs.coords.translateXY(cs1_zoom,          cs1_trans = vs.coords.translate(cs1_zoom,
520                  -globalx, -globaly + focusy_at)                  -globalx, -globaly + focusy_at)
521          vs.matcher.add(cs1_trans, self.cursor.getId()+"__trans")          vs.matcher.add(cs1_trans, self.cursor.getId()+"__trans")
522    

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

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