gzz-commits
[Top][All Lists]
Advanced

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

Re: [Gzz-commits] gzz/gzz gfx/gl/GLVobCoorder.java modules/pp/PPV...


From: Tuomas Lukka
Subject: Re: [Gzz-commits] gzz/gzz gfx/gl/GLVobCoorder.java modules/pp/PPV...
Date: Sat, 8 Feb 2003 17:26:50 +0200
User-agent: Mutt/1.4i

On Sat, Feb 08, 2003 at 05:19:21AM -0500, Matti Katila wrote:
>  public final class GLVobCoorder extends AffineVobCoorder {
> -public static final String rcsid = "$Id: GLVobCoorder.java,v 1.67 2003/02/06 
> 11:53:14 tjl Exp $";
> +public static final String rcsid = "$Id: GLVobCoorder.java,v 1.68 2003/02/08 
> 10:19:20 mudyc Exp $";
>      public static boolean dbg = false;
>      private static void pa(String s) { System.err.println(s); }
>  
> -    float[] floats = new float[10000];
> +    float[] floats = new float[10000*2];
>      int nfloats = 0;
>  
> -    int[] inds = new int[5000];
> +    int[] inds = new int[5000*2];
>      int ninds = 1; // zero is special (the root)

Is there a reason for 10000*2 and not 20000? Please try to keep the code simple.

> Index: gzz/gzz/view/CoordinatePlaneView.java
> diff -u gzz/gzz/view/CoordinatePlaneView.java:1.11 
> gzz/gzz/view/CoordinatePlaneView.java:1.12
> --- gzz/gzz/view/CoordinatePlaneView.java:1.11        Wed Feb  5 08:34:43 2003
> +++ gzz/gzz/view/CoordinatePlaneView.java     Sat Feb  8 05:19:20 2003
> @@ -25,8 +25,7 @@
>  import gzz.*;
>  import gzz.vob.*;
>  import gzz.vob.vobs.*;
> -import gzz.vob.*;
> -import gzz.vob.vobs.*;
> +import gzz.view.*;
>  
>  import gzz.gfx.gl.GLVobCoorder;
>  
> @@ -37,8 +36,8 @@
>   */
>  
>  public class CoordinatePlaneView implements View {
> -public static final String rcsid = "$Id: CoordinatePlaneView.java,v 1.11 
> 2003/02/05 13:34:43 mudyc Exp $";
> -    public static boolean dbg = true;
> +public static final String rcsid = "$Id: CoordinatePlaneView.java,v 1.12 
> 2003/02/08 10:19:20 mudyc Exp $";
> +    public static boolean dbg = false;
>      private static void pa(String s) { System.err.println(s); }
>  
>      private Dim d_rank;

> @@ -53,6 +52,20 @@
>      /** Get the box into which the cursor cell was placed.
>       */
>      public int getCursorBox() { return cursorBox; }
> +
> +    /** Next generation of PP doens't set accursed when drawing the paper 
> +     */
> +    public void render(VobScene vs, int into, ViewContext context, int 
> cullCS, Cell accursed) {
> +     // push 
> +     Cell temp = context.getAccursed();
> +     ((AbstractViewContext)context).setAccursed(accursed);
> +
> +     // render
> +     render(vs, into, context, cullCS);
> +
> +     // pop
> +     ((AbstractViewContext)context).setAccursed(temp);
> +    }

Why does it not? The zzNodes classes do, and these could as well. Putting this
in coordinateplaneview is ugly.


>      public void render(VobScene vs, int into, ViewContext context) {
>       render(vs, into, context, -1);
> Index: gzz/gzz/view/buoy/AbstractAnimationNode.java
> diff -u gzz/gzz/view/buoy/AbstractAnimationNode.java:1.1 
> gzz/gzz/view/buoy/AbstractAnimationNode.java:1.2
> --- gzz/gzz/view/buoy/AbstractAnimationNode.java:1.1  Fri Feb  7 15:10:53 2003
> +++ gzz/gzz/view/buoy/AbstractAnimationNode.java      Sat Feb  8 05:19:20 2003
> @@ -6,36 +6,39 @@
>  import java.awt.event.MouseEvent;
>  
>  public abstract class AbstractAnimationNode implements BuoyViewMainNode {
> -private static final String rcsid = "$Id: AbstractAnimationNode.java,v 1.1 
> 2003/02/07 20:10:53 mudyc Exp $";  
> +private static final String rcsid = "$Id: AbstractAnimationNode.java,v 1.2 
> 2003/02/08 10:19:20 mudyc Exp $";  
>      public static boolean dbg = false;
>      private static void pa(String s) { 
> System.out.println("AbstractAnimationNode:"+s); }
>  
> -
>      private boolean makeAnimationFromSomething = false;
> -    
> +    private final int fromCS;
> +
>      public AbstractAnimationNode() {
> +     makeAnimationFromSomething = false;
> +     this.fromCS = -1;
> +    }
> + 
> +    public AbstractAnimationNode(int fromCS) {
>       makeAnimationFromSomething = true;
> +     this.fromCS = fromCS;
>      }
>  
>      
>      public void renderMain(VobScene vs, int into) {
> -
> -     int fromXXX = 0;
> -
>       if (makeAnimationFromSomething) {
>           ((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(into, 
> -             fromXXX);
> +             fromCS);
>           makeAnimationFromSomething = false;
>       }
>      }
>  
>      public void keystroke(String s) {
> -
> +     pa("override abstract keystroke");
>      }
>  
>  
>      public boolean mouse(MouseEvent e, VobScene oldVobScene) {
> -     pa("mouse e"+e);
> +     pa("override the abstract class,  mouse e"+e);
>  
>       return true;
>      }

Mudyc: I think this is the wrong approach: the intention is that all animation 
concerns
are handled by the Buoy*MANAGER*. No buoy should be concerned about it. That's 
one
of the crucially important features of the design, because it makes implementing
buoys much less hassle.

        Tuomas




reply via email to

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