gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/gzz/modules/pp2 PPCanvasCursor.java SingleP...


From: Matti Katila
Subject: [Gzz-commits] gzz/gzz/modules/pp2 PPCanvasCursor.java SingleP...
Date: Wed, 05 Feb 2003 09:46:08 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Matti Katila <address@hidden>   03/02/05 09:46:08

Modified files:
        gzz/modules/pp2: PPCanvasCursor.java 
Added files:
        gzz/modules/pp2: SinglePaper.java 

Log message:
        still steps only

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp2/SinglePaper.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp2/PPCanvasCursor.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: gzz/gzz/modules/pp2/PPCanvasCursor.java
diff -u gzz/gzz/modules/pp2/PPCanvasCursor.java:1.2 
gzz/gzz/modules/pp2/PPCanvasCursor.java:1.3
--- gzz/gzz/modules/pp2/PPCanvasCursor.java:1.2 Wed Feb  5 08:34:43 2003
+++ gzz/gzz/modules/pp2/PPCanvasCursor.java     Wed Feb  5 09:46:08 2003
@@ -40,7 +40,7 @@
 /** XXX
  */
 public class PPCanvasCursor implements BuoyViewMainNode {
-    private static final String rcsid = "$Id: PPCanvasCursor.java,v 1.2 
2003/02/05 13:34:43 mudyc Exp $";  
+    private static final String rcsid = "$Id: PPCanvasCursor.java,v 1.3 
2003/02/05 14:46:08 mudyc Exp $";  
     public static boolean dbg = false;
     private static void pa(String s) { System.out.println("BuoyAdaptor:"+s); }
 
@@ -115,51 +115,22 @@
      */
     public boolean showLinkbuoys = false;
 
-    // Visual characteristics of the virtual paper and ripple
-
-    /** The scale of the background.
-     * bgscale in paper coordinates = 1 in background coords.
-     */
-    public float bgscale = 200;
-
-    /** Border size of the irregularframe.
-     */
-    public float irreguBorder = 50;
-
-    /** Ripple length of irregularframe.
-     */
-    public float irreguRipple = 500;
-
-    /** For debugging: whether to use stencil or not.
-     */
-    public boolean useStencil = true;
-
-    Vob black = GLCache.getCallList("Color 0 0 0\n");
-
-    CoordinatePlaneView coordinatePlaneView;
-
-    GraphicsAPI.Window window;
 
 
 
 
 
-
-
-    private PPDims d;
     private Cell current;
     private AbstractViewContext avc;
+    private PPDims d;
+    private GraphicsAPI.Window window;
     public PPCanvasCursor(Cell c, AbstractViewContext avc, PPDims d, 
GraphicsAPI.Window w) {
        this.current = c;
        this.avc = avc;
        this.d = d;
        this.window = w;
-       this.coordinatePlaneView = new CoordinatePlaneView(d.contains, d.pan);
     }
 
-    TextStyle style = GraphicsAPI.getInstance().getTextStyle("Sans", 0, 20);
-    CellView cellview = new ImageCell(new PPCellView(style,
-        "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));
 
     public void renderMain(VobScene vs, int into) {
        int mainctr = vs.translateCS(0, "MAINVPCTR",
@@ -173,15 +144,11 @@
        // cell to frame CS
        int c2fCS = vs.coords.ortho(0, 0, 0, 0, 10, 10);
        vs.matcher.add(frameCS, c2fCS, "C2F");
-       
-       SinglePlane plane = new SinglePlane();
-       plane.context = avc;
-       ((AbstractViewContext)plane.context).setCellView(cellview);
-       plane.render(vs, frameCS, c2fCS);
-           
+       SinglePaper.i(avc, d, window).render(vs, frameCS, c2fCS);
     }
 
     public void keystroke(String s) {
+
     }
 
 
@@ -191,96 +158,5 @@
 
 
 
-
-
-
-
-    /** A single PP plane, with given view context.
-     * This class takes care of drawing the stencil, 
-     * the background and the vobs inside the plane.
-     */
-    class SinglePlane {
-       ViewContext context;
-       /** Render the plane.
-        * @param frameCS The Box-coordinate system of the frame.
-        *           The scale is assumed to be single pixels (although
-        *           for example buoys will set this differently).
-        *           The height and width define the viewport.
-        * @param panZoom The coordinate system from virtual paper coordinates
-        *              to panned-and-zoomed coordinates. 
-        *              The origin of the panned-and-zoomed coordinates
-        *              will be set to the center of the frameCS, and
-        *              the scale is 1 to 1 pixel.
-        */
-       void render(final VobScene vs, final int frameCS, final int panZoom) {
-           final GLVobCoorder glc = (GLVobCoorder)vs.coords;
-           float[] sqs = new float[2];
-           glc.getSqSize(frameCS, sqs);
-           if (sqs[1] < 5) return;
-           if (dbg) pa("Sqs frame: "+sqs[0]+" "+sqs[1]);
-
-           // CS from center of frameCS to screen
-           int framecenterCS = vs.translateCS(frameCS, "FCTR", sqs[0]/2, 
sqs[1]/2);
-
-           // CS from virtualpaper to screen
-           final int paper2screen = glc.concat(framecenterCS, panZoom);
-           vs.matcher.add(frameCS, paper2screen, "PAPER2S");
-           final int bg2screen = vs.scaleCS(paper2screen, "BGSCA", 
-                                       bgscale, bgscale);
-   
-           final Cell cursor = context.getAccursed();
-           final Cell plane = cursor.h(d.contains);
-
-           // BgVob takes two coordsys:
-           // frame2screen and paper2screen
-           final BgVob bg = BgVob.create(plane, window);
-
-           final IrregularFrame f = 
IrregularFrame.create(-16000,-16000,16000,16000,
-                                       irreguBorder, irreguRipple, 2);
-
-           final int frameUnit = vs.unitSqCS(frameCS, "USQ");
-
-           // Irregu needs frame 2 paper
-           final int screen2paper = glc.invert(paper2screen);
-           vs.matcher.add(paper2screen, screen2paper, "INVER2S");
-           final int frameUnit2paper = glc.concat(screen2paper, frameUnit);
-           vs.matcher.add(screen2paper, frameUnit2paper, "f2pap");
-
-           final int paper2screen_shifted = vs.translateCS(paper2screen,
-                           "SHIFTUP",
-                               0, 0, -30);
-
-           class Putter implements Runnable {
-               Vob v;
-               Putter(Vob v) { this.v = v; }
-               public void run() {
-                   vs.map.put(v, paper2screen, frameUnit2paper);
-               }
-           }
-
-           Runnable placeContent = new Runnable() {
-                       public void run() {
-                           // XXX Unclean!
-                           // vs.map.put(bg, frameUnit, bg2screen);
-                           bg.put(vs, frameUnit, bg2screen);
-                           vs.map.put(black);
-                           coordinatePlaneView.render(vs, 
paper2screen_shifted, context, frameCS);
-                       }};
-
-           if(useStencil)
-               Stencil.drawStenciled(vs, 
-                       new Putter(f.getContent()),
-                       new Putter(f.getBlank()),
-                       new Putter(f.getFrame()),
-                       placeContent,
-                       true);
-           else {
-               (new Putter(f.getContent())).run();
-               (new Putter(f.getFrame())).run();
-               (new Putter(f.getBlank())).run();
-               placeContent.run();
-           }
-       }
-    }
 }
 




reply via email to

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