/[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.14 by tjl, Thu Oct 3 17:19:19 2002 UTC revision 1.15 by tjl, Thu Oct 3 17:30:09 2002 UTC
# Line 39  def getFont(): Line 39  def getFont():
39          font = GL.createFont("gfx/fonts/a010013l.pfb", 16);          font = GL.createFont("gfx/fonts/a010013l.pfb", 16);
40      return font      return font
41    
 globalspan = None  
   
42  # Paper coordinates of current focus  # Paper coordinates of current focus
43  globalx = 0  globalx = 0
44  globaly = 0  globaly = 0
# Line 108  class XuPDFBuoy: Line 106  class XuPDFBuoy:
106      def add(self, vs, importance, floater,      def add(self, vs, importance, floater,
107                          maincs, globalview = None,                          maincs, globalview = None,
108                          globalusefancypaper = 0,                          globalusefancypaper = 0,
109                          globalshowtessel = 0):                          globalshowtessel = 0,
110                            globalspan = None):
111          if not self.cell:          if not self.cell:
112              return              return
113          cell = self.cell          cell = self.cell
# Line 126  class XuPDFBuoy: Line 125  class XuPDFBuoy:
125    
126          main_end_cs = vs.coords.coordsys(maincs, -20, mainpoint[0], mainpoint[1], 0, 0)          main_end_cs = vs.coords.coordsys(maincs, -20, mainpoint[0], mainpoint[1], 0, 0)
127    
128          cs1 = floater.addBuoy(mainpoint[0], mainpoint[1],          src = array([mainpoint[0], mainpoint[1], 0], 'f')
129            dst = zeros(3, 'f')
130            vs.coords.transformPoints3(maincs, src, dst)
131    
132            cs1 = floater.addBuoy(dst[0], dst[1],
133                  importance, self.cell.getId(), 0, 0)                  importance, self.cell.getId(), 0, 0)
134    
135    
# Line 205  class XuPDFScene_PDFContext: Line 208  class XuPDFScene_PDFContext:
208          self.win = win          self.win = win
209          self.modes = [          self.modes = [
210                  Mode(                  Mode(
211                      mag=(screensize[1]*1.6,screensize[1]/10),                      mag=(screensize[1]*1.6,screensize[1]/40),
212                      context=1,                      context=1,
213                      movefocus=0,                      movefocus=0,
214                      eye = 0.2,                      eye = 0.2,
# Line 227  class XuPDFScene_PDFContext: Line 230  class XuPDFScene_PDFContext:
230          self.ctrx = screensize[0]/2          self.ctrx = screensize[0]/2
231          self.ctry = screensize[1]/2          self.ctry = screensize[1]/2
232    
233          self.rad = screensize[1] /  2          self.rad = screensize[0] /  2
234    
235          self.nadir = NadirAngler(self.ctrx, screensize[1]*2)          self.nadir = NadirAngler(self.ctrx, screensize[1]*2)
236          self.clip = 0          self.clip = 0
# Line 301  class XuPDFScene_PDFContext: Line 304  class XuPDFScene_PDFContext:
304                  y = int(min(c1[2], c2[2]))                  y = int(min(c1[2], c2[2]))
305                  h = int(max(c1[2], c2[2]) - y)                  h = int(max(c1[2], c2[2]) - y)
306                  print "Area:", (page, page+1, x, y, w, h)                  print "Area:", (page, page+1, x, y, w, h)
307                  span = globalspan.subArea(page, page+1, x, y, w, h)                  span = self.span.subArea(page, page+1, x, y, w, h)
308              else:              else:
309                  p0 = min(c1[0], c2[0])                  p0 = min(c1[0], c2[0])
310                  p1 = max(c1[0], c2[0])                  p1 = max(c1[0], c2[0])
311                  span = globalspan.subSpan(p0, p1+1)                  span = self.span.subSpan(p0, p1+1)
312                                    
313              print "Marking span: %s" % (span,)              print "Marking span: %s" % (span,)
314                                    
# Line 383  class XuPDFScene_PDFContext: Line 386  class XuPDFScene_PDFContext:
386    
387      def moveToCell(self, cell, nx=1, ny=1, redraw=1):      def moveToCell(self, cell, nx=1, ny=1, redraw=1):
388          global globalx, globaly          global globalx, globaly
389          global globalforw, globalback, globalspan          global globalforw, globalback
390    
391          # Check type          # Check type
392          if 1: # PDF          if 1: # PDF
# Line 393  class XuPDFScene_PDFContext: Line 396  class XuPDFScene_PDFContext:
396          globalx, globaly = nx, ny          globalx, globaly = nx, ny
397    
398          content = cell.space.cellTexter.getEnfilade(cell, None)          content = cell.space.cellTexter.getEnfilade(cell, None)
399          globalspan = enf2span(content)          self.span = enf2span(content)
400          xuindexer = gzz.index.IndexManager.getXuIndexer(self.linkspace)          xuindexer = gzz.index.IndexManager.getXuIndexer(self.linkspace)
401          globalforw = xuindexer.getForwardIndex().getMatches(content)          globalforw = xuindexer.getForwardIndex().getMatches(content)
402          globalback = xuindexer.getBackwardIndex().getMatches(content)          globalback = xuindexer.getBackwardIndex().getMatches(content)
# Line 451  class XuPDFScene_PDFContext: Line 454  class XuPDFScene_PDFContext:
454              clip = (-0.2+globalx, -0.2+globaly, 0.2+globalx, 0.2+globaly)              clip = (-0.2+globalx, -0.2+globaly, 0.2+globalx, 0.2+globaly)
455              self.cliprect = clip              self.cliprect = clip
456          else:          else:
457              w = self.view.papersize[0]              w = self.view.scaledsize[0]
458              extrax = 0.1              extrax = 0.1
459              extray = 0.1              extray = 0.1
460              clip = (0-extrax, -extray, w+extrax, 1+extray)              clip = (0-extrax, -extray, w+extrax, 1+extray)
# Line 472  class XuPDFScene_PDFContext: Line 475  class XuPDFScene_PDFContext:
475                  b.add(vs, 1, bfforw, maincs = cs1_trans,                  b.add(vs, 1, bfforw, maincs = cs1_trans,
476                          globalview = self.view,                          globalview = self.view,
477                          globalusefancypaper = self.usefancypaper,                          globalusefancypaper = self.usefancypaper,
478                          globalshowtessel = self.showtessel)                          globalshowtessel = self.showtessel,
479                            globalspan = self.span)
480                  self.buoys.append(b)                  self.buoys.append(b)
481              for backlink in globalback:              for backlink in globalback:
482                  b = XuPDFBuoy(0,(getattr(backlink,"from"), backlink.to),                  b = XuPDFBuoy(0,(getattr(backlink,"from"), backlink.to),
# Line 480  class XuPDFScene_PDFContext: Line 484  class XuPDFScene_PDFContext:
484                  b.add(vs, 1, bf, maincs = cs1_trans,                  b.add(vs, 1, bf, maincs = cs1_trans,
485                          globalview = self.view,                          globalview = self.view,
486                          globalusefancypaper = self.usefancypaper,                          globalusefancypaper = self.usefancypaper,
487                          globalshowtessel = self.showtessel)                          globalshowtessel = self.showtessel,
488                            globalspan = self.span)
489                  self.buoys.append(b)                  self.buoys.append(b)
490          self.currentvs = vs          self.currentvs = vs
491          self.selectCS = None          self.selectCS = None

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

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