gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz gfx/librenderables/renderables.py gzz/gfx/g...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz gfx/librenderables/renderables.py gzz/gfx/g...
Date: Wed, 12 Feb 2003 05:13:03 -0500

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

Modified files:
        gfx/librenderables: renderables.py 
        gzz/gfx/gl     : GLVobCoorder.java 
        gzz/view       : PageSpanCellView.java 
        gzz/view/buoy  : pagespanNodes.py 
Added files:
        gzz/view       : FisheyeState.java 

Log message:
        Fisheye in buoyoing

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/renderables.py.diff?tr1=1.174&tr2=1.175&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/gfx/gl/GLVobCoorder.java.diff?tr1=1.68&tr2=1.69&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/FisheyeState.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/PageSpanCellView.java.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/buoy/pagespanNodes.py.diff?tr1=1.25&tr2=1.26&r1=text&r2=text

Patches:
Index: gzz/gfx/librenderables/renderables.py
diff -u gzz/gfx/librenderables/renderables.py:1.174 
gzz/gfx/librenderables/renderables.py:1.175
--- gzz/gfx/librenderables/renderables.py:1.174 Tue Jan 28 10:47:31 2003
+++ gzz/gfx/librenderables/renderables.py       Wed Feb 12 05:13:02 2003
@@ -750,6 +750,7 @@
            
            int dice = (int)(len * nonl * dicefactor) + 2;
            DBG(dbg_paperquad) << "Dice: " << dice <<"\\n";
+           if(dice < 0 || dice > 100) dice = 100;
 
            float *vertices = new float[dice * dice * 5];
 
Index: gzz/gzz/gfx/gl/GLVobCoorder.java
diff -u gzz/gzz/gfx/gl/GLVobCoorder.java:1.68 
gzz/gzz/gfx/gl/GLVobCoorder.java:1.69
--- gzz/gzz/gfx/gl/GLVobCoorder.java:1.68       Sat Feb  8 05:19:20 2003
+++ gzz/gzz/gfx/gl/GLVobCoorder.java    Wed Feb 12 05:13:03 2003
@@ -31,7 +31,7 @@
 import gzz.client.gl.*;
 
 public final class GLVobCoorder extends AffineVobCoorder {
-public static final String rcsid = "$Id: GLVobCoorder.java,v 1.68 2003/02/08 
10:19:20 mudyc Exp $";
+public static final String rcsid = "$Id: GLVobCoorder.java,v 1.69 2003/02/12 
10:13:03 tjl Exp $";
     public static boolean dbg = false;
     private static void pa(String s) { System.err.println(s); }
 
@@ -430,12 +430,6 @@
      */
     public int distort(int into, float x, float y, float w, float h, float 
mag, float min) {
 
-       floats[nfloats + 0] = x;
-       floats[nfloats + 1] = y;
-       floats[nfloats + 2] = (float)Math.log(mag);
-       floats[nfloats + 3] = (float)Math.log(min);
-       floats[nfloats + 4] = w;
-       floats[nfloats + 5] = h;
        int paramInd = nfloats;
        nfloats += 6;
 
@@ -445,8 +439,22 @@
 
        int was = ninds;
        ninds += 3;
+
+       setDistortParams(was, x, y, w, h, mag, min);
        return was;
     }
+
+    public void setDistortParams(int cs, float x, float y, float w, float h, 
float mag, float min) {
+
+       int ind = inds[cs + 2];
+       floats[ind + 0] = x;
+       floats[ind + 1] = y;
+       floats[ind + 2] = (float)Math.log(mag);
+       floats[ind + 3] = (float)Math.log(min);
+       floats[ind + 4] = w;
+       floats[ind + 5] = h;
+    }
+
 
     public int concat(int parent, int child) {
        int paramInd = nfloats;
Index: gzz/gzz/view/PageSpanCellView.java
diff -u gzz/gzz/view/PageSpanCellView.java:1.18 
gzz/gzz/view/PageSpanCellView.java:1.19
--- gzz/gzz/view/PageSpanCellView.java:1.18     Tue Feb 11 06:08:07 2003
+++ gzz/gzz/view/PageSpanCellView.java  Wed Feb 12 05:13:03 2003
@@ -169,7 +169,7 @@
                psps[p].request(importance, scale * pixelscale);
                vs.map.put(GLRen.createPaperQuad(psps[p].getPaper(useBg), 
                            xywh[4*p + 0], xywh[4*p + 1], 
-                           xywh[4*p + 2], xywh[4*p + 3], 0), tr, 0);
+                           xywh[4*p + 2], xywh[4*p + 3], 2), tr, 0);
            }
        }
 
Index: gzz/gzz/view/buoy/pagespanNodes.py
diff -u gzz/gzz/view/buoy/pagespanNodes.py:1.25 
gzz/gzz/view/buoy/pagespanNodes.py:1.26
--- gzz/gzz/view/buoy/pagespanNodes.py:1.25     Tue Feb 11 15:10:12 2003
+++ gzz/gzz/view/buoy/pagespanNodes.py  Wed Feb 12 05:13:03 2003
@@ -48,7 +48,7 @@
        if layout == None: 
            layout = pscv.getLayout(anchorSpan.getScrollBlock())
        # For now, we'll just squish to fit
-       layout.placeBoxed(vs, into, .5, 200)
+       layout.placeBoxed(vs, into, .2, 40)
 
        return into
 
@@ -95,7 +95,7 @@
                vs.map.put(irregu.content, paperCS, paperLoc)
        class LayoutR(java.lang.Runnable):
            def run(rself):
-               layout.place(vs, paperCS, .5, 200, into)
+               layout.place(vs, paperCS, .6, 100, into)
        
        gzz.gfx.gl.Stencil.drawStenciled(vs, ContentR(), None, FrameR(), 
LayoutR(), 1)
 
@@ -120,10 +120,12 @@
 
        xywh = self.layout.getExtents(anchorSpan, None)
 
-       self.x = xywh[0] + .5 * xywh[2]
-       self.y = xywh[1] + .5 * xywh[3]
-    def _setShift(self, vs):
-       vs.coords.setTranslateParams(self.shift, -self.x, -self.y)
+       self.fisheye = gzz.view.FisheyeState(
+           1.1, .04, 5, 2, 1000
+       )
+
+       self.fisheye.setCenter(xywh[0] + .5 * xywh[2],
+                               xywh[1] + .5 * xywh[3])
 
     def _linkEndCS(self, enf, key):
        """Make a coordinate system for the link end and return it.
@@ -145,12 +147,12 @@
        self.ctr = vs.translateCS(into, "ORIGIN", .5 * size[0],
                    .5 * size[1])
        self.scale = vs.scaleCS(self.ctr, "SCALE", self.scale, self.scale)
-       self.shift = vs.translateCS(self.scale, "TR", -self.x, -self.y)
-                   
+
+       self.shift = self.fisheye.getCoordsys(vs, self.scale, "TR")
 
        # XXX This is not right: the distortion
        # should be done here.
-       self.layout.place(vs, self.shift, 1, 200)
+       self.layout.place(vs, self.shift, .7, 150)
 
        if self.nodetype.scrollBlockLinker.enfiladeOverlap != None:
            matches = (self.nodetype.scrollBlockLinker
@@ -178,6 +180,9 @@
                                xulink, repr)
 
     def mouse(self, mouseEvent, oldVS):
+       if self.fisheye.event(mouseEvent):
+           self.fisheye.setCoordsysParams()
+           return 1
        if mouseEvent.getID() == mouseEvent.MOUSE_CLICKED:
            # print "MOUSE PSPMAIN ",mouseEvent
            size[0] = mouseEvent.getX()
@@ -194,14 +199,15 @@
            # print "Self.xy was",self.x,self.y
            oldVS.coords.transformPoints3(self.shift, size, tmp)
            # print "Retransformed:", tmp[0], tmp[1], tmp[2]
-           self.x = size[0]
-           self.y = size[1]
-           if self.x < 0: self.x = 0
-           if self.y < 0: self.y = 0
-           if self.x > self.layout.w: self.x = self.layout.w
-           if self.y > self.layout.h: self.y = self.layout.h
-           # self.setShift(oldVS)
+           x = size[0]
+           y = size[1]
+           if x < 0: x = 0
+           if y < 0: y = 0
+           if x > self.layout.w: x = self.layout.w
+           if y > self.layout.h: y = self.layout.h
+           self.fisheye.setCenter(x, y)
            gzz.client.AbstractUpdateManager.chg()
+           # self.setShift(oldVS)
            return 0
        return 0
     def keystroke(self, key):




reply via email to

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