gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz gzz/gfx/gl/GLVobCoorder.java test/gzz/gfx/g...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz gzz/gfx/gl/GLVobCoorder.java test/gzz/gfx/g...
Date: Wed, 05 Feb 2003 13:47:41 -0500

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

Modified files:
        gzz/gfx/gl     : GLVobCoorder.java 
        test/gzz/gfx/gl: glvobcoorder.test paper.test 

Log message:
        Oops -- nadir box propagation needed some work

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/gfx/gl/GLVobCoorder.java.diff?tr1=1.64&tr2=1.65&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/gzz/gfx/gl/glvobcoorder.test.diff?tr1=1.33&tr2=1.34&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/gzz/gfx/gl/paper.test.diff?tr1=1.11&tr2=1.12&r1=text&r2=text

Patches:
Index: gzz/gzz/gfx/gl/GLVobCoorder.java
diff -u gzz/gzz/gfx/gl/GLVobCoorder.java:1.64 
gzz/gzz/gfx/gl/GLVobCoorder.java:1.65
--- gzz/gzz/gfx/gl/GLVobCoorder.java:1.64       Wed Feb  5 03:14:45 2003
+++ gzz/gzz/gfx/gl/GLVobCoorder.java    Wed Feb  5 13:47:40 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.64 2003/02/05 
08:14:45 tjl Exp $";
+public static final String rcsid = "$Id: GLVobCoorder.java,v 1.65 2003/02/05 
18:47:40 tjl Exp $";
     public static boolean dbg = false;
     private static void pa(String s) { System.err.println(s); }
 
@@ -405,6 +405,10 @@
                ind = inds[cs+2];
                into[0] = floats[ind + 5];
                into[1] = floats[ind + 6];
+               break;
+           case 9: case 17: // nadir -- recurse
+               ind = inds[cs + 1];
+               getSqSize(ind, into);
                break;
            default:
                into[0] = into[1] = 1;
Index: gzz/test/gzz/gfx/gl/glvobcoorder.test
diff -u gzz/test/gzz/gfx/gl/glvobcoorder.test:1.33 
gzz/test/gzz/gfx/gl/glvobcoorder.test:1.34
--- gzz/test/gzz/gfx/gl/glvobcoorder.test:1.33  Wed Feb  5 07:32:39 2003
+++ gzz/test/gzz/gfx/gl/glvobcoorder.test       Wed Feb  5 13:47:40 2003
@@ -91,6 +91,21 @@
        failIf( abs(src[i] - src3[i])/(abs(src[i])+1) > 0.01, msg=msg)
        failIf( abs(dst[i] - dst2[i])/(abs(dst[i])+1) > 0.01, msg=msg)
 
+    # As a bonus, test that the unit square is reported right
+
+    c.getSqSize(cs, dst)
+
+    cs1 = c.scale(cs, dst[0], dst[1], 1)
+    cs2 = c.unitSq(cs)
+
+    c.transformPoints3(cs1, src, dst)
+    c.transformPoints3(cs2, src, dst2)
+
+    msg = str((src, dst, dst2))
+    for i in range(0,len(src)):
+       failIf( abs(dst[i] - dst2[i])/(abs(dst[i])+1) > 0.01, msg=msg)
+
+
 def testInverses():
     for i in range(0,5):
        c = GLVobCoorder()
@@ -123,6 +138,24 @@
        cs_cull = c.cull(cs_affine, cs_affine_clip)
        checkInverse(c, cs_cull)
 
+       cs_box = c.orthoBox(0, 0, 100, 150, .2, .3, 420, 430)
+       checkInverse(c, cs_box)
+       # Now, place a nadir cs under this - it should retain
+       # the box
+       box = zeros(2, 'f')
+       c.getSqSize(cs_box, box)
+       failUnlessEqual(box[0], 420)
+       failUnlessEqual(box[1], 430)
+       cs_nadir = c.nadirUnitSq(cs_box, cs_ortho)
+       c.getSqSize(cs_nadir, box)
+       failUnlessEqual(box[0], 420)
+       failUnlessEqual(box[1], 430)
+       checkInverse(c, cs_nadir)
+       cs_nadir = c.nadirOrigin(cs_box, cs_ortho)
+       c.getSqSize(cs_nadir, box)
+       failUnlessEqual(box[0], 420)
+       failUnlessEqual(box[1], 430)
+       checkInverse(c, cs_nadir)
 
 def testInterpolateTranslation():
 
Index: gzz/test/gzz/gfx/gl/paper.test
diff -u gzz/test/gzz/gfx/gl/paper.test:1.11 gzz/test/gzz/gfx/gl/paper.test:1.12
--- gzz/test/gzz/gfx/gl/paper.test:1.11 Mon Jan 27 14:49:02 2003
+++ gzz/test/gzz/gfx/gl/paper.test      Wed Feb  5 13:47:40 2003
@@ -35,7 +35,7 @@
     too short allocated arrays.
     """
     paper = PaperMill.getInstance().getPaper(57)
-    for df in (0, .1, .5, 1, 5, 10, 20, 37, 100, 150):
+    for df in (0, .1, .5, 1, 5, 10, 20, 37, 50):
        vs = getvs()
        vs.map.put(SolidBgVob(Color.black))
        pq = GLRen.createPaperQuad(paper, 0, 0, 1, 1, df)




reply via email to

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