// boolean major = grid.getMajor();
int dataPoint;
Color3f color;
SimpleColorGenerator generator = null;
OMGridGenerator tempGen = grid.getGenerator();
if (tempGen instanceof SimpleColorGenerator) {
generator = (SimpleColorGenerator) tempGen;
}
for (int j = 0; j < numRows - 1; j++) {
if (DEBUG) {
Debug.output("Creating strip " + j);
}
// I think the '-' should be '+'... (changed, DFD)
float lat1 = anchorLL.getLatitude() + ((float) j * vRes);
float lat2 = anchorLL.getLatitude() + (((float) j + 1f) * vRes);
for (int k = 0; k < numCols; k++) {
if (DEBUG) {
Debug.output(" working row " + k);
}
float lon = anchorLL.getLongitude() + ((float) k * hRes);
projection.forward(lat1, lon, p);
if (major) {
dataPoint = data[k][j];
} else {
dataPoint = data[j][k];
}
gridStrip.setCoordinate(pointer,
new Point3d((float) p.getX(), (float) dataPoint, (float) p.getY()));
if (DEBUG) {
Debug.output(" 1st coord " + p.getX() + ", "
+ dataPoint + ", " + p.getY());
}
projection.forward(lat2, lon, p);
if (major) {
dataPoint = data[k][j + 1];
} else {
dataPoint = data[j + 1][k];
}
gridStrip.setCoordinate(pointer + 1,
new Point3d((float) p.getX(), (float) dataPoint, (float) p.getY()));
if (DEBUG) {
Debug.output(" 2nd coord " + p.getX() + ", "
+ dataPoint + ", " + p.getY());
}
// Need the TriangleStripArray.COLOR_3 Attribute set
// above
if (generator == null) {
if (polyline) {
color = linecolor;
} else {
color = fillcolor;
}
} else {
color = new Color3f(new Color(generator.calibratePointValue(dataPoint)));
}
gridStrip.setColor(pointer++, color);
gridStrip.setColor(pointer++, color);
// else