double ltmin = lnmin;
double ltmax = lnmax;
double lt;
double ln;
for (int i = 0; i < n; i++) {
OMPoly oj = (OMPoly) arcs.getOMGraphicAt(i);
if (oj == null)
continue;
E00Data data = (E00Data) oj.getAppObject();
if (data == null)
continue;
ll = oj.getLatLonArray();
llsize = ll.length;
if ((ll[0] != ll[llsize - 2]) || (ll[1] != ll[llsize - 1])) {
// contour non clos;
float[] coords = new float[] { ll[0], ll[1], ll[llsize - 2],
ll[llsize - 1] };
ArcData dn = new ArcData(data);
dn.coords = coords;
oj.setAppObject(dn);
V.add(dn);
}
int k = 0;
while (k < llsize) {
lt = ll[k++];
ln = ll[k++];
if (lt > ltmax)
ltmax = lt;
else if (lt < ltmin)
ltmin = lt;
if (ln > lnmax)
lnmax = ln;
else if (ln < lnmin)
lnmin = ln;
}
}
System.out.println("#minmax " + lnmin + " " + lnmax + " " + ltmin + " "
+ ltmax);
int unClosedCount = V.size();
ArcData[] unClosed = (ArcData[]) V.toArray(new ArcData[unClosedCount]);
V.clear();
V = null;
//chercher les connections;
ArcData d0;
//chercher les connections;
ArcData d1;
//chercher les connections;
ArcData d2;
//chercher les connections;
ArcData dx;
float lt1;
float lg1;
float lt2;
float lg2;
for (int i = 0; i < unClosedCount; i++) {
d0 = unClosed[i];
d0.deja = 0;
if (d0.type > 1)
continue;
lt1 = d0.coords[0];
lg1 = d0.coords[1];
lt2 = d0.coords[2];
lg2 = d0.coords[3];
for (int j = i + 1; j < unClosedCount; j++) {
d1 = unClosed[j];
if (d1.type > 1)
continue;
if ((lt1 == d1.coords[0]) && (lg1 == d1.coords[1])) {
d1.setC(d0);
d0.setC(d1);
} else if ((lt1 == d1.coords[2]) && (lg1 == d1.coords[3])) {
d1.setF(d0);
d0.setC(d1);
}
if ((lt2 == d1.coords[0]) && (lg2 == d1.coords[1])) {
d1.setC(d0);
d0.setF(d1);
} else if ((lt2 == d1.coords[2]) && (lg2 == d1.coords[3])) {
d1.setF(d0);
d0.setF(d1);
}
}
}
for (int k = 0; k < unClosedCount; k++) {
d0 = unClosed[k];
if ((d0.type != 0) || (d0.deja != 0))
continue;
if ((d0.c0 == null) && (d0.f0 == null))
continue;
d1 = d0;
d2 = (d1.c0 == null) ? d1.f0 : d1.c0;
System.out.print("#contour ");
System.out.print(d0.id);
System.out.print(' ');
int decount = unClosedCount * 3 / 2;
do {
System.out.print(d2.id);
if (d2.deja != 0)
System.out.print('*');
System.out.print(' ');
dx = d2.visit(d1);
d1 = d2;
d2 = dx;
if (decount-- < 0) {
System.out.print(" BOUCLE ");
break;
}
} while ((d2 != null) && (d2 != d0));
if (d2 == null)
System.out.print(" unclosed");
System.out.println();
System.out.println();
}
for (int i = 0; i < n; i++) {
OMPoly oj = (OMPoly) arcs.getOMGraphicAt(i);
if (oj == null)
continue;
E00Data data = (E00Data) oj.getAppObject();
if (data == null)
continue;
ll = oj.getLatLonArray();
llsize = ll.length;
double z = data.valeur * 0.304;
// double z2 = data.valeur2 * 0.304;
boolean closed = true;
// float[] coords = null;