46 |
* } |
* } |
47 |
* </pre> |
* </pre> |
48 |
*/ |
*/ |
49 |
public class Box { |
public class Box implements Cloneable { |
50 |
/** The key used to put the unitcoordsys under whcoordsys. |
/** The key used to put the unitcoordsys under whcoordsys. |
51 |
*/ |
*/ |
52 |
static public final Object UNITCOORDSYSKEY = new Object(); |
static public final Object UNITCOORDSYSKEY = new Object(); |
60 |
int culledwhcoordsys; |
int culledwhcoordsys; |
61 |
int unitcoordsys; |
int unitcoordsys; |
62 |
|
|
63 |
|
public String toString() { |
64 |
|
return "[Box: "+vs+" "+w+" "+h+" "+whcoordsys+" "+culledwhcoordsys+" "+ |
65 |
|
unitcoordsys+"]\n"; |
66 |
|
} |
67 |
|
|
68 |
/** Set this box to a new box. |
/** Set this box to a new box. |
69 |
* @param vs The vobscene to use |
* @param vs The vobscene to use |
84 |
this.cullTo = cull; |
this.cullTo = cull; |
85 |
} |
} |
86 |
|
|
87 |
|
/** Activate the unitcoordsys of this box. |
88 |
|
* Convenience; defined to be equivalent to |
89 |
|
* <pre> |
90 |
|
* vs.activate(getUnitCoordsys()) |
91 |
|
* </pre> |
92 |
|
*/ |
93 |
|
public void activate() { |
94 |
|
vs.activate(getUnitCoordsys()); |
95 |
|
} |
96 |
|
|
97 |
/** Create the unit square coordsys. |
/** Create the unit square coordsys. |
98 |
*/ |
*/ |
113 |
*/ |
*/ |
114 |
public int getWHCoordsys() { |
public int getWHCoordsys() { |
115 |
if(cullTo >= 0) { |
if(cullTo >= 0) { |
116 |
// XXX Fill in when three-component cull is done |
if(culledwhcoordsys < 0) |
117 |
// if(culledwhcoordsys < 0) |
culledwhcoordsys = |
118 |
// culledwhcoordsys = vs. |
((gzz.gfx.gl.GLVobCoorder)vs.coords).cull( |
119 |
|
whcoordsys, getUnitCoordsys(), cullTo); |
120 |
|
return culledwhcoordsys; |
121 |
} |
} |
122 |
return whcoordsys; |
return whcoordsys; |
123 |
} |
} |
140 |
h = bh; |
h = bh; |
141 |
} |
} |
142 |
|
|
143 |
|
public Object clone() { |
144 |
|
try { |
145 |
|
return super.clone(); |
146 |
|
} catch(Exception e) { |
147 |
|
return null; |
148 |
|
} |
149 |
|
} |
150 |
|
|
151 |
} |
} |