17 |
|
|
18 |
import java.util.Iterator; |
import java.util.Iterator; |
19 |
|
|
20 |
/** A View2D on a PP-like canvas. |
/** A View2D of a CANVAS2D, with a given node function. |
21 |
*/ |
*/ |
22 |
public class CanvasView2D extends View2D { |
public class CanvasView2D extends View2D implements NodedView2D{ |
23 |
public static final String rcsid = "$Id$"; |
public static final String rcsid = "$Id$"; |
24 |
public static boolean dbg = false; |
public static boolean dbg = false; |
25 |
private static void pa(String s) { System.out.println("CanvasView2D::"+s); } |
private static void pa(String s) { System.out.println("CanvasView2D::"+s); } |
64 |
x, y, 1, 1, |
x, y, 1, 1, |
65 |
p.getWidth(), p.getHeight()); |
p.getWidth(), p.getHeight()); |
66 |
vs.matcher.add(matchingParent, cs, matchKey); |
vs.matcher.add(matchingParent, cs, matchKey); |
67 |
|
vs.activate(cs); |
68 |
if(cull) { |
if(cull) { |
69 |
cs = vs.cullCS(cs, "CULL", box2screen); |
cs = vs.cullCS(cs, "CULL", box2screen); |
70 |
} |
} |
72 |
} |
} |
73 |
if (dbg) pa("Canvas DONE"); |
if (dbg) pa("Canvas DONE"); |
74 |
} |
} |
75 |
|
|
76 |
|
public Object getNode(VobScene oldvs, |
77 |
|
int x, int y, |
78 |
|
Object plane, int matchingParent, |
79 |
|
int box2screen, int box2plane, |
80 |
|
float[] xyout) { |
81 |
|
int cs = oldvs.getCSAt(box2screen, x, y, xyout); |
82 |
|
if(cs <= 1) return null; |
83 |
|
Pair p = (Pair)oldvs.matcher.getKey(cs); |
84 |
|
return p.second; |
85 |
|
} |
86 |
} |
} |