4 |
import org.fenfire.view.lava.*; |
import org.fenfire.view.lava.*; |
5 |
import org.nongnu.libvob.*; |
import org.nongnu.libvob.*; |
6 |
import org.nongnu.libvob.gl.*; |
import org.nongnu.libvob.gl.*; |
7 |
|
import org.fenfire.util.lava.*; |
8 |
|
|
9 |
|
import java.util.*; |
10 |
|
|
11 |
/** View2D to draw the selecting area |
/** View2D to draw the selecting area |
12 |
*/ |
*/ |
44 |
pq = GLRen.createFixedPaperQuad(paper, 0, 0, 1, 1, 0, 10, 10, 10); |
pq = GLRen.createFixedPaperQuad(paper, 0, 0, 1, 1, 0, 10, 10, 10); |
45 |
} |
} |
46 |
|
|
47 |
int cs = -1; |
|
48 |
|
private CoordsysCache coords = new CoordsysCache(); |
49 |
|
|
50 |
public void render(VobScene vs, Object plane, |
public void render(VobScene vs, Object plane, |
51 |
int matchingParent, |
int matchingParent, |
55 |
child.render(vs, plane, matchingParent, |
child.render(vs, plane, matchingParent, |
56 |
box2screen, box2paper); |
box2screen, box2paper); |
57 |
|
|
|
if (current != plane) return; |
|
58 |
|
|
59 |
int paper2box = vs.invertCS(box2paper, "areaselectview_INv"); |
int paper2box = vs.invertCS(box2paper, "areaselectview_INv"); |
60 |
int paper2screen = vs.concatCS(box2screen, "areaselectview_conc", |
int paper2screen = vs.concatCS(box2screen, "areaselectview_conc", |
61 |
paper2box); |
paper2box); |
62 |
cs = vs.orthoCS(paper2screen, "selection", 0, 1,2,3,4); |
int cs = vs.orthoCS(paper2screen, "selection", 0, 1,2,3,4); |
63 |
chgFast(vs); |
Object key = vs.matcher.getKey(box2screen); |
64 |
vs.put(pq, cs); |
if (dbg) p("key b2s: "+vs.matcher.getKey(box2screen)); |
65 |
|
coords.set(key, cs); |
66 |
|
chgFast(vs, key); |
67 |
|
|
68 |
|
if (current != plane) return; |
69 |
|
if (dbg) p("ok, draw the selection!"+x0+","+y0+","+x1+","+y1); |
70 |
|
vs.put(pq, cs); |
71 |
} |
} |
72 |
|
|
73 |
public void chgFast(VobScene oldVS) { |
public void chgFast(VobScene oldVS, Object key) { |
74 |
oldVS.coords.setOrthoParams(cs, 0, x0,y0,x1-x0,y1-y0); |
if (dbg) p("key Fast: "+key); |
75 |
|
oldVS.coords.setOrthoParams(coords.get(key), 0, x0,y0,x1-x0,y1-y0); |
76 |
} |
} |
77 |
|
|
78 |
|
|