gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz ./TODO gfx/Makefile gfx/rules.mk gfx/demo/f...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz ./TODO gfx/Makefile gfx/rules.mk gfx/demo/f...
Date: Mon, 30 Sep 2002 04:15:42 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        02/09/30 04:15:42

Modified files:
        .              : TODO 
        gfx            : Makefile rules.mk 
        gfx/demo       : fillets.py xupdf.py 
        gfx/libcoords  : Coords.cxx Coords.hxx 
        gfx/libfisheye : Fisheye.hxx 
        gfx/librenderables: renderables.py 
        gfx/libutil    : effects.py 
        gzz/gfx/gl     : Stencil.java 
        gzz/view       : pagespanview.py 

Log message:
        Many improvements, dress rehearsal now done.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/TODO.diff?tr1=1.193&tr2=1.194&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/Makefile.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/rules.mk.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/fillets.py.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/xupdf.py.diff?tr1=1.32&tr2=1.33&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcoords/Coords.cxx.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcoords/Coords.hxx.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libfisheye/Fisheye.hxx.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/renderables.py.diff?tr1=1.84&tr2=1.85&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libutil/effects.py.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/gfx/gl/Stencil.java.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/pagespanview.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: gzz/TODO
diff -c gzz/TODO:1.193 gzz/TODO:1.194
*** gzz/TODO:1.193      Sun Sep 29 13:34:54 2002
--- gzz/TODO    Mon Sep 30 04:15:42 2002
***************
*** 61,96 ****
              paper position.
      tjl:
        - xupdf: distorted multi-page PDF view with xu links
            - frame rate ~= 25
-               - frame rate counter
                - clippedPaperQuad (leave unrendered if outside cs3)
-                   - paperquad texture binding LOD?
-               - make nonlinearity() really work right for
-                 distorted coord sys and affine coordsys on top
-                 of it.
-                 Check by setting polygonmode to lines in xupdf
-                 (by a key) and seeing that the non-distorted
-                 polygons are diced less. 
-                   -cxxtest tests
-                       - a general test which tests that a 
-                         CoordSys implementation
-                         and its inverse match up (enabled 
-                           for most coordsys).
-                       - tests for the hierarchy working correctly
-                   - make sure that small pieces are diced more!!!! 
-           - text
-           - entry / link making bindings
-               - paint part of page
-                   - &invcoords: implement DistortCoords::createInverse(). 
-                     This is not easy, and
-                     it IS allowable to use numeric approximation 
-                     for root-finding.  Make sure you abstract 
-                     this into libdistort properly
-                     (inverse should be in the functions themselves)
-                       - needed for mouse click positioning 
-                         in distorted cs.
-           - larger structure
-           - clean up the xupdf.py file
        + script the demo, determine in detail all features
          required. [ almost done ]
            - making a connection
--- 61,70 ----
              paper position.
      tjl:
        - xupdf: distorted multi-page PDF view with xu links
+           - proper buoy placement
+               - VobCoorder.transform
            - frame rate ~= 25
                - clippedPaperQuad (leave unrendered if outside cs3)
        + script the demo, determine in detail all features
          required. [ almost done ]
            - making a connection
***************
*** 114,138 ****
          number of passes as much. However, this brings
          caching problems.
      tjl:
        - think about how to combine client and xupdf
            - just keep abstracting out parts of xupdf and finally
              make them usable from Java.
        - renderable3
!       - distorted multi-page PDF view with xu links
!           - texture performance, look at imagecache
!               - need to create lower-resolution versions since
!                 BASE_LEVEL doesn't quite suffice
!                   - basic code is there, think about this further
!                     when we have a larger structure where this is a problem.
            - mouse clicks on buoys to work
            - better distortion
                - better function
                - adjustable zoom / area by mouse
-           - limit mousing area to the real area of the paper.
- 
-           - source coordinates for xu links
-               - python or java routines to compute distorted coordinates,
- 
            - multiple instances of same pdf / text visible? --> keys?
  
        + fillet implementation handling all connections from a node
--- 88,125 ----
          number of passes as much. However, this brings
          caching problems.
      tjl:
+       - fix fillet demo
        - think about how to combine client and xupdf
            - just keep abstracting out parts of xupdf and finally
              make them usable from Java.
        - renderable3
!       - xupdf
!           - better graphics for xu links
!           - entry / link making bindings
!               - paint part of page
!                   - &invcoords: implement DistortCoords::createInverse(). 
!                     This is not easy, and
!                     it IS allowable to use numeric approximation 
!                     for root-finding.  Make sure you abstract 
!                     this into libdistort properly
!                     (inverse should be in the functions themselves)
!                       - needed for mouse click positioning 
!                         in distorted cs.
!                       -cxxtest tests
!                           - a general test which tests that a 
!                             CoordSys implementation
!                             and its inverse match up (enabled 
!                               for most coordsys).
!                           - tests for the hierarchy working correctly
!           - larger structure
!           - clean up the xupdf.py file
!           - text
!           - frame rate ~= 25
!               - paperquad texture binding LOD?
            - mouse clicks on buoys to work
            - better distortion
                - better function
                - adjustable zoom / area by mouse
            - multiple instances of same pdf / text visible? --> keys?
  
        + fillet implementation handling all connections from a node
***************
*** 158,164 ****
            - note however that we DO want square texels;
              ask Tjl for explanation
  
! 0.8alpha4: Cleanup release after crucial demos for continued funding
      humppake:
        - fix utf8 string non-null end bug found by Benja
      deetsay:
--- 145,152 ----
            - note however that we DO want square texels;
              ask Tjl for explanation
  
! 0.8alpha4: Cleanup release after crucial demos; make it possible for anyone to
!           get *THE* demo up and running
      humppake:
        - fix utf8 string non-null end bug found by Benja
      deetsay:
Index: gzz/gfx/Makefile
diff -c gzz/gfx/Makefile:1.12 gzz/gfx/Makefile:1.13
*** gzz/gfx/Makefile:1.12       Wed Sep 25 11:58:44 2002
--- gzz/gfx/Makefile    Mon Sep 30 04:15:42 2002
***************
*** 12,18 ****
  
  
  
- 
  all: subdirs libGZZGL.so 
  
  subdirs:
--- 12,17 ----
Index: gzz/gfx/demo/fillets.py
diff -c gzz/gfx/demo/fillets.py:1.4 gzz/gfx/demo/fillets.py:1.5
*** gzz/gfx/demo/fillets.py:1.4 Mon Sep 23 04:37:04 2002
--- gzz/gfx/demo/fillets.py     Mon Sep 30 04:15:42 2002
***************
*** 498,509 ****
            ( d.width / 4.0 * (dx*0.7 + 2) + yshift(y),
                d.height / 4.0 * (y) )
            for y in (2-dy,2,2+dy)]
!       cs = [
!           (vs.coords.coordsys(str(dx)+str(ctr[1]), 20, 
!                   ctr[0]-w/2, ctr[1]-h/2,
!                       w, h),
!            ctr)
!               for ctr in ctrs]
        for c in cs:
            vs.map.put(self.cells[0][self.ind], c[0])
            vs.map.put(self.cells[1][self.ind], c[0])
--- 498,508 ----
            ( d.width / 4.0 * (dx*0.7 + 2) + yshift(y),
                d.height / 4.0 * (y) )
            for y in (2-dy,2,2+dy)]
!       cs = []
!       for ctr in ctrs:
!           coordsys = vs.coords.coordsys(0, 20, ctr[0]-w/2, ctr[1]-h/2, w, h)
!           vs.matcher.add(coordsys, str(dx)+str(ctr[1]))
!           cs.append((coordsys, ctr))
        for c in cs:
            vs.map.put(self.cells[0][self.ind], c[0])
            vs.map.put(self.cells[1][self.ind], c[0])
Index: gzz/gfx/demo/xupdf.py
diff -c gzz/gfx/demo/xupdf.py:1.32 gzz/gfx/demo/xupdf.py:1.33
*** gzz/gfx/demo/xupdf.py:1.32  Sun Sep 29 12:26:45 2002
--- gzz/gfx/demo/xupdf.py       Mon Sep 30 04:15:42 2002
***************
*** 6,11 ****
--- 6,12 ----
  from gzz.view import pagespanview
  from gfx.libutil import effects
  reload(pagespanview)
+ reload(effects)
  
  # Now, this is the start of the REAL demo, the one
  # with Xanadu links between PDF and text.
***************
*** 49,54 ****
--- 50,58 ----
  home = space.getHomeCell()
  
  pagespans = [s.getCurrent() for s in pagescrolls]
+ # XXX
+ # pagespans = [s.getCurrent().subSpan(0,5) for s in pagescrolls]
+ 
  pages = [enfMaker.makeEnfilade(sp) for sp in pagespans]
  
  
***************
*** 69,74 ****
--- 73,79 ----
      cells.append(cell)
  
  globalcursor = None
+ globalspan = None
  
  # Paper coordinates of current focus
  globalx = 0
***************
*** 76,81 ****
--- 81,88 ----
  
  globalusefancypaper = 1
  
+ globalshowtessel = 0
+ 
  globalcurlinks = {}
  
  
***************
*** 100,111 ****
  
  def moveToCell(cell, nx=1, ny=1):
      global globalcursor, globalx, globaly, globalcurlinks, globalview
!     global globalforw, globalback
  
      # Check type
      if 1: # PDF
        globalview = getCellPDFView(cell)
  
      linktaken = globalcurlinks.get(cell.getId(), None)
      if linktaken:
        (nx, ny) = takeLink(linktaken, cell)
--- 107,119 ----
  
  def moveToCell(cell, nx=1, ny=1):
      global globalcursor, globalx, globaly, globalcurlinks, globalview
!     global globalforw, globalback, globalspan
  
      # Check type
      if 1: # PDF
        globalview = getCellPDFView(cell)
  
+ 
      linktaken = globalcurlinks.get(cell.getId(), None)
      if linktaken:
        (nx, ny) = takeLink(linktaken, cell)
***************
*** 115,120 ****
--- 123,129 ----
  
  
      content = space.cellTexter.getEnfilade(cell, None)
+     globalspan = enf2span(content)
      globalforw = xuindexer.getForwardIndex().getMatches(content)
      globalback = xuindexer.getBackwardIndex().getMatches(content)
  
***************
*** 129,135 ****
  
  
  def globalkey(key):
!     global globalusefancypaper
      if '1' <= key <= '9':
        moveToCell(cells[int(key)-1])
      elif key == 'l':
--- 138,144 ----
  
  
  def globalkey(key):
!     global globalusefancypaper, globalshowtessel
      if '1' <= key <= '9':
        moveToCell(cells[int(key)-1])
      elif key == 'l':
***************
*** 144,150 ****
--- 153,170 ----
      elif key == '.':
        pagespanview.globalseedoffs += 1
        moveToCell(globalcursor)
+     elif key == 't':
+       globalshowtessel = not globalshowtessel
  
+ def checkGlobalCoords():
+     global globalx, globaly
+     if globalx < 0: globalx = 0
+     if globaly < 0: globaly = 0
+     if globalx > globalview.scaledsize[0]: globalx = globalview.scaledsize[0]
+     if globaly > globalview.scaledsize[1]: globaly = globalview.scaledsize[1]
+ 
+ fps_text = GLRen.createHorizText2(getFont(), "FOO", 1, 1, 1, 1)
+ GL.setDebugVar("JNI.fps", 1)
  # Show the intended screen size
  def bg(vs):
      putnoc(vs, background((0.3,0.5,0.4)))
***************
*** 160,170 ****
        End
        Enable TEXTURE_2D
      """ % { "w": screensize[0], "h": screensize[1] } ) )
  
! def addbuoy(vs, anchorX, anchorY, importance, floater, link):
      print "Addbuoy ",link
!     linkspan = link.getList()[0]
!     mat = enfoverlap.getMatches(link)
      l = []
      for m in mat: l.append(m)
      print l
--- 180,196 ----
        End
        Enable TEXTURE_2D
      """ % { "w": screensize[0], "h": screensize[1] } ) )
+     fps = vs.coords.coordsys(0, 10, 10, 20, 1.5, 1.5)
+     vs.matcher.add(fps, "FPS")
+     vs.map.put(fps_text, fps, 0)
+ 
+ 
+ lineconn = GLRen.createLineConnector(0,0)
  
! def addbuoy(vs, anchorX, anchorY, importance, floater, linkindex, link, 
maincs = None):
      print "Addbuoy ",link
!     linkspan = link[linkindex].getList()[0]
!     mat = enfoverlap.getMatches(link[linkindex])
      l = []
      for m in mat: l.append(m)
      print l
***************
*** 173,179 ****
      print m
      cell = m
      global globalcurlinks
!     globalcurlinks[m.getId()] = link
      view = getCellPDFView(m)
  
      p = linkspan.getLocation()
--- 199,205 ----
      print m
      cell = m
      global globalcurlinks
!     globalcurlinks[m.getId()] = link[linkindex]
      view = getCellPDFView(m)
  
      p = linkspan.getLocation()
***************
*** 187,193 ****
  
      cs1 = floater.addBuoy(anchorX, anchorY, importance, m.getId(), 0, 0)
      eye = 0.2
!     buoyscale = 200
      cs1_zoom= vs.coords.distort(cs1, 0, 0, eye, eye, buoyscale, buoyscale)
      vs.matcher.add(cs1_zoom, cell.getId()+"__bulg") 
  
--- 213,219 ----
  
      cs1 = floater.addBuoy(anchorX, anchorY, importance, m.getId(), 0, 0)
      eye = 0.2
!     buoyscale = 400
      cs1_zoom= vs.coords.distort(cs1, 0, 0, eye, eye, buoyscale, buoyscale)
      vs.matcher.add(cs1_zoom, cell.getId()+"__bulg") 
  
***************
*** 196,207 ****
      vs.matcher.add(cs1_trans, cell.getId()+"__trans") 
  
      view.placepapers(vs, cs1_trans, cliprect = (p0[0], p0[1], p1[0], p1[1]),
!           fancy = globalusefancypaper)
  
  
  class XuPDFScene_PDFContext:
      def __init__(self):
!       self.mag = [(screensize[1],20)]
        self.ctrx = screensize[0]/2
        self.ctry = screensize[1]/2
        self.rad = screensize[1]/2
--- 222,264 ----
      vs.matcher.add(cs1_trans, cell.getId()+"__trans") 
  
      view.placepapers(vs, cs1_trans, cliprect = (p0[0], p0[1], p1[0], p1[1]),
!           fancy = globalusefancypaper, showTessel = globalshowtessel)
! 
!     # Then, the xu link connector
!     if maincs != None:
!       mainlinkspan = link[1-linkindex].getList()[0]
!       # XXX if cell not everything...
!       mainpage = mainlinkspan.offset() - globalspan.offset()
!       mainp = mainlinkspan.getLocation()
!       mainoffsp = globalspan.getLocation()
!       maind = mainlinkspan.getSize()
!       mainpoint = globalview.paperpoint(mainpage,  
mainp.x-mainoffsp.x+0.5*maind.width,
!                                                   
mainp.y-mainoffsp.y+0.5*maind.height)
! 
!       main_end_cs = vs.coords.coordsys(maincs, -20, mainpoint[0], 
mainpoint[1], 0, 0)
! 
!       link_end_cs = vs.coords.coordsys(cs1_trans, -20, 0.5*(p0[0]+p1[0]), 
0.5*(p0[1]+p1[1]), 0, 0)
! 
!       vs.matcher.add(main_end_cs, "link"+str(link)+str(linkindex))
!       vs.matcher.add(link_end_cs, "link"+str(link)+str(1-linkindex))
! 
!       print "lineconn!"
!       putnoc(vs, getDListNocoords("""
!           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)
!       putnoc(vs, getDListNocoords("""
!           PopAttrib
!       """))
  
  
  class XuPDFScene_PDFContext:
      def __init__(self):
!       self.mag = [(screensize[1]*1.5,20)]
        self.ctrx = screensize[0]/2
        self.ctry = screensize[1]/2
        self.rad = screensize[1]/2
***************
*** 224,229 ****
--- 281,287 ----
            scale = 0.01
            globalx += (ev.getX() - screensize[0]/2) * scale
            globaly += (ev.getY() - screensize[1]/2)  * scale
+           checkGlobalCoords()
            print "Mouse ",globalx, globaly
            AbstractUpdateManager.chg()
      def scene(self, vs):
***************
*** 252,269 ****
            clip = (0-extrax, -extray, w+extrax, 1+extray)
  
        globalview.placepapers(vs, cs1_trans, cliprect = clip,
!               fancy = globalusefancypaper)
            
        if self.showcontext:
            for forwlink in globalforw:
!               addbuoy(vs, 0, 0, 1, bfforw, forwlink.to)
            for backlink in globalback:
!               addbuoy(vs, 0, 0, 1, bf, getattr(backlink,"from"))
  
  class XuPDFScene_PDFZoom:
      def __init__(self):
!       self.mag = [(screensize[1]/2,screensize[1]/2),(screensize[1]*2,20)]
!       self.clip = 1
      def key(self, key):
        print "Key: ",key
        global currentScene
--- 310,329 ----
            clip = (0-extrax, -extray, w+extrax, 1+extray)
  
        globalview.placepapers(vs, cs1_trans, cliprect = clip,
!               fancy = globalusefancypaper, showTessel = globalshowtessel)
            
        if self.showcontext:
            for forwlink in globalforw:
!               addbuoy(vs, 0, 0, 1, bfforw, 1, (getattr(forwlink, "from"), 
forwlink.to), 
!                                               maincs = cs1_trans)
            for backlink in globalback:
!               addbuoy(vs, 0, 0, 1, bf, 0, (getattr(backlink,"from"), 
backlink.to),
!                                               maincs = cs1_trans)
  
  class XuPDFScene_PDFZoom:
      def __init__(self):
!       self.mag = 
[(screensize[1],screensize[1]),(screensize[1]*1.6,screensize[1]/3)]
!       self.clip = 0
      def key(self, key):
        print "Key: ",key
        global currentScene
***************
*** 280,285 ****
--- 340,346 ----
            globalx += (ev.getX() - screensize[0]/2) * scale
            # self.y -= ev.getY() - screensize[1]/2
            globaly = ev.getY() * scale
+           checkGlobalCoords()
            print "Mouse ",globalx, globaly
            AbstractUpdateManager.chg()
      def scene(self, vs):
***************
*** 290,299 ****
        # cs1_zoom = vs.coords.affineCoordsys(cs1, 0, 0, 0, 
        #     100, 0, 0, 100)
        eye = 0.2
!       cs1_zoom= vs.coords.distort(cs1, 0, 0, eye, eye, 
            *(self.mag[0]))
        vs.matcher.add(cs1_zoom, globalcursor.getId()+"__bulg") 
!       cs1_trans = vs.coords.translateXY(cs1_zoom, -globalx, -globaly)
        vs.matcher.add(cs1_trans, globalcursor.getId()+"__trans") 
  
        if self.clip:
--- 351,361 ----
        # cs1_zoom = vs.coords.affineCoordsys(cs1, 0, 0, 0, 
        #     100, 0, 0, 100)
        eye = 0.2
!       yat = (globaly-0.5) * screensize[1] 
!       cs1_zoom= vs.coords.distort(cs1, 0, yat, eye, eye, 
            *(self.mag[0]))
        vs.matcher.add(cs1_zoom, globalcursor.getId()+"__bulg") 
!       cs1_trans = vs.coords.translateXY(cs1_zoom, -globalx, -globaly + yat)
        vs.matcher.add(cs1_trans, globalcursor.getId()+"__trans") 
  
        if self.clip:
***************
*** 303,312 ****
            extrax = 1
            extray = 0.3
            clip = (0-extrax, -extray, w+extrax, 1+extray)
!       globalview.placepapers(vs, cs1_trans, cliprect = clip)
!       # placepapers(vs, cs1_trans, globalpap, globalcursor.getId())
                    
  
  currentScene = XuPDFScene_PDFContext()
! moveToCell(cells[0])
  
--- 365,374 ----
            extrax = 1
            extray = 0.3
            clip = (0-extrax, -extray, w+extrax, 1+extray)
!       globalview.placepapers(vs, cs1_trans, cliprect = clip, showTessel = 
globalshowtessel,
!           fancy = globalusefancypaper)
                    
  
  currentScene = XuPDFScene_PDFContext()
! moveToCell(cells[1])
  
Index: gzz/gfx/libcoords/Coords.cxx
diff -c gzz/gfx/libcoords/Coords.cxx:1.14 gzz/gfx/libcoords/Coords.cxx:1.15
*** gzz/gfx/libcoords/Coords.cxx:1.14   Fri Sep 27 14:22:59 2002
--- gzz/gfx/libcoords/Coords.cxx        Mon Sep 30 04:15:42 2002
***************
*** 1,4 ****
--- 1,5 ----
  #include "libutil/Debug.hxx"
+ #include "libfisheye/Fisheye.hxx"
  #include "Coords.hxx"
  
  namespace Coords {
***************
*** 62,67 ****
--- 63,74 ----
              glMultMatrixf(matrix);
            return true;
          }
+       virtual float nonlinearity(const ZPt &p, float radius) { 
+           float mult = 0.5 * (fabs(params[3]) + fabs(params[6]));
+           ZPt p2;
+           tr(p, p2);
+           return mult * super->nonlinearity(p2, mult * radius);
+       }
  
      protected:
        virtual CoordSys *createInverse() {
***************
*** 163,174 ****
            ZPt p = ZPt((from.x-x) / w, (from.y-y)/ h, from.z);
            to = distort(p);
            to.x *= w; to.y *= h;
-           to.x += x; to.y += y;
            to.x *= mmin;
            to.y *= mmin;
        }
        virtual float nonlinearity(const ZPt &p, float radius) { 
!           return 10;
        }
      };
  
--- 170,184 ----
            ZPt p = ZPt((from.x-x) / w, (from.y-y)/ h, from.z);
            to = distort(p);
            to.x *= w; to.y *= h;
            to.x *= mmin;
            to.y *= mmin;
+           to.x += x; to.y += y;
        }
        virtual float nonlinearity(const ZPt &p, float radius) { 
!           float wh = 0.5*(w+h);
!           float dist = hypot((p.x-x)/w, (p.y-y)/h) - radius/wh;
!           if(dist < 0) dist = 0;
!           return 1 + 10 / (dist + 1);
        }
      };
  
Index: gzz/gfx/libcoords/Coords.hxx
diff -c gzz/gfx/libcoords/Coords.hxx:1.8 gzz/gfx/libcoords/Coords.hxx:1.9
*** gzz/gfx/libcoords/Coords.hxx:1.8    Fri Sep 27 02:34:53 2002
--- gzz/gfx/libcoords/Coords.hxx        Mon Sep 30 04:15:42 2002
***************
*** 1,5 ****
  #include <GL/gl.h>
- #include "libfisheye/Fisheye.hxx"
  
  // XXX homogeneous coordinates for helping texture coordinates
  
--- 1,4 ----
Index: gzz/gfx/libfisheye/Fisheye.hxx
diff -c gzz/gfx/libfisheye/Fisheye.hxx:1.2 gzz/gfx/libfisheye/Fisheye.hxx:1.3
*** gzz/gfx/libfisheye/Fisheye.hxx:1.2  Wed Sep 25 11:34:55 2002
--- gzz/gfx/libfisheye/Fisheye.hxx      Mon Sep 30 04:15:42 2002
***************
*** 27,39 ****
  
      //For given z, the magnification range is [ 1, 1 + z ]
      struct scalar_mag_atan {
!       scalar_mag_atan() : mag(1) { }
!       scalar_mag_atan(float mag) : mag(mag) { }
!       float mag;
        float operator()(float r2) const {
            if (r2 > 0) {
                float r = sqrt(r2);
!               return 1 + mag * atan(r) / r;
            }
            return 1;
        }
--- 27,39 ----
  
      //For given z, the magnification range is [ 1, 1 + z ]
      struct scalar_mag_atan {
!       scalar_mag_atan() : z(1) { }
!       scalar_mag_atan(float mag) : z(mag-1) { }
!       float z;
        float operator()(float r2) const {
            if (r2 > 0) {
                float r = sqrt(r2);
!               return 1 + z * atan(r) / r;
            }
            return 1;
        }
Index: gzz/gfx/librenderables/renderables.py
diff -c gzz/gfx/librenderables/renderables.py:1.84 
gzz/gfx/librenderables/renderables.py:1.85
*** gzz/gfx/librenderables/renderables.py:1.84  Sun Sep 29 12:21:11 2002
--- gzz/gfx/librenderables/renderables.py       Mon Sep 30 04:15:42 2002
***************
*** 327,336 ****
  {
      "Type" : "2",
      "Name": "PaperQuad",
!     "Data": "float x0, y0, x1, y1; Paper::Paper* paper; float scale;",
      "Params" : """
            Paper paper, float x0, float y0, float x1, float y1,
!           float scale
        """,
      "ParamCode" : """
            this->paper = paper;
--- 327,336 ----
  {
      "Type" : "2",
      "Name": "PaperQuad",
!     "Data": "float x0, y0, x1, y1; Paper::Paper* paper; float scale;float 
dicefactor;",
      "Params" : """
            Paper paper, float x0, float y0, float x1, float y1,
!           float scale, float dicefactor
        """,
      "ParamCode" : """
            this->paper = paper;
***************
*** 339,344 ****
--- 339,345 ----
            this->x1 = x1;
            this->y1 = y1;
            this->scale = scale;
+           this->dicefactor = dicefactor;
        """,
      "RenderCode" : """
            Coords &coords2inv = *coords2.getInverse();
***************
*** 380,386 ****
            double len = hypot(x1-x0, y1-y0);
            double nonl = coords1.nonlinearity(ctr, len);
            
!           int dice = (int)(len * nonl) + 2;
            DBG(dbg) << "Dice: " << dice <<"\\n";
  
            float vertices[dice][dice][5];
--- 381,387 ----
            double len = hypot(x1-x0, y1-y0);
            double nonl = coords1.nonlinearity(ctr, len);
            
!           int dice = (int)(len * nonl * dicefactor) + 2;
            DBG(dbg) << "Dice: " << dice <<"\\n";
  
            float vertices[dice][dice][5];
***************
*** 564,573 ****
  {
      "Type" : "2",
      "Name": "IrregularQuad",
!     "Data": "float x0, y0, x1, y1; float border; float freq; int mode; 
CallGLCode setup;",
      "Params" : """
            float x0, float y0, float x1, float y1,
!           float border, float ripple_period, int mode, String setupcode
        """,
      "ParamCode" : """
            this->x0 = x0;
--- 565,576 ----
  {
      "Type" : "2",
      "Name": "IrregularQuad",
!     "Data": """float x0, y0, x1, y1; float border; float freq; int mode; 
CallGLCode setup;
!               float dicefactor;""",
      "Params" : """
            float x0, float y0, float x1, float y1,
!           float border, float ripple_period, int mode, String setupcode,
!           float dicefactor
        """,
      "ParamCode" : """
            this->x0 = x0;
***************
*** 578,583 ****
--- 581,587 ----
              this->freq = 1.0 / ripple_period;
              this->mode = mode;
              setup = CallGLCode(string(setupcode.begin(), 
setupcode.end()).c_str());
+           this->dicefactor = dicefactor;
        """,
      "ExtraClass" : """
              template <class Coords>
***************
*** 674,680 ****
  
          ZPt ctr = coords2.transform(ZPt(0,0,0));
          double radius = (coords2.transform(ZPt(1,1,0)) - ZPt(0,0,0)).length();
!         double nonl = coords1.nonlinearity(ctr, radius);
  
          int diceb = (int)fabs(2 * border * sqrt(2) * nonl) + 1;
          int dicex = (int)fabs(2 * border * (1 / bx - 2) * nonl) + 1;
--- 678,684 ----
  
          ZPt ctr = coords2.transform(ZPt(0,0,0));
          double radius = (coords2.transform(ZPt(1,1,0)) - ZPt(0,0,0)).length();
!         double nonl = dicefactor * coords1.nonlinearity(ctr, radius);
  
          int diceb = (int)fabs(2 * border * sqrt(2) * nonl) + 1;
          int dicex = (int)fabs(2 * border * (1 / bx - 2) * nonl) + 1;
Index: gzz/gfx/libutil/effects.py
diff -c gzz/gfx/libutil/effects.py:1.11 gzz/gfx/libutil/effects.py:1.12
*** gzz/gfx/libutil/effects.py:1.11     Sun Sep 29 10:51:59 2002
--- gzz/gfx/libutil/effects.py  Mon Sep 30 04:15:42 2002
***************
*** 104,109 ****
--- 104,110 ----
        
  
  class IrreguFrame:
+     dicefactor = 0.8
  
      tex = GL.createTexture()
      tex.shade(128, 128, 0, 4, "RGBA", "RGBA",
***************
*** 164,169 ****
                self.combiners)
  
  
!       self.content = GLRen.createIrregularQuad(x0, y0, x1, y1, border, 
ripple, 0, code)
!       self.frame = GLRen.createIrregularQuad(x0, y0, x1, y1, border, ripple, 
1, code)
  
--- 165,170 ----
                self.combiners)
  
  
!       self.content = GLRen.createIrregularQuad(x0, y0, x1, y1, border, 
ripple, 0, code, self.dicefactor)
!       self.frame = GLRen.createIrregularQuad(x0, y0, x1, y1, border, ripple, 
1, code, self.dicefactor)
  
Index: gzz/gfx/rules.mk
diff -c gzz/gfx/rules.mk:1.6 gzz/gfx/rules.mk:1.7
*** gzz/gfx/rules.mk:1.6        Wed Sep  4 14:20:31 2002
--- gzz/gfx/rules.mk    Mon Sep 30 04:15:42 2002
***************
*** 9,19 ****
  
  JNIINC=-I${JAVAHOME}/include -I${JAVAHOME}/include/linux -I../../../lava/gfx
  
! # OPTIMIZE =  -O3 -fomit-frame-pointer -ffast-math 
! OPTIMIZE = -O0
  
  #NVIDIAH = /usr/lib/opengl/nvidia/include
  NVIDIAH = /usr/share/doc/nvidia-glx-dev/include
  
  CPPFLAGS = -I/usr/include/freetype2 -I$(NVIDIAH) $(JNIINC) `gdk-pixbuf-config 
--cflags` -I../ -I.
  CXXFLAGS = -g -Wall $(OPTIMIZE) $(CPPFLAGS)
--- 9,21 ----
  
  JNIINC=-I${JAVAHOME}/include -I${JAVAHOME}/include/linux -I../../../lava/gfx
  
! # -fomit-frame-pointer
! OPTIMIZE =  -O2 -ffast-math 
! # OPTIMIZE = -O0
  
  #NVIDIAH = /usr/lib/opengl/nvidia/include
  NVIDIAH = /usr/share/doc/nvidia-glx-dev/include
+ 
  
  CPPFLAGS = -I/usr/include/freetype2 -I$(NVIDIAH) $(JNIINC) `gdk-pixbuf-config 
--cflags` -I../ -I.
  CXXFLAGS = -g -Wall $(OPTIMIZE) $(CPPFLAGS)
Index: gzz/gzz/gfx/gl/Stencil.java
diff -c gzz/gzz/gfx/gl/Stencil.java:1.15 gzz/gzz/gfx/gl/Stencil.java:1.16
*** gzz/gzz/gfx/gl/Stencil.java:1.15    Sun Sep 29 12:26:45 2002
--- gzz/gzz/gfx/gl/Stencil.java Mon Sep 30 04:15:42 2002
***************
*** 71,76 ****
--- 71,77 ----
  " PushMatrix \n"+
  " Translate 0 0 1000 \n"+
  "    StencilFunc EQUAL 1 1\n"+
+ "    ColorMask 0 0 0 0\n"+
  "    Enable DEPTH_TEST\n"+
  "    DepthFunc ALWAYS\n"+
  "    DepthMask 1\n"
Index: gzz/gzz/view/pagespanview.py
diff -c gzz/gzz/view/pagespanview.py:1.2 gzz/gzz/view/pagespanview.py:1.3
*** gzz/gzz/view/pagespanview.py:1.2    Sun Sep 29 12:26:45 2002
--- gzz/gzz/view/pagespanview.py        Mon Sep 30 04:15:42 2002
***************
*** 10,16 ****
  # Module pagespanview
  
  globalseedoffs = 0
! globalLOD = 1
  
  
  def enf2span(enf):
--- 10,16 ----
  # Module pagespanview
  
  globalseedoffs = 0
! globalLOD = 0
  
  
  def enf2span(enf):
***************
*** 108,113 ****
--- 108,114 ----
  
  
  class CellPDFView:
+     dicefactor = 1.0
      """A view of a PDF file in a cell, spread out in space.
      """
      def __init__(self, cell):
***************
*** 125,137 ****
        self.scale = h/ph
  
        self.scaledsheetsize = (self.pap[0][1] * self.scale, self.pap[0][2] * 
self.scale)
        print "Scaledsize: ",self.scaledsheetsize
      # Height = always 1.
      # Start = always (0,0)
      def placepapers(self, vs, 
                    cs1into, onlypages=None, depth=10,
                    cliprect = None,
!                   fancy = 1):
        key = self.cell.getId()
        # The height in coords
        papers = self.pap
--- 126,140 ----
        self.scale = h/ph
  
        self.scaledsheetsize = (self.pap[0][1] * self.scale, self.pap[0][2] * 
self.scale)
+       self.scaledsize = (len(self.pap) * self.scaledsheetsize[0], 
self.scaledsheetsize[1])
        print "Scaledsize: ",self.scaledsheetsize
      # Height = always 1.
      # Start = always (0,0)
      def placepapers(self, vs, 
                    cs1into, onlypages=None, depth=10,
                    cliprect = None,
!                   fancy = 1,
!                   showTessel = 0):
        key = self.cell.getId()
        # The height in coords
        papers = self.pap
***************
*** 140,146 ****
        # print "x,y for place: ",curx, ycoord
        # print papers
        grid = 13
!       corners = (0, 0, papers[0][1], papers[0][2])
        cs2 = vs.coords.affineCoordsys(0, 0, 0, 0, 1, 0, 0, 1)
        vs.matcher.add(cs2, key+"_p2_") 
  
--- 143,149 ----
        # print "x,y for place: ",curx, ycoord
        # print papers
        grid = 13
!       corners = (0, 0, papers[0][1], papers[0][2], self.dicefactor)
        cs2 = vs.coords.affineCoordsys(0, 0, 0, 0, 1, 0, 0, 1)
        vs.matcher.add(cs2, key+"_p2_") 
  
***************
*** 181,193 ****
                    vs.map.put(self.white)
                    vs.map.put(self.irregu.content, cs1into, irr)
  
!           if 0:
                vs.map.put(GLCache.getCallList("""
                    PolygonMode FRONT_AND_BACK LINE
                """))
                ContentR().run()
! 
!           if 1:
                Stencil.drawStenciled(vs,
                    ContentR(),
                    None,
--- 184,202 ----
                    vs.map.put(self.white)
                    vs.map.put(self.irregu.content, cs1into, irr)
  
!           if showTessel:
                vs.map.put(GLCache.getCallList("""
+                   PushAttrib POLYGON_BIT
                    PolygonMode FRONT_AND_BACK LINE
+                   LineWidth 1
                """))
                ContentR().run()
!               FrameR().run()
!               pp.run()
!               vs.map.put(GLCache.getCallList("""
!                   PopAttrib
!               """))
!           else:
                Stencil.drawStenciled(vs,
                    ContentR(),
                    None,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]