gzz-commits
[Top][All Lists]
Advanced

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

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


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz gzz/gfx/gl/GLVanishingClient.java gzz/gfx/g...
Date: Tue, 15 Oct 2002 09:29:19 -0400

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

Modified files:
        gzz/gfx/gl     : GLVanishingClient.java GLVobCoorder.java 
        gzz/modules/pp : PlaneView.java 
        gzz/view       : DimDecorator.java LastOpDecorator.java 
                         MarkDecorator.java RowColView.java 
                         TextCellContentView.java 
                         VobVanishingClient.java 
        gzz/vob        : AffineVobCoorder.java Box.java HBox.java 
                         HBroken.java LinebreakingUtil.java 
                         OrthoCoorder.java OrthoCoordsys.java 
                         VobCoorder.java VobMatcher.java VobScene.java 
        test/gzz/gfx/gl: basicrender.test 
        test/gzz/vob   : TestVobScene.java 

Log message:
        Implement PEG 1009

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/gfx/gl/GLVanishingClient.java.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/gfx/gl/GLVobCoorder.java.diff?tr1=1.41&tr2=1.42&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/PlaneView.java.diff?tr1=1.53&tr2=1.54&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/DimDecorator.java.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/LastOpDecorator.java.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/MarkDecorator.java.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/RowColView.java.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/TextCellContentView.java.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/VobVanishingClient.java.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/AffineVobCoorder.java.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/Box.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/HBox.java.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/HBroken.java.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/LinebreakingUtil.java.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/OrthoCoorder.java.diff?tr1=1.34&tr2=1.35&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/OrthoCoordsys.java.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/VobCoorder.java.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/VobMatcher.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/VobScene.java.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/gzz/gfx/gl/basicrender.test.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/gzz/vob/TestVobScene.java.diff?tr1=1.13&tr2=1.14&r1=text&r2=text

Patches:
Index: gzz/gzz/gfx/gl/GLVanishingClient.java
diff -c gzz/gzz/gfx/gl/GLVanishingClient.java:1.11 
gzz/gzz/gfx/gl/GLVanishingClient.java:1.12
*** gzz/gzz/gfx/gl/GLVanishingClient.java:1.11  Wed Sep 25 10:45:43 2002
--- gzz/gzz/gfx/gl/GLVanishingClient.java       Tue Oct 15 09:29:18 2002
***************
*** 67,73 ****
      public void place(Cell c, Object o, float fract, int x0, int y0, int x1, 
int y1,
                int depth, float rot) {
        // p("Place "+c+" "+fract+" "+x0+" "+y0+" "+x1+" "+y1+" "+depth);
!       int cs = vs.coords.coordsys(into, depth, x0, y0, x1-x0, y1-y0);
        vs.matcher.add(cs, c);
        vs.map.put(cellImage, cs);
      }
--- 67,73 ----
      public void place(Cell c, Object o, float fract, int x0, int y0, int x1, 
int y1,
                int depth, float rot) {
        // p("Place "+c+" "+fract+" "+x0+" "+y0+" "+x1+" "+y1+" "+depth);
!       int cs = vs.coords.ortho(into, depth, x0, y0, x1-x0, y1-y0);
        vs.matcher.add(cs, c);
        vs.map.put(cellImage, cs);
      }
Index: gzz/gzz/gfx/gl/GLVobCoorder.java
diff -c gzz/gzz/gfx/gl/GLVobCoorder.java:1.41 
gzz/gzz/gfx/gl/GLVobCoorder.java:1.42
*** gzz/gzz/gfx/gl/GLVobCoorder.java:1.41       Thu Oct 10 05:29:51 2002
--- gzz/gzz/gfx/gl/GLVobCoorder.java    Tue Oct 15 09:29:18 2002
***************
*** 29,35 ****
  import gzz.client.gl.*;
  
  public class GLVobCoorder extends AffineVobCoorder {
! public static final String rcsid = "$Id: GLVobCoorder.java,v 1.41 2002/10/10 
09:29:51 tjl Exp $";
      public static boolean dbg = false;
      private static void pa(String s) { System.err.println(s); }
  
--- 29,35 ----
  import gzz.client.gl.*;
  
  public class GLVobCoorder extends AffineVobCoorder {
! public static final String rcsid = "$Id: GLVobCoorder.java,v 1.42 2002/10/15 
13:29:18 tjl Exp $";
      public static boolean dbg = false;
      private static void pa(String s) { System.err.println(s); }
  
***************
*** 78,85 ****
        floats[ind + 6] = y_y;
      }
  
!     public int rotateXY(int into, float degrees) {
!       floats[nfloats + 0] = degrees;
        int paramInd = nfloats;
        nfloats += 1;
  
--- 78,84 ----
        floats[ind + 6] = y_y;
      }
  
!     public int rotate(int into, float degrees) {
        int paramInd = nfloats;
        nfloats += 1;
  
***************
*** 89,97 ****
--- 88,104 ----
        int was = ninds;
        ninds += 3;
  
+       setRotateParams(into, degrees);
+ 
        return was;
      }
  
+     public void setRotateParams(int cs, float degrees) {
+       int ind = inds[cs + 2];
+       floats[ind + 0] = degrees;
+     }
+ 
+ 
      public int rotateXYZ(int into, float degrees, float x, float y, float z) {
        floats[nfloats + 0] = x;
        floats[nfloats + 1] = y;
***************
*** 164,173 ****
  
  
  
!     public int scaleXYZ(int into, float sx, float sy, float sz) {
!       floats[nfloats + 0] = sx;
!       floats[nfloats + 1] = sy;
!       floats[nfloats + 2] = sz;
        int paramInd = nfloats;
        nfloats += 3;
  
--- 171,177 ----
  
  
  
!     public int scale(int into, float sx, float sy, float sz) {
        int paramInd = nfloats;
        nfloats += 3;
  
***************
*** 177,184 ****
--- 181,198 ----
        int was = ninds;
        ninds += 3;
  
+       setScaleParams(into, sx, sy, sz);
+ 
        return was;
      }
+ 
+     public void setScaleParams(int cs, float sx, float sy, float sz) {
+       int ind = inds[cs + 2];
+       floats[ind + 0] = sx;
+       floats[ind + 1] = sy;
+       floats[ind + 2] = sz;
+     }
+ 
  
  
  
Index: gzz/gzz/modules/pp/PlaneView.java
diff -c gzz/gzz/modules/pp/PlaneView.java:1.53 
gzz/gzz/modules/pp/PlaneView.java:1.54
*** gzz/gzz/modules/pp/PlaneView.java:1.53      Wed Oct  9 10:38:41 2002
--- gzz/gzz/modules/pp/PlaneView.java   Tue Oct 15 09:29:18 2002
***************
*** 40,46 ****
   */
  
  public class PlaneView {
! public static final String rcsid = "$Id: PlaneView.java,v 1.53 2002/10/09 
14:38:41 tjl Exp $";
      public static boolean dbg = true;
      private static void pa(String s) { System.err.println(s); }
  
--- 40,46 ----
   */
  
  public class PlaneView {
! public static final String rcsid = "$Id: PlaneView.java,v 1.54 2002/10/15 
13:29:18 tjl Exp $";
      public static boolean dbg = true;
      private static void pa(String s) { System.err.println(s); }
  
***************
*** 75,82 ****
        Cell note = plane.s(Win.d_contains);
  
        BgVob bg = BgVob.create(plane);
!       int bginto = vs.coords.coordsys(viewport2screen, 500, 0, 0, 1, 1);
!       int bgpap = vs.coords.coordsys(paper2viewport, 0, 0, 0, 100, 100);
        vs.matcher.addSub(viewport2screen, bginto, "BGTRANS");
        vs.matcher.addSub(paper2viewport, bgpap, "BGPAP");
        vs.map.put(bg, bginto, bgpap);
--- 75,82 ----
        Cell note = plane.s(Win.d_contains);
  
        BgVob bg = BgVob.create(plane);
!       int bginto = vs.coords.ortho(viewport2screen, 500, 0, 0, 1, 1);
!       int bgpap = vs.coords.ortho(paper2viewport, 0, 0, 0, 100, 100);
        vs.matcher.addSub(viewport2screen, bginto, "BGTRANS");
        vs.matcher.addSub(paper2viewport, bgpap, "BGPAP");
        vs.map.put(bg, bginto, bgpap);
***************
*** 102,108 ****
  
            Vob v = new TextVob(style, note.t(), true);
  
!           int cs = vs.coordsys(into, note, 5, notex, notey, 10, 10);
            vs.map.put(v, cs);
  
            if(note.equals(cursor) && 
--- 102,108 ----
  
            Vob v = new TextVob(style, note.t(), true);
  
!           int cs = vs.orthoCS(into, note, 5, notex, notey, 10, 10);
            vs.map.put(v, cs);
  
            if(note.equals(cursor) && 
***************
*** 189,205 ****
  
      public void placeBuoyContents(VobScene vs, int cs, Cell center) {
        int w = 200, h = 200;
!       int magcs = vs.matcher.addSub(cs,
!               vs.coords.coordsys(cs, -10, -w/2, -h/2, w, h),
!               "Mag");
        center = center.getRootclone();
        int place[] = Params.getInts(center.s(Win.d_pan, 1), Win.d_pan, 2, 
null);
        float scale = 0.01f;
!       int p2v = vs.matcher.addSub(cs,
!               vs.coords.coordsys(0, 0, 
                    -scale*place[0]+0.5f, -scale*place[1]+0.5f,
!                       scale, scale),
!           "Trans");
        renderPaper(vs, center, -1, magcs, p2v, false);
  
      }
--- 189,203 ----
  
      public void placeBuoyContents(VobScene vs, int cs, Cell center) {
        int w = 200, h = 200;
!       int magcs = vs.orthoCS(cs, "Mag", -10, -w/2, -h/2, w, h);
        center = center.getRootclone();
        int place[] = Params.getInts(center.s(Win.d_pan, 1), Win.d_pan, 2, 
null);
        float scale = 0.01f;
!       int p2v = vs.matcher.addSub(
!                       cs, 
!               vs.coords.ortho(0, 0, 
                    -scale*place[0]+0.5f, -scale*place[1]+0.5f,
!                       scale, scale), "Trans");
        renderPaper(vs, center, -1, magcs, p2v, false);
  
      }
Index: gzz/gzz/view/DimDecorator.java
diff -c gzz/gzz/view/DimDecorator.java:1.11 gzz/gzz/view/DimDecorator.java:1.12
*** gzz/gzz/view/DimDecorator.java:1.11 Tue Oct  8 03:34:54 2002
--- gzz/gzz/view/DimDecorator.java      Tue Oct 15 09:29:18 2002
***************
*** 32,38 ****
   *  vob scene.
   */
  public class DimDecorator implements FallbackSceneDecorator {
! String rcsid = "$Id: DimDecorator.java,v 1.11 2002/10/08 07:34:54 tjl Exp $";
      public static boolean dbg = true;
      private static void p(String s) { if(dbg) pa(s); }
      private static void pa(String s) { System.err.println(s); }
--- 32,38 ----
   *  vob scene.
   */
  public class DimDecorator implements FallbackSceneDecorator {
! String rcsid = "$Id: DimDecorator.java,v 1.12 2002/10/15 13:29:18 tjl Exp $";
      public static boolean dbg = true;
      private static void p(String s) { if(dbg) pa(s); }
      private static void pa(String s) { System.err.println(s); }
***************
*** 60,81 ****
        int w = size.width, h = size.height;
  
        // The coordinate system where the lines start
!       int orig = sc.coordsys(into, origKey, 0, 0, 0, 2, 2);
  
        // The coordinate systems of the dimensions
        int[] targ = {
!           sc.coordsys(into, dimKeys[0], 0, w, 0, 2, 2),
!           sc.coordsys(into, dimKeys[1], 0, 0, h, 2, 2),
!           sc.coordsys(into, dimKeys[2], 0, w, h, 2, 2)
        };
  
        for(int i=0; i<3; i++) {
            sc.map.put(conn, targ[i], orig);
!             int cs_box = sc.coordsys(targ[i], boxKey, 1, 0, 0, w, h);
            sc.map.put(bg, cs_box);
              
!           int cs = sc.coordsys(targ[i], dimKeys[i], 0, 5, 5, 2, 2);
!             int cs_wh = sc.coords.coordsys(0, 0, 0, 0, w-10, h-10);
              ((DefaultVobMatcher)sc.matcher).addSub(cs, cs_wh, whKey);
            sc.map.put(new TextVob(style, dims[i].name), cs, cs_wh);
        }
--- 60,81 ----
        int w = size.width, h = size.height;
  
        // The coordinate system where the lines start
!       int orig = sc.orthoCS(into, origKey, 0, 0, 0, 2, 2);
  
        // The coordinate systems of the dimensions
        int[] targ = {
!           sc.orthoCS(into, dimKeys[0], 0, w, 0, 2, 2),
!           sc.orthoCS(into, dimKeys[1], 0, 0, h, 2, 2),
!           sc.orthoCS(into, dimKeys[2], 0, w, h, 2, 2)
        };
  
        for(int i=0; i<3; i++) {
            sc.map.put(conn, targ[i], orig);
!             int cs_box = sc.orthoCS(targ[i], boxKey, 1, 0, 0, w, h);
            sc.map.put(bg, cs_box);
              
!           int cs = sc.orthoCS(targ[i], dimKeys[i], 0, 5, 5, 2, 2);
!             int cs_wh = sc.coords.ortho(0, 0, 0, 0, w-10, h-10);
              ((DefaultVobMatcher)sc.matcher).addSub(cs, cs_wh, whKey);
            sc.map.put(new TextVob(style, dims[i].name), cs, cs_wh);
        }
***************
*** 87,94 ****
              sc.coords.getRenderInfo(into).getExtRect(rect);
              float vw = style.getWidth(name, 1.6f), vh = style.getHeight(1.6f);
              float vx = rect.width - vw - 10;
!             int cs = sc.coordsys(into, viewKey, 0, vx, 10, 2, 2);
!             int cs_wh = sc.coords.coordsys(0, 0, 0, 0, vw, vh);
              ((DefaultVobMatcher)sc.matcher).addSub(cs, cs_wh, whKey);
              sc.map.put(new TextVob(style, name), cs, cs_wh);
          }
--- 87,94 ----
              sc.coords.getRenderInfo(into).getExtRect(rect);
              float vw = style.getWidth(name, 1.6f), vh = style.getHeight(1.6f);
              float vx = rect.width - vw - 10;
!             int cs = sc.orthoCS(into, viewKey, 0, vx, 10, 2, 2);
!             int cs_wh = sc.coords.ortho(0, 0, 0, 0, vw, vh);
              ((DefaultVobMatcher)sc.matcher).addSub(cs, cs_wh, whKey);
              sc.map.put(new TextVob(style, name), cs, cs_wh);
          }
Index: gzz/gzz/view/LastOpDecorator.java
diff -c gzz/gzz/view/LastOpDecorator.java:1.18 
gzz/gzz/view/LastOpDecorator.java:1.19
*** gzz/gzz/view/LastOpDecorator.java:1.18      Thu Oct 10 13:53:41 2002
--- gzz/gzz/view/LastOpDecorator.java   Tue Oct 15 09:29:18 2002
***************
*** 32,38 ****
   *  directional op entered.
   */
  public class LastOpDecorator implements FallbackSceneDecorator {
! String rcsid = "$Id: LastOpDecorator.java,v 1.18 2002/10/10 17:53:41 benja 
Exp $";
      public static boolean dbg = false;
      private static void pa(String s) { System.err.println(s); }
  
--- 32,38 ----
   *  directional op entered.
   */
  public class LastOpDecorator implements FallbackSceneDecorator {
! String rcsid = "$Id: LastOpDecorator.java,v 1.19 2002/10/15 13:29:18 tjl Exp 
$";
      public static boolean dbg = false;
      private static void pa(String s) { System.err.println(s); }
  
***************
*** 118,124 ****
        float x = padding;
        float y = size.height - padding - h;
  
!       int cs = sc.coordsys(into, key, 0, x, y, 2, 2);
  
        br.put(sc, cs);
  
--- 118,124 ----
        float x = padding;
        float y = size.height - padding - h;
  
!       int cs = sc.orthoCS(into, key, 0, x, y, 2, 2);
  
        br.put(sc, cs);
  
Index: gzz/gzz/view/MarkDecorator.java
diff -c gzz/gzz/view/MarkDecorator.java:1.7 gzz/gzz/view/MarkDecorator.java:1.8
*** gzz/gzz/view/MarkDecorator.java:1.7 Mon Oct 14 06:11:13 2002
--- gzz/gzz/view/MarkDecorator.java     Tue Oct 15 09:29:18 2002
***************
*** 52,58 ****
        float x = outer.width - w - PAD,
              y = outer.height - h - PAD;
  
!       int cs_list = vs.coordsys(into, KEY, 0, x, y, 2, 2);
  
        Box b = new Box();
  
--- 52,58 ----
        float x = outer.width - w - PAD,
              y = outer.height - h - PAD;
  
!       int cs_list = vs.orthoCS(into, KEY, 0, x, y, 2, 2);
  
        Box b = new Box();
  
***************
*** 61,67 ****
            if(m.spans != null) return; // for now-- should show span(s)
            Cell c = m.cell;
  
!           int cs = vs.coordsys(cs_list, c, 0, 0, i*boxsize.height, 1, 1);
            b.set(vs, cs, boxsize.width, boxsize.height);
  
              cv.place(c, vs, b, win);
--- 61,67 ----
            if(m.spans != null) return; // for now-- should show span(s)
            Cell c = m.cell;
  
!           int cs = vs.orthoCS(cs_list, c, 0, 0, i*boxsize.height, 1, 1);
            b.set(vs, cs, boxsize.width, boxsize.height);
  
              cv.place(c, vs, b, win);
***************
*** 73,79 ****
        if(w > boxsize.width)
            x += boxsize.width - w;
  
!       int cs = vs.coordsys(into, TEXT_KEY, 0, x, y, 2, 2);
        vs.map.put(new TextVob(style, str), cs);
      }
  }
--- 73,79 ----
        if(w > boxsize.width)
            x += boxsize.width - w;
  
!       int cs = vs.orthoCS(into, TEXT_KEY, 0, x, y, 2, 2);
        vs.map.put(new TextVob(style, str), cs);
      }
  }
Index: gzz/gzz/view/RowColView.java
diff -c gzz/gzz/view/RowColView.java:1.7 gzz/gzz/view/RowColView.java:1.8
*** gzz/gzz/view/RowColView.java:1.7    Mon Oct 14 06:11:13 2002
--- gzz/gzz/view/RowColView.java        Tue Oct 15 09:29:18 2002
***************
*** 85,91 ****
          int k[] = new int[2];
          for(k[main]=0; k[main] < n[main]; k[main]++)
              for(k[second]=0; k[second] < n[second]; k[second]++) {
!                 cs[k[main]][k[second]] = sc.coordsys(
                      into, grid[k[main]][k[second]], 0,
                      xoffs + k[0]*xroom, yoffs + k[1]*yroom, 2, 2);
            }
--- 85,91 ----
          int k[] = new int[2];
          for(k[main]=0; k[main] < n[main]; k[main]++)
              for(k[second]=0; k[second] < n[second]; k[second]++) {
!                 cs[k[main]][k[second]] = sc.orthoCS(
                      into, grid[k[main]][k[second]], 0,
                      xoffs + k[0]*xroom, yoffs + k[1]*yroom, 2, 2);
            }
Index: gzz/gzz/view/TextCellContentView.java
diff -c gzz/gzz/view/TextCellContentView.java:1.17 
gzz/gzz/view/TextCellContentView.java:1.18
*** gzz/gzz/view/TextCellContentView.java:1.17  Mon Oct 14 06:11:13 2002
--- gzz/gzz/view/TextCellContentView.java       Tue Oct 15 09:29:18 2002
***************
*** 37,43 ****
   */
  
  public class TextCellContentView implements CellContentView {
! public static final String rcsid = "$Id: TextCellContentView.java,v 1.17 
2002/10/14 10:11:13 tjl Exp $";
      public static boolean dbg = false;
      private static void p(String s) { if(dbg) pa(s); }
      private static void pa(String s) { System.err.println(s); }
--- 37,43 ----
   */
  
  public class TextCellContentView implements CellContentView {
! public static final String rcsid = "$Id: TextCellContentView.java,v 1.18 
2002/10/15 13:29:18 tjl Exp $";
      public static boolean dbg = false;
      private static void p(String s) { if(dbg) pa(s); }
      private static void pa(String s) { System.err.println(s); }
***************
*** 87,93 ****
          else textOffset = (- left + middle);
  
          Object key = (line < KEY.length) ? KEY[line] : new Integer(line+1);
!         int offsetcs = v.coordsys(box.getWHCoordsys(), key, 0, textOffset, 0, 
1, 1);
  
          placeVob(c, v, offsetcs, box.getWidth(), box.getHeight(), brBefore, 
brAfter, offs, context, scale);
      }
--- 87,93 ----
          else textOffset = (- left + middle);
  
          Object key = (line < KEY.length) ? KEY[line] : new Integer(line+1);
!         int offsetcs = v.orthoCS(box.getWHCoordsys(), key, 0, textOffset, 0, 
1, 1);
  
          placeVob(c, v, offsetcs, box.getWidth(), box.getHeight(), brBefore, 
brAfter, offs, context, scale);
      }
***************
*** 96,102 ****
      protected void placeVob(Cell c, VobScene v, int cs, float w, float h, int 
start, int end,
                              int offs, ViewContext context, float scale) {
          TextVob vob = new TextVob(style, c.t().substring(start, end));
!         int cs_wh = v.coords.coordsys(0, 0, 0, 0, w, h);
          ((DefaultVobMatcher)v.matcher).addSub(cs, cs_wh, WH_KEY);
          v.map.put(vob, cs, cs_wh);
  
--- 96,102 ----
      protected void placeVob(Cell c, VobScene v, int cs, float w, float h, int 
start, int end,
                              int offs, ViewContext context, float scale) {
          TextVob vob = new TextVob(style, c.t().substring(start, end));
!         int cs_wh = v.coords.ortho(0, 0, 0, 0, w, h);
          ((DefaultVobMatcher)v.matcher).addSub(cs, cs_wh, WH_KEY);
          v.map.put(vob, cs, cs_wh);
  
Index: gzz/gzz/view/VobVanishingClient.java
diff -c gzz/gzz/view/VobVanishingClient.java:1.17 
gzz/gzz/view/VobVanishingClient.java:1.18
*** gzz/gzz/view/VobVanishingClient.java:1.17   Mon Oct 14 06:11:13 2002
--- gzz/gzz/view/VobVanishingClient.java        Tue Oct 15 09:29:18 2002
***************
*** 112,118 ****
      public void place(Cell c, Object o, float fract, int x0, int y0, int x1, 
int y1,
                int depth, float rot) {
        Vob v = (Vob)o;
!       int cs = into.coordsys(intoCS, c, depth, x0, y0, fract, fract);
        Box b = new Box();
        b.set(into, cs, (x1-x0)/fract, (y1-y0)/fract);
        cell2Box.put(c, b);
--- 112,118 ----
      public void place(Cell c, Object o, float fract, int x0, int y0, int x1, 
int y1,
                int depth, float rot) {
        Vob v = (Vob)o;
!       int cs = into.orthoCS(intoCS, c, depth, x0, y0, fract, fract);
        Box b = new Box();
        b.set(into, cs, (x1-x0)/fract, (y1-y0)/fract);
        cell2Box.put(c, b);
Index: gzz/gzz/vob/AffineVobCoorder.java
diff -c gzz/gzz/vob/AffineVobCoorder.java:1.11 
gzz/gzz/vob/AffineVobCoorder.java:1.12
*** gzz/gzz/vob/AffineVobCoorder.java:1.11      Sun Oct  6 11:08:02 2002
--- gzz/gzz/vob/AffineVobCoorder.java   Tue Oct 15 09:29:19 2002
***************
*** 23,44 ****
  package gzz.vob;
  
  /** A set of coordinate systems for vobs.
   */
  
  public abstract class AffineVobCoorder extends VobCoorder {
      /** Default implementation using affineCoordsys.
       */
!     public int coordsys(int into, float depth,
                float x, float y, float w, float h) {
        return affineCoordsys(into, depth, 
                x, y, w, 0, 0, h);
      }
  
      public abstract int affineCoordsys(int into, float depth,
            float x, float y, 
                float xx, float xy, float yx, float yy);
  
!     public abstract int rotateXY(int into, float degrees);
  
  }
  
--- 23,60 ----
  package gzz.vob;
  
  /** A set of coordinate systems for vobs.
+  * <p>
+  * Guarantees about rotate and scale!! Not same as affineCoordsys!
   */
  
  public abstract class AffineVobCoorder extends VobCoorder {
      /** Default implementation using affineCoordsys.
       */
!     public int ortho(int into, float depth,
                float x, float y, float w, float h) {
        return affineCoordsys(into, depth, 
                x, y, w, 0, 0, h);
      }
+     public void setOrthoParams(int cs, float depth,
+               float x, float y, float w, float h) {
+       setAffineParams(cs, depth, 
+               x, y, w, 0, 0, h);
+     }
+ 
  
      public abstract int affineCoordsys(int into, float depth,
            float x, float y, 
                float xx, float xy, float yx, float yy);
  
!     public abstract int rotate(int into, float degrees);
!     public abstract int scale(int into, float sx, float sy, float sz);
! 
!     public abstract void setAffineParams(
!           int cs, float depth, float cx, float cy, 
!           float x_x, float x_y, float y_x, float y_y) ;
! 
!     public abstract void setRotateParams(int into, float degrees);
!     public abstract void setScaleParams(int into, float sx, float sy, float 
sz);
  
  }
  
Index: gzz/gzz/vob/Box.java
diff -c gzz/gzz/vob/Box.java:1.1 gzz/gzz/vob/Box.java:1.2
*** gzz/gzz/vob/Box.java:1.1    Mon Oct 14 06:11:13 2002
--- gzz/gzz/vob/Box.java        Tue Oct 15 09:29:19 2002
***************
*** 54,61 ****
      /** Create the unit square coordsys.
       */
      private void createUnitCoordsys() {
!       unitcoordsys = vs.coords.coordsys(whcoordsys, 0, 0, 0, w, h);
!       vs.matcher.addSub(whcoordsys, unitcoordsys, uckey);
      }
  
      /** Return the width of the box in the standardized coordinate
--- 54,60 ----
      /** Create the unit square coordsys.
       */
      private void createUnitCoordsys() {
!       unitcoordsys = vs.orthoCS(whcoordsys, uckey, 0, 0, 0, w, h);
      }
  
      /** Return the width of the box in the standardized coordinate
***************
*** 83,89 ****
       */
      public void setSubWH(Box parent, Object key, float bx, float by, float 
bw, float bh) {
        vs = parent.vs;
!       whcoordsys = vs.coords.coordsys(parent.whcoordsys, 0, bx, by, 1, 1);
        unitcoordsys = -1;
        w = bw;
        h = bh;
--- 82,88 ----
       */
      public void setSubWH(Box parent, Object key, float bx, float by, float 
bw, float bh) {
        vs = parent.vs;
!       whcoordsys = vs.orthoCS(parent.whcoordsys, key, 0, bx, by, 1, 1);
        unitcoordsys = -1;
        w = bw;
        h = bh;
Index: gzz/gzz/vob/HBox.java
diff -c gzz/gzz/vob/HBox.java:1.8 gzz/gzz/vob/HBox.java:1.9
*** gzz/gzz/vob/HBox.java:1.8   Tue Oct  1 09:06:10 2002
--- gzz/gzz/vob/HBox.java       Tue Oct 15 09:29:19 2002
***************
*** 31,37 ****
   */
  
  public interface HBox {
! String rcsid = "$Id: HBox.java,v 1.8 2002/10/01 13:06:10 benja Exp $";
  
      float getWidth(float scale);
  
--- 31,37 ----
   */
  
  public interface HBox {
! String rcsid = "$Id: HBox.java,v 1.9 2002/10/15 13:29:19 tjl Exp $";
  
      float getWidth(float scale);
  
***************
*** 91,97 ****
        public void place(VobScene vs, int coordsys, float scale) {
            this.scale = scale;
              float w = getWidth(scale), h = getHeight(scale)+getDepth(scale);
!             int cs_wh = vs.coords.coordsys(0, 0, 0, 0, w, h);
              ((DefaultVobMatcher)vs.matcher).addSub(coordsys, cs_wh, WH_KEY);
              
            vs.map.put(this, coordsys, cs_wh);
--- 91,97 ----
        public void place(VobScene vs, int coordsys, float scale) {
            this.scale = scale;
              float w = getWidth(scale), h = getHeight(scale)+getDepth(scale);
!             int cs_wh = vs.coords.ortho(0, 0, 0, 0, w, h);
              ((DefaultVobMatcher)vs.matcher).addSub(coordsys, cs_wh, WH_KEY);
              
            vs.map.put(this, coordsys, cs_wh);
Index: gzz/gzz/vob/HBroken.java
diff -c gzz/gzz/vob/HBroken.java:1.7 gzz/gzz/vob/HBroken.java:1.8
*** gzz/gzz/vob/HBroken.java:1.7        Sun Sep 29 10:53:45 2002
--- gzz/gzz/vob/HBroken.java    Tue Oct 15 09:29:19 2002
***************
*** 73,79 ****
                HBox box = chain.getBox(j);
                Object key = box.getKey();
  
!               int cs = vs.coordsys(coordsys, key, 0, x, y, 2, 2);
                box.place(vs, cs, scale);
  
                x += box.getWidth(scale);
--- 73,79 ----
                HBox box = chain.getBox(j);
                Object key = box.getKey();
  
!               int cs = vs.orthoCS(coordsys, key, 0, x, y, 2, 2);
                box.place(vs, cs, scale);
  
                x += box.getWidth(scale);
Index: gzz/gzz/vob/LinebreakingUtil.java
diff -c gzz/gzz/vob/LinebreakingUtil.java:1.8 
gzz/gzz/vob/LinebreakingUtil.java:1.9
*** gzz/gzz/vob/LinebreakingUtil.java:1.8       Sun Sep 29 10:53:45 2002
--- gzz/gzz/vob/LinebreakingUtil.java   Tue Oct 15 09:29:19 2002
***************
*** 27,33 ****
   */
  
  public class LinebreakingUtil {
! String rcsid = "$Id: LinebreakingUtil.java,v 1.8 2002/09/29 14:53:45 benja 
Exp $";
  
      public static final int GLUE_LENGTH = 0;
      public static final int GLUE_STRETCH = 1;
--- 27,33 ----
   */
  
  public class LinebreakingUtil {
! String rcsid = "$Id: LinebreakingUtil.java,v 1.9 2002/10/15 13:29:19 tjl Exp 
$";
  
      public static final int GLUE_LENGTH = 0;
      public static final int GLUE_STRETCH = 1;
***************
*** 116,122 ****
            curwid = (int)dw;
            over = dw - curwid;
  
!           int boxcs = into.coordsys(cs, boxes[i].getKey(), d,
                    x + wid, y - curhei, 2, 2); //curwid, curhei + curdep);
  
            boxes[i].place(into, boxcs, scale);
--- 116,122 ----
            curwid = (int)dw;
            over = dw - curwid;
  
!           int boxcs = into.orthoCS(cs, boxes[i].getKey(), d,
                    x + wid, y - curhei, 2, 2); //curwid, curhei + curdep);
  
            boxes[i].place(into, boxcs, scale);
Index: gzz/gzz/vob/OrthoCoorder.java
diff -c gzz/gzz/vob/OrthoCoorder.java:1.34 gzz/gzz/vob/OrthoCoorder.java:1.35
*** gzz/gzz/vob/OrthoCoorder.java:1.34  Fri Sep 27 05:48:17 2002
--- gzz/gzz/vob/OrthoCoorder.java       Tue Oct 15 09:29:19 2002
***************
*** 28,34 ****
   */
  
  public class OrthoCoorder extends VobCoorder {
! public static final String rcsid = "$Id: OrthoCoorder.java,v 1.34 2002/09/27 
09:48:17 tjl Exp $";
      public static boolean dbg = false;
      private static void p(String s) { if(dbg) pa(s); }
      private static void pa(String s) { System.err.println(s); }
--- 28,34 ----
   */
  
  public class OrthoCoorder extends VobCoorder {
! public static final String rcsid = "$Id: OrthoCoorder.java,v 1.35 2002/10/15 
13:29:19 tjl Exp $";
      public static boolean dbg = false;
      private static void p(String s) { if(dbg) pa(s); }
      private static void pa(String s) { System.err.println(s); }
***************
*** 102,112 ****
      OrthoCoordsys sys;
      float maxdepth = 0;
  
!     public int coordsys(int into, float depth, float x, float y,
                                                           float w, float h) {
        if(maxdepth < depth) maxdepth = depth;
        return sys.add(into, depth, x, y, w, h);
      }
  
      /** Remove all rectangles (except root rect);
       *  start creating new coordsys from start.
--- 102,118 ----
      OrthoCoordsys sys;
      float maxdepth = 0;
  
!     public int ortho(int into, float depth, float x, float y,
                                                           float w, float h) {
        if(maxdepth < depth) maxdepth = depth;
        return sys.add(into, depth, x, y, w, h);
      }
+ 
+     public void setOrthoParams(int cs, float depth,
+               float x, float y, float w, float h) {
+       sys.setParams(cs, depth, x, y, w, h);
+     }
+ 
  
      /** Remove all rectangles (except root rect);
       *  start creating new coordsys from start.
Index: gzz/gzz/vob/OrthoCoordsys.java
diff -c gzz/gzz/vob/OrthoCoordsys.java:1.5 gzz/gzz/vob/OrthoCoordsys.java:1.6
*** gzz/gzz/vob/OrthoCoordsys.java:1.5  Wed Sep 25 10:45:43 2002
--- gzz/gzz/vob/OrthoCoordsys.java      Tue Oct 15 09:29:19 2002
***************
*** 65,70 ****
--- 65,84 ----
                                                    float mw, float mh) {
        int cs = next();
  
+         parent[cs] = mparent;
+       setParams(cs, mdepth, mx, my, mw, mh);
+ 
+         nancestors[cs] = nancestors[mparent] + 1;
+ 
+       nextHashtableEntry[cs] = 0;
+ 
+       return cs;
+     }
+ 
+     void setParams(int cs, float mdepth, float mx, float my, 
+                       float mw, float mh) {
+       int mparent = parent[cs];
+ 
        w[cs] = mw;
        h[cs] = mh;
  
***************
*** 73,84 ****
        x[cs] = x[mparent] + mx;
        y[cs] = y[mparent] + my;
  
-         parent[cs] = mparent;
-         nancestors[cs] = nancestors[mparent] + 1;
  
-       nextHashtableEntry[cs] = 0;
- 
-       return cs;
      }
  
      protected int next() {
--- 87,93 ----
Index: gzz/gzz/vob/VobCoorder.java
diff -c gzz/gzz/vob/VobCoorder.java:1.17 gzz/gzz/vob/VobCoorder.java:1.18
*** gzz/gzz/vob/VobCoorder.java:1.17    Sun Oct  6 11:08:02 2002
--- gzz/gzz/vob/VobCoorder.java Tue Oct 15 09:29:19 2002
***************
*** 30,35 ****
--- 30,37 ----
   * <p>
   * Coordinate systems are recursive; the coordinate system <code>0</code>
   * represents the root coordinate system (i.e., the whole vob scene).
+  * <p>
+  * Warn about setXParams!
   */
  public abstract class VobCoorder {
      /** Create a new coordinate system.
***************
*** 39,49 ****
       *             system into, <code>0</code> for the root
       *             coordinate system.
       */
!     abstract public int coordsys(int into, float depth, float x, float y, 
float w, float h);
  
!     public int translateXY(int into, float x, float y) {
!       return coordsys(into, 0, x, y, 1, 1);
      }
  
      abstract public int getCSIndexAt(float x, float y);
  
--- 41,71 ----
       *             system into, <code>0</code> for the root
       *             coordinate system.
       */
!     abstract public int ortho(int into, float depth, float x, float y, float 
w, float h);
  
!     public int translate(int into, float x, float y) {
!       return ortho(into, 0, x, y, 1, 1);
      }
+     public int translate(int into, float x, float y, float z) {
+       return ortho(into, z, x, y, 1, 1);
+     }
+     public int scale(int into, float sx, float sy) {
+       return ortho(into, 0, 0, 0, sx, sy);
+     }
+ 
+     abstract public void setOrthoParams(int into, float depth, float x, float 
y, float w, float h);
+ 
+     public void setTranslateParams(int into, float x, float y) {
+       setOrthoParams(into, 0, x, y, 1, 1);
+     }
+     public void setTranslateParams(int into, float x, float y, float z) {
+       setOrthoParams(into, z, x, y, 1, 1);
+     }
+     public void setScaleParams(int into, float sx, float sy) {
+       setOrthoParams(into, 0, 0, 0, sx, sy);
+     }
+ 
+ 
  
      abstract public int getCSIndexAt(float x, float y);
  
Index: gzz/gzz/vob/VobMatcher.java
diff -c gzz/gzz/vob/VobMatcher.java:1.3 gzz/gzz/vob/VobMatcher.java:1.4
*** gzz/gzz/vob/VobMatcher.java:1.3     Mon Sep 30 18:20:28 2002
--- gzz/gzz/vob/VobMatcher.java Tue Oct 15 09:29:19 2002
***************
*** 31,37 ****
       * Used in idiom like
       * <pre>cs = vs.matcher.add(vs.coords.affineCoordsys(...), "Foo")
       * </pre>
!      * @return cs.
       */
      int add(int cs, Object key); // called by VobScene.put &c.
      /** 
--- 31,37 ----
       * Used in idiom like
       * <pre>cs = vs.matcher.add(vs.coords.affineCoordsys(...), "Foo")
       * </pre>
!      * @return cs, for the above idiom.
       */
      int add(int cs, Object key); // called by VobScene.put &c.
      /** 
Index: gzz/gzz/vob/VobScene.java
diff -c gzz/gzz/vob/VobScene.java:1.11 gzz/gzz/vob/VobScene.java:1.12
*** gzz/gzz/vob/VobScene.java:1.11      Wed Sep 25 10:45:43 2002
--- gzz/gzz/vob/VobScene.java   Tue Oct 15 09:29:19 2002
***************
*** 46,51 ****
--- 46,56 ----
      public final gzz.client.GraphicsAPI gfxapi;
      public final gzz.client.GraphicsAPI.Window window;
  
+     private final AffineVobCoorder af() {
+       if(coords instanceof AffineVobCoorder)
+           return (AffineVobCoorder)coords;
+       throw new gzz.errors.NotAffineVobCoorderException();
+     }
  
      public final Dimension size;
      public VobScene(VobMap m, VobCoorder c, VobMatcher mat,
***************
*** 59,64 ****
--- 64,94 ----
        this.window = window;
        this.size = size;
      }
+ 
+     final public int orthoCS(int into, Object key, float depth, 
+                               float x, float y, float w, float h) {
+       return matcher.addSub(into, coords.ortho(into,
+                       depth, x, y, w, h), key);
+     }
+     final public int translateCS(int into, Object key, float x, float y) {
+       return matcher.addSub(into, coords.translate(into, x, y), key);
+     }
+     public int translateCS(int into, Object key, 
+                   float x, float y, float z) {
+       return matcher.addSub(into, coords.translate(into, x, y, z), key);
+     }
+     public int scaleCS(int into, Object key, float sx, float sy) {
+       return matcher.addSub(into, coords.scale(into, sx, sy), key);
+     }
+     // Affine
+     public int rotateCS(int into, Object key, float degrees) {
+       return matcher.addSub(into, af().rotate(into, degrees), key);
+     }
+     public int scaleCS(int into, Object key, 
+                           float sx, float sy, float sz) {
+       return matcher.addSub(into, af().scale(into, sx, sy, sz), key);
+     }
+ 
      /** Determines size of the area designated for the <code>Vob</code>s.
       *  At least at the moment doesn't include margins.
       * Coordinates of the scene's
***************
*** 74,89 ****
        put(v, null, d, x, y, w, h);
      }
      public void put(Vob v, Object key, float d, float x, float y, float w, 
float h) {
!       int c = coords.coordsys(0, d, x, y, w, h);
        if(key != null)
            matcher.add(c, key);
        map.put(v, c);
-     }
- 
-     public int coordsys(int into, Object key, float d, float x, float y, 
float w, float h) {
-       int cs = coords.coordsys(into, d, x, y, w, h);
-       matcher.addSub(into, cs, key);
-       return cs;
      }
  
      public Object getKeyAt(float x, float y, float[] targetcoords) {
--- 104,113 ----
        put(v, null, d, x, y, w, h);
      }
      public void put(Vob v, Object key, float d, float x, float y, float w, 
float h) {
!       int c = coords.ortho(0, d, x, y, w, h);
        if(key != null)
            matcher.add(c, key);
        map.put(v, c);
      }
  
      public Object getKeyAt(float x, float y, float[] targetcoords) {
Index: gzz/test/gzz/gfx/gl/basicrender.test
diff -c gzz/test/gzz/gfx/gl/basicrender.test:1.4 
gzz/test/gzz/gfx/gl/basicrender.test:1.5
*** gzz/test/gzz/gfx/gl/basicrender.test:1.4    Tue Oct 15 06:50:12 2002
--- gzz/test/gzz/gfx/gl/basicrender.test        Tue Oct 15 09:29:19 2002
***************
*** 1,3 ****
--- 1,5 ----
+ needGL()
+ 
  from gzz.vob import *
  from java.awt import Color
  from gzz.gfx.gl import GL, GLCache
Index: gzz/test/gzz/vob/TestVobScene.java
diff -c gzz/test/gzz/vob/TestVobScene.java:1.13 
gzz/test/gzz/vob/TestVobScene.java:1.14
*** gzz/test/gzz/vob/TestVobScene.java:1.13     Thu Sep 26 07:54:07 2002
--- gzz/test/gzz/vob/TestVobScene.java  Tue Oct 15 09:29:19 2002
***************
*** 29,35 ****
   */
  
  abstract public class TestVobScene extends TestCase {
! String rcsid = "$Id: TestVobScene.java,v 1.13 2002/09/26 11:54:07 benja Exp 
$";
      static boolean dbg = false;
  
      public TestVobScene(String s) { super(s); }
--- 29,35 ----
   */
  
  abstract public class TestVobScene extends TestCase {
! String rcsid = "$Id: TestVobScene.java,v 1.14 2002/10/15 13:29:19 tjl Exp $";
      static boolean dbg = false;
  
      public TestVobScene(String s) { super(s); }
***************
*** 107,113 ****
      public void testGetRenderinfo() {
        VobScene scene = createVobScene();
        VobCoorder coorder = scene.coords;
!       int cs = scene.coordsys(0, "1", 10, 20, 30, 40, 50);
  
        Vob.RenderInfo info = coorder.getRenderInfo(cs);
        assertNotNull(info);
--- 107,113 ----
      public void testGetRenderinfo() {
        VobScene scene = createVobScene();
        VobCoorder coorder = scene.coords;
!       int cs = scene.orthoCS(0, "1", 10, 20, 30, 40, 50);
  
        Vob.RenderInfo info = coorder.getRenderInfo(cs);
        assertNotNull(info);




reply via email to

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