gzz-commits
[Top][All Lists]
Advanced

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

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


From: Asko Soukka
Subject: [Gzz-commits] gzz test/gzz/gfx/gl/glvobcoorder.test gzz/gfx/g...
Date: Mon, 18 Nov 2002 10:27:55 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Asko Soukka <address@hidden>    02/11/18 10:27:55

Modified files:
        test/gzz/gfx/gl: glvobcoorder.test 
        gzz/gfx/gl     : GLVobCoorder.java 
        gfx/libcoords  : Coords.cxx Coords.hxx 

Log message:
        getSqSize() implementation for CullingCoordSys

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/gzz/gfx/gl/glvobcoorder.test.diff?tr1=1.22&tr2=1.23&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/gfx/gl/GLVobCoorder.java.diff?tr1=1.57&tr2=1.58&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcoords/Coords.cxx.diff?tr1=1.54&tr2=1.55&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcoords/Coords.hxx.diff?tr1=1.23&tr2=1.24&r1=text&r2=text

Patches:
Index: gzz/gfx/libcoords/Coords.cxx
diff -u gzz/gfx/libcoords/Coords.cxx:1.54 gzz/gfx/libcoords/Coords.cxx:1.55
--- gzz/gfx/libcoords/Coords.cxx:1.54   Mon Nov 18 04:18:31 2002
+++ gzz/gfx/libcoords/Coords.cxx        Mon Nov 18 10:27:55 2002
@@ -1018,6 +1018,7 @@
            return super->performGL();
        }
        virtual Pt getSqSize() {
+         DBG(dbg_cull) << "called CullingCoordsys::getSqSize\n";
          return super->getSqSize();
        }
        /** CullingCoordSys' shouldBeDrawn() returns true always when boxes 
Index: gzz/gfx/libcoords/Coords.hxx
diff -u gzz/gfx/libcoords/Coords.hxx:1.23 gzz/gfx/libcoords/Coords.hxx:1.24
--- gzz/gfx/libcoords/Coords.hxx:1.23   Mon Nov 18 04:18:31 2002
+++ gzz/gfx/libcoords/Coords.hxx        Mon Nov 18 10:27:55 2002
@@ -157,6 +157,8 @@
         * some which alter this, for the purpose of catching mouse clicks
         * at a larger area. A mouse click is "in" this coordinate system,
         * if it is in the area Pt(0,0) .. getSqSize()
+        *
+        * NOTE: Must be implemented also at GLVobCoorder.java.
         */
        virtual Pt getSqSize() {
            return Pt(1, 1);
Index: gzz/gzz/gfx/gl/GLVobCoorder.java
diff -u gzz/gzz/gfx/gl/GLVobCoorder.java:1.57 
gzz/gzz/gfx/gl/GLVobCoorder.java:1.58
--- gzz/gzz/gfx/gl/GLVobCoorder.java:1.57       Mon Nov 11 07:01:31 2002
+++ gzz/gzz/gfx/gl/GLVobCoorder.java    Mon Nov 18 10:27:55 2002
@@ -31,7 +31,7 @@
 import gzz.client.gl.*;
 
 public class GLVobCoorder extends AffineVobCoorder {
-public static final String rcsid = "$Id: GLVobCoorder.java,v 1.57 2002/11/11 
12:01:31 tjl Exp $";
+public static final String rcsid = "$Id: GLVobCoorder.java,v 1.58 2002/11/18 
15:27:55 humppake Exp $";
     public static boolean dbg = false;
     private static void pa(String s) { System.err.println(s); }
 
@@ -304,6 +304,9 @@
        int type = inds[cs] & ~GL.CSFLAGS;
        int ind=-42;
        switch(type) {
+           case 10: // culling
+               getSqSize(inds[cs + 1], into); // forwards to cs' parent
+               break;
            case 11: // box
                ind = inds[cs+2];
                into[0] = floats[ind + 0];
Index: gzz/test/gzz/gfx/gl/glvobcoorder.test
diff -u gzz/test/gzz/gfx/gl/glvobcoorder.test:1.22 
gzz/test/gzz/gfx/gl/glvobcoorder.test:1.23
--- gzz/test/gzz/gfx/gl/glvobcoorder.test:1.22  Mon Nov 11 07:01:32 2002
+++ gzz/test/gzz/gfx/gl/glvobcoorder.test       Mon Nov 18 10:27:55 2002
@@ -1,6 +1,8 @@
 from __future__ import nested_scopes
 needGL()
 
+from jarray import zeros
+
 from gzz.vob import *
 from java.awt import Color
 
@@ -198,6 +200,15 @@
     putThings()
     checkNotAvgColor(10, 10, 100, 100, (255, 0, 0), delta=50)
 
+#test box forwarding
+    cs_box = c.orthoBox(cs, 0, 0, 0, 1, 1, 10, 10)
+    cs_cull = c.cull(cs_box, cs_clip)
+    boxwh = zeros(2, 'f')
+    c.getSqSize(cs_cull, boxwh)
+    a = str(boxwh)
+    failIf(boxwh[0] != 10.0, "%s != 10.0" % (boxwh[0]))
+    failIf(boxwh[1] != 10.0, "%s != 10.0" % (boxwh[1]))
+       
 #test same area
     cs_clip = c.affineCoordsys(0, 0, 10, 10, 100, 0, 0, 100)
     cs_cull = c.cull(cs, cs_clip)




reply via email to

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