gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz ./TODO gzz/modules/pp/PPDims.java gzz/modul...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz ./TODO gzz/modules/pp/PPDims.java gzz/modul...
Date: Sun, 03 Nov 2002 23:35:39 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        02/11/03 23:35:39

Modified files:
        .              : TODO 
        gzz/modules/pp : PPDims.java PPView2.java demotest.py 
        gzz/view       : Cell1DBuoyHook.java 
        gzz/vob/impl   : DefaultVobMatcher.java 

Log message:
        Buoying...

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/TODO.diff?tr1=1.357&tr2=1.358&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/PPDims.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/PPView2.java.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/demotest.py.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/Cell1DBuoyHook.java.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/impl/DefaultVobMatcher.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: gzz/TODO
diff -u gzz/TODO:1.357 gzz/TODO:1.358
--- gzz/TODO:1.357      Sun Nov  3 13:41:46 2002
+++ gzz/TODO    Sun Nov  3 23:35:39 2002
@@ -104,6 +104,7 @@
            - refactor
                - implement using the new gzz.view classes
                    - buoys
+                   - buoy pan
                    - hopping to buoy - keying, animation
            - make it work again
                - bindings
@@ -113,6 +114,7 @@
            - nadir
            - fix directory geometry
            - HOME button
+       - PEG getCS(parent, key), affineCoordsys -> affine, +affineCS in 
VobScene
        - better graphics for xupdf and pp
            - fillets without the original object
                - normal direction as data
Index: gzz/gzz/modules/pp/PPDims.java
diff -u gzz/gzz/modules/pp/PPDims.java:1.2 gzz/gzz/modules/pp/PPDims.java:1.3
--- gzz/gzz/modules/pp/PPDims.java:1.2  Sun Oct 27 19:17:54 2002
+++ gzz/gzz/modules/pp/PPDims.java      Sun Nov  3 23:35:39 2002
@@ -37,7 +37,7 @@
        pan = 
space.getDim("0000000008000000E99BD882A20004A0AD6630BFDA693D810DED76CAE65DA9B7E873053466C52E-4");
        association = 
space.getDim("0000000008000000E99BD882A20004A0AD6630BFDA693D810DED76CAE65DA9B7E873053466C52E-7");
        d1 = space.getDim(Ids.d_1);
-       clone = space.getDim(Ids.d_clone);
+       clone = space.getCloneDim();
     }
 
 }
Index: gzz/gzz/modules/pp/PPView2.java
diff -u gzz/gzz/modules/pp/PPView2.java:1.5 gzz/gzz/modules/pp/PPView2.java:1.6
--- gzz/gzz/modules/pp/PPView2.java:1.5 Sun Nov  3 13:41:46 2002
+++ gzz/gzz/modules/pp/PPView2.java     Sun Nov  3 23:35:39 2002
@@ -4,13 +4,48 @@
 import gzz.modules.pp.vob.*;
 import gzz.gfx.gl.*;
 import gzz.vob.*;
+import gzz.vob.impl.*;
+import gzz.vob.buoy.*;
 import gzz.view.*;
 import gzz.*;
 import java.awt.Dimension;
 import gzz.client.GraphicsAPI;
+import gzz.util.Pair;
 
 public class PPView2 implements View {
 
+    // Geometry
+
+    /** The width of the main view.
+     */
+    public float mainWidth = 600;
+
+    /** The width of the left edge panel.
+     */
+    public float leftPanelWidth = 100;
+
+    /** The height of the main view.
+     */
+    public float mainHeight = 600;
+
+    /** The Y position of the main view.
+     */
+    public float mainY = 100;
+
+    /** Buoy floater settings.
+     */
+    public float buoyCenterY = 400, buoyRadius = 400;
+
+    /** Buoy viewport geometry.
+     */
+    public float buoyVPWidth = 400, buoyVPHeight = 400;
+
+    /** The center of the visible area.
+     */
+    float centerX(VobScene vs) { return (vs.size.width-leftPanelWidth)/2; }
+
+    // Current state
+
     /** The current zoom.
      * Pixels for 1 paper coordinate unit.
      */
@@ -20,6 +55,10 @@
      */
     public float panx=0, pany=0;
 
+    /** The zoom to be used for the buoys.
+     */
+    public float buoyZoom = 1;
+
     /** The scale of the background.
      * bgscale in paper coordinates = 1 in background coords.
      */
@@ -44,6 +83,9 @@
 
     CoordinatePlaneView coordinatePlaneView;
 
+    AbstractViewContext buoy_vc = new AbstractViewContext();
+    SinglePlane buoy_singlePlane;
+
     GraphicsAPI.Window window;
 
     /** A single PP plane, with given view context.
@@ -126,6 +168,40 @@
        }
     }
 
+
+    class BFloater implements Cell1DBuoyHook.Floater {
+       int dir;
+       VobScene vs;
+       Buoy4Floater floater;
+       BFloater(int dir, VobScene vs) {
+           this.dir = dir;
+           this.vs = vs;
+           floater = new CircleFloater4(vs, 0,
+               centerX(vs), buoyCenterY, buoyRadius,
+               centerX(vs) - dir * buoyRadius, buoyCenterY);
+       }
+       public void buoy(int anchor, Cell c, Cell connectedFrom) {
+           Object key ; 
+           if(dir > 0) 
+               key = new Pair(connectedFrom, c);
+           else
+               key = new Pair(c, connectedFrom);
+           int actr = vs.translateCS(vs.unitSqCS(anchor, "AUSQ"), "TR12",
+                           .5f, .5f);
+           int buoycs = floater.buoyCoordsys(actr, key);
+
+           int frameCS = vs.orthoBoxCS(buoycs, "frame", 0, 
+                   -buoyVPWidth/2, -buoyVPHeight, 1, 1, 
+                   buoyVPWidth, buoyVPHeight);
+           // XXX Pan
+           int c2fCS = vs.coords.ortho(0, 0, 0, 0, buoyZoom, buoyZoom);
+           vs.matcher.addSub(buoycs, c2fCS, "C2F");
+
+           buoy_vc.setAccursed(c);
+           buoy_singlePlane.render(vs, frameCS, c2fCS);
+       }
+    }
+
     public PPView2(Space space, GraphicsAPI.Window w) {
        this.space = space;
        this.d = new PPDims(space);
@@ -134,19 +210,41 @@
     }
 
     public void render(VobScene vs, int intoCS, ViewContext context) {
-       AbstractViewContext vc = new AbstractViewContext();
-       vc.setAccursed(context.getAccursed());
        TextStyle style = vs.gfxapi.getTextStyle("Sans", 0, 20);
-       vc.setCellView(new TextCellContentView(style));
+       CellInBox cellview = new TextCellContentView(style);
+
+       buoy_vc.setCellView(cellview);
+
+       buoy_singlePlane = new SinglePlane();
+       buoy_singlePlane.context = buoy_vc;
+
+       BFloater leftFloater = new BFloater(-1, vs);
+       BFloater rightFloater = new BFloater(1, vs);
+
+       AbstractViewContext main_vc = new AbstractViewContext();
+       main_vc.setAccursed(context.getAccursed());
+
+       main_vc.setCellView(
+               new CellInBoxPlugin(cellview,
+                                   new Cell1DBuoyHook(leftFloater, 
rightFloater,
+                                               d.clone, d.association)));
 
        Dimension size = vs.getSize();
        
        SinglePlane pl = new SinglePlane();
-       pl.context = vc;
+       pl.context = main_vc;
 
-       int frameCS = vs.orthoBoxCS(0, "frame", 0, 100, 100, 1, 1, 400, 400);
+       int mainctr = ((GLVobCoorder)vs.coords).affineCoordsys(0, 0,
+                   centerX(vs), mainY + mainHeight/2,
+                   1, 0, 0, 1);
+       vs.matcher.add(mainctr, "MAINVP");
+
+       int frameCS = vs.orthoBoxCS(mainctr, "frame", 0, 
+               (-mainWidth)/2, -mainHeight/2, 1, 1, 
+               mainWidth, mainHeight);
 
-       int c2fCS = vs.orthoCS(0, "C2F", 0, 0, 0, 10, 10);
+       int c2fCS = vs.coords.ortho(0, 0, 0, 0, 10, 10);
+       vs.matcher.addSub(mainctr, c2fCS, "C2F");
        setZoomPan(vs);
        pl.render(vs, frameCS, c2fCS);
 
@@ -157,7 +255,9 @@
      * This changes the parameters of the coordinate systems created by 
render().
      */
     public void setZoomPan(VobScene vs) {
-       int cs = vs.matcher.getCS("C2F");
+       DefaultVobMatcher m = (DefaultVobMatcher)vs.matcher;
+       int main = m.getCS("MAINVP");
+       int cs = m.getCS(main, "C2F");
        vs.coords.setOrthoParams(cs, 0, -panx*zoom, -pany*zoom, zoom, zoom);
     }
 }
Index: gzz/gzz/modules/pp/demotest.py
diff -u gzz/gzz/modules/pp/demotest.py:1.14 gzz/gzz/modules/pp/demotest.py:1.15
--- gzz/gzz/modules/pp/demotest.py:1.14 Sun Nov  3 13:41:46 2002
+++ gzz/gzz/modules/pp/demotest.py      Sun Nov  3 23:35:39 2002
@@ -157,7 +157,8 @@
            AbstractUpdateManager.setNoAnimation()
            AbstractUpdateManager.chg()
 
-gzz.view.CoordinatePlaneView.dbg = 1
+gzz.view.CoordinatePlaneView.dbg = 0
+gzz.view.Cell1DBuoyHook.dbg = 1
 
 # currentScene = PlaneViewScene()
 currentScene = PPView2Scene()
Index: gzz/gzz/view/Cell1DBuoyHook.java
diff -u gzz/gzz/view/Cell1DBuoyHook.java:1.5 
gzz/gzz/view/Cell1DBuoyHook.java:1.6
--- gzz/gzz/view/Cell1DBuoyHook.java:1.5        Fri Nov  1 20:23:45 2002
+++ gzz/gzz/view/Cell1DBuoyHook.java    Sun Nov  3 23:35:39 2002
@@ -33,7 +33,7 @@
  * XXX Tjl Doc
  */
 public class Cell1DBuoyHook implements CellPlacementHook {
-public static final String rcsid = "$Id: Cell1DBuoyHook.java,v 1.5 2002/11/02 
01:23:45 benja Exp $";
+public static final String rcsid = "$Id: Cell1DBuoyHook.java,v 1.6 2002/11/04 
04:35:39 tjl Exp $";
     public static boolean dbg = true;
     private static void pa(String s) { System.err.println(s); }
 
@@ -66,7 +66,7 @@
                assoc = assoc.s(d_clone)) {
            Cell left = assoc.s(d_assoc, -1);
            Cell right = assoc.s(d_assoc, 1);
-           if(dbg) pa("BUOYS: LINKS");
+           if(dbg) pa("BUOYS: LINKS "+c);
            if(dbg) pa("left: "+left+" right: "+right);
            if(right != null) {
                rightfloater.buoy(box, right.h(d_clone), c);
Index: gzz/gzz/vob/impl/DefaultVobMatcher.java
diff -u gzz/gzz/vob/impl/DefaultVobMatcher.java:1.1 
gzz/gzz/vob/impl/DefaultVobMatcher.java:1.2
--- gzz/gzz/vob/impl/DefaultVobMatcher.java:1.1 Fri Nov  1 20:23:46 2002
+++ gzz/gzz/vob/impl/DefaultVobMatcher.java     Sun Nov  3 23:35:39 2002
@@ -92,6 +92,11 @@
         return getCSByKeyObject(new Key(key, 0));
     }
 
+    public int getCS(int parent, Object key) {
+        if(key == null) key = NULL;
+        return getCSByKeyObject(new Key(key, parent));
+    }
+
     public Object getKey(int cs) {
        Object k = keyByCs[cs].key;
        return k == NULL ? null : k;




reply via email to

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