51 |
|
|
52 |
public int getCSAt(int parent, float x, float y, float[] targetcoords) { |
public int getCSAt(int parent, float x, float y, float[] targetcoords) { |
53 |
int[] inds = GL.getAllCSAt(ninds, this.inds, floats, parent, x, y); |
int[] inds = GL.getAllCSAt(ninds, this.inds, floats, parent, x, y); |
54 |
|
|
55 |
|
if (dbg) { |
56 |
|
for (int i=0; i<inds.length; i++) { |
57 |
|
pa("original: "+getCoordSystemStr(inds[i])); |
58 |
|
pa("parent: "+ getCoordSystemStr(getParent(inds[i]))); |
59 |
|
} |
60 |
|
} |
61 |
|
|
62 |
for(int i=0; i<inds.length; i++) |
for(int i=0; i<inds.length; i++) |
63 |
if(isNearestActiveAncestor(inds[i], parent)) { |
if(isNearestActiveAncestor(inds[i], parent)) { |
64 |
int cs = inds[i]; |
int cs = inds[i]; |
93 |
return inds[cs+1]; |
return inds[cs+1]; |
94 |
} |
} |
95 |
|
|
96 |
|
// For at least debugging purposes. |
97 |
|
public String getCoordSystemStr(int cs) { |
98 |
|
if (cs < 0 || cs >= 5000) return "Out of index!"; |
99 |
|
String cs_str = null; |
100 |
|
|
101 |
|
switch(inds[cs]) { |
102 |
|
case 1: cs_str = "Affine"; break; |
103 |
|
case 2: cs_str = "Rotation"; break; |
104 |
|
case 3: cs_str = "Distort"; break; |
105 |
|
case 4: cs_str = "Rotation xyz"; break; |
106 |
|
case 5: cs_str = "Rotation xyz"; break; |
107 |
|
case 6: cs_str = "Translation xyz"; break; |
108 |
|
case 7: cs_str = "BuoyOnCircle"; break; |
109 |
|
case 8: cs_str = "Concat"; break; |
110 |
|
case 9: cs_str = "Nadir"; break; |
111 |
|
case 10: cs_str = "Culling"; break; |
112 |
|
case 11: cs_str = "Box"; break; |
113 |
|
case 12: cs_str = "unitSq"; break; |
114 |
|
case 14: cs_str = "OrthoBox"; break; |
115 |
|
case 15: cs_str = "Invert"; break; |
116 |
|
} |
117 |
|
if (cs_str == null) return "CoordSystem: "+cs+" not defined."; |
118 |
|
else return cs_str; |
119 |
|
} |
120 |
|
|
121 |
|
|
122 |
public int affineCoordsys( |
public int affineCoordsys( |
123 |
int into, float depth, |
int into, float depth, |
124 |
float cx, float cy, |
float cx, float cy, |