gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz ./TODO gfx/demo/xupdf.py gfx/libutil/effect...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz ./TODO gfx/demo/xupdf.py gfx/libutil/effect...
Date: Thu, 03 Oct 2002 13:19:20 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        02/10/03 13:19:19

Modified files:
        .              : TODO 
        gfx/demo       : xupdf.py 
        gfx/libutil    : effects.py 
        gzz/view       : xubuoy.py 

Log message:
        Some buoy work

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/TODO.diff?tr1=1.231&tr2=1.232&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/xupdf.py.diff?tr1=1.49&tr2=1.50&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libutil/effects.py.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/xubuoy.py.diff?tr1=1.13&tr2=1.14&r1=text&r2=text

Patches:
Index: gzz/TODO
diff -c gzz/TODO:1.231 gzz/TODO:1.232
*** gzz/TODO:1.231      Thu Oct  3 13:05:02 2002
--- gzz/TODO    Thu Oct  3 13:19:19 2002
***************
*** 29,35 ****
        - xupdf:
            - combine client and xubuoy
            - text
!           - reload button 
            - multiple instances of same cell visible as a buoy --> keys?
                - special matcher? or pp/VobKeyer?
                - really USE hierarchical keys
--- 29,35 ----
        - xupdf:
            - combine client and xubuoy
            - text
!           - reload button  (key to reload jython code!)
            - multiple instances of same cell visible as a buoy --> keys?
                - special matcher? or pp/VobKeyer?
                - really USE hierarchical keys
Index: gzz/gfx/demo/xupdf.py
diff -c gzz/gfx/demo/xupdf.py:1.49 gzz/gfx/demo/xupdf.py:1.50
*** gzz/gfx/demo/xupdf.py:1.49  Thu Oct  3 09:51:02 2002
--- gzz/gfx/demo/xupdf.py       Thu Oct  3 13:19:19 2002
***************
*** 69,75 ****
--- 69,78 ----
      space.cellTexter.setEnfilade(cell, p)
      cells.append(cell)
  
+ import gzz.view.xubuoy
+ reload(gzz.view.xubuoy)
  from gzz.view.xubuoy import *
+ 
  #execfile("gzz/view/xubuoy.py")
  
  def globalkey(key):
Index: gzz/gfx/libutil/effects.py
diff -c gzz/gfx/libutil/effects.py:1.12 gzz/gfx/libutil/effects.py:1.13
*** gzz/gfx/libutil/effects.py:1.12     Mon Sep 30 04:15:42 2002
--- gzz/gfx/libutil/effects.py  Thu Oct  3 13:19:19 2002
***************
*** 9,15 ****
      def __init__(self, vs, center, radius, p, nadir):
        self.vs, self.c, self.r, self.p, self.nadir = vs, center, radius, p, 
nadir
        self.linecon = GLRen.createLineConnector(0, 0)
!     def addBuoy(self, anchorX, anchorY, importance, key, buoy, w, h):
        size = importance
  
        # 1. find the projected buoy point
--- 9,15 ----
      def __init__(self, vs, center, radius, p, nadir):
        self.vs, self.c, self.r, self.p, self.nadir = vs, center, radius, p, 
nadir
        self.linecon = GLRen.createLineConnector(0, 0)
!     def addBuoy(self, anchorX, anchorY, importance, key, w, h):
        size = importance
  
        # 1. find the projected buoy point
***************
*** 23,29 ****
        # Coefficients of the 2nd degree eq
        a = v[0]*v[0] + v[1]*v[1]
        b = 2*(v[0]*AmC[0] + v[1]*AmC[1])
!       c = AmC[0]*AmC[0] + AmC[1]+AmC[1] - self.r**2
  
        print "S: ",v,AmC,self.r, a,b,c
  
--- 23,29 ----
        # Coefficients of the 2nd degree eq
        a = v[0]*v[0] + v[1]*v[1]
        b = 2*(v[0]*AmC[0] + v[1]*AmC[1])
!       c = AmC[0]*AmC[0] + AmC[1]*AmC[1] - self.r**2
  
        print "S: ",v,AmC,self.r, a,b,c
  
***************
*** 32,59 ****
        if det <= 0:
            # For now, ignore
            print "Ignoring ",key
!           return
  
!       ans = (-b + math.sqrt(det)) / (2*a)
!       print "DA: ",det,ans
  
!       b = (self.p[0] + ans * v[0], self.p[1] + ans * v[1])
!       print "Buoy: (%s,%s): (%s,%s)\n"%(
!           anchorX, anchorY, b[0], b[1])
  
        # Create the coordinate system
  
        vs = self.vs
!       transaffine(vs, str(key)+"_1", b[0], b[1], size, 0, 0, size)
!       rotate(vs, str(key)+"_2", 360 * self.nadir.getAngleRad(b[0], b[1]) / 
!                                       (2 * math.pi), 0, 0, 1)
!       buoy.run()
!       poptrans(vs, str(key)+"_2")
!       poptrans(vs, str(key)+"_1")
! 
!       ac = vs.coords.coordsys(0, str(key)+"_5", 10, anchorX, anchorY, 0, 0)
!       bc = vs.coords.coordsys(0, str(key)+"_6", 10, b[0], b[1], 0, 0)
!       vs.map.put(self.linecon, ac, bc)
  
  
  # Prototype: just start from the middle, then up & down
--- 32,71 ----
        if det <= 0:
            # For now, ignore
            print "Ignoring ",key
!           b = (0,0)
  
!       else:
  
!           ans = (-b + math.sqrt(det)) / (2*a)
!           print "DA: ",det,ans
! 
!           b = (self.p[0] + ans * v[0], self.p[1] + ans * v[1])
!           print "Buoy: (%s,%s): (%s,%s)\n"%(
!               anchorX, anchorY, b[0], b[1])
  
        # Create the coordinate system
  
        vs = self.vs
!       cs1 = vs.coords.affineCoordsys(0, 50, b[0], b[1], size, 0, 0, size)
!       vs.matcher.add(cs1, str(key)+"_buo_1")
!       cs2 = vs.coords.rotateXY(cs1, 360 * self.nadir.getAngleRad(b[0], b[1]) 
/ (2 * math.pi))
!       vs.matcher.add(cs2,str(key)+"_buo_2")
!       return cs2
! 
!       # ac = vs.coords.coordsys(0, str(key)+"_5", 10, anchorX, anchorY, 0, 0)
!       # bc = vs.coords.coordsys(0, str(key)+"_6", 10, b[0], b[1], 0, 0)
!       # vs.map.put(self.linecon, ac, bc)
!     def addCentralBuoy(self, key):
!       b = self.c
!       size = 1
!       vs = self.vs
!       cs = vs.coords.affineCoordsys(0, 100, b[0], b[1], size, 0, 0, size)
!       vs.matcher.add(cs, str(key)+"_buo_1") 
! 
!       cs2 = vs.coords.rotateXY(cs, 0)
!       vs.matcher.add(cs2, str(key)+"_buo_2") 
!       return cs2
! 
  
  
  # Prototype: just start from the middle, then up & down
Index: gzz/gzz/view/xubuoy.py
diff -c gzz/gzz/view/xubuoy.py:1.13 gzz/gzz/view/xubuoy.py:1.14
*** gzz/gzz/view/xubuoy.py:1.13 Thu Oct  3 12:50:30 2002
--- gzz/gzz/view/xubuoy.py      Thu Oct  3 13:19:19 2002
***************
*** 105,111 ****
        self.eye = 0.2
        self.buoyscale = 400
  
!     def add(self, vs, anchorX, anchorY, importance, floater, 
                        maincs, globalview = None,
                        globalusefancypaper = 0,
                        globalshowtessel = 0):
--- 105,111 ----
        self.eye = 0.2
        self.buoyscale = 400
  
!     def add(self, vs, importance, floater, 
                        maincs, globalview = None,
                        globalusefancypaper = 0,
                        globalshowtessel = 0):
***************
*** 126,132 ****
  
        main_end_cs = vs.coords.coordsys(maincs, -20, mainpoint[0], 
mainpoint[1], 0, 0)
  
!       cs1 = floater.addBuoy(anchorX, anchorY, importance, self.cell.getId(), 
0, 0)
  
  
        # Then, make the buoy coordsys
--- 126,133 ----
  
        main_end_cs = vs.coords.coordsys(maincs, -20, mainpoint[0], 
mainpoint[1], 0, 0)
  
!       cs1 = floater.addBuoy(mainpoint[0], mainpoint[1], 
!               importance, self.cell.getId(), 0, 0)
  
  
        # Then, make the buoy coordsys
***************
*** 418,427 ****
        #                   self.rad, projx, self.ctry, 0)
        # vs.matcher.add(cs1, self.cursor.getId()+"__buo")
  
!       bf = effects.NadirCircleFloater_NoAnchor(vs, (self.ctrx, self.ctry), 
self.rad,
!                        self.nadir, 1)
!       bfforw = effects.NadirCircleFloater_NoAnchor(vs, (self.ctrx, 
self.ctry), self.rad,
!                        self.nadir, -1)
  
  
        cs1 = bf.addCentralBuoy(self.cursor.getId())
--- 419,430 ----
        #                   self.rad, projx, self.ctry, 0)
        # vs.matcher.add(cs1, self.cursor.getId()+"__buo")
  
!       projdist = 1.5*self.rad
! 
!       bf = effects.NadirCircleFloater(vs, (self.ctrx, self.ctry), 
!           self.rad, (self.ctrx - projdist, self.ctry), self.nadir)
!       bfforw = effects.NadirCircleFloater(vs, (self.ctrx, self.ctry), 
!           self.rad, (self.ctrx + projdist, self.ctry), self.nadir)
  
  
        cs1 = bf.addCentralBuoy(self.cursor.getId())
***************
*** 466,472 ****
            for forwlink in globalforw:
                b = XuPDFBuoy(1, (getattr(forwlink, "from"), forwlink.to),
                        enfoverlap = enfoverlap)
!               b.add(vs, 0, 0, 1, bfforw, maincs = cs1_trans,
                        globalview = self.view,
                        globalusefancypaper = self.usefancypaper,
                        globalshowtessel = self.showtessel)
--- 469,475 ----
            for forwlink in globalforw:
                b = XuPDFBuoy(1, (getattr(forwlink, "from"), forwlink.to),
                        enfoverlap = enfoverlap)
!               b.add(vs, 1, bfforw, maincs = cs1_trans,
                        globalview = self.view,
                        globalusefancypaper = self.usefancypaper,
                        globalshowtessel = self.showtessel)
***************
*** 474,480 ****
            for backlink in globalback:
                b = XuPDFBuoy(0,(getattr(backlink,"from"), backlink.to),
                        enfoverlap = enfoverlap)
!               b.add(vs, 0, 0, 1, bf, maincs = cs1_trans,
                        globalview = self.view,
                        globalusefancypaper = self.usefancypaper,
                        globalshowtessel = self.showtessel)
--- 477,483 ----
            for backlink in globalback:
                b = XuPDFBuoy(0,(getattr(backlink,"from"), backlink.to),
                        enfoverlap = enfoverlap)
!               b.add(vs, 1, bf, maincs = cs1_trans,
                        globalview = self.view,
                        globalusefancypaper = self.usefancypaper,
                        globalshowtessel = self.showtessel)




reply via email to

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