/** * Sets the data storage to the given value. * * @param _griddata */ public void setGridData(GridData _griddata) { griddata = _griddata; if (griddata == null) { return; } nx = (interpolateLargeGrids && (griddata.getNx() > maxGridSize)) ? 32 : griddata.getNx(); ny = (interpolateLargeGrids && (griddata.getNy() > maxGridSize)) ? 32 : griddata.getNy(); internalData = new double[nx][ny]; }
/** Updates the contour data. */ public void update() { if (griddata == null) { return; } if ((interpolateLargeGrids && (nx != griddata.getNx())) || (ny != griddata.getNy())) { updateInterpolated(griddata); } else { updateDirect(griddata); } colorMap.updateLegend(zMap); }
private void copyData(double val[][]) { if ((griddata != null) && !(griddata instanceof ArrayData)) { throw new IllegalStateException( "SetAll only supports ArrayData for data storage."); //$NON-NLS-1$ } if ((griddata == null) || (griddata.getNx() != val.length) || (griddata.getNy() != val[0].length)) { griddata = new ArrayData(val.length, val[0].length, 1); setGridData(griddata); } double[][] data = griddata.getData()[0]; int ny = data[0].length; for (int i = 0, nx = data.length; i < nx; i++) { System.arraycopy(val[i], 0, data[i], 0, ny); } }