@Test public void testPropertiesParsedOkAsciiFormat() throws Exception { classUnderTest.doLoadData(ASCII_FILE, parentLayer); assertEquals("test_sgrid_ascii__ascii@@", TestUtils.getField(classUnderTest, "asciiDataFile", String.class)); assertEquals(null, TestUtils.getField(classUnderTest, "pointsDataFile", String.class)); assertEquals((Integer)0, TestUtils.getField(classUnderTest, "pointsOffset", Integer.class)); assertEquals("test_sgrid_ascii__flags@@", TestUtils.getField(classUnderTest, "flagsDataFile", String.class)); assertEquals((Integer)0, TestUtils.getField(classUnderTest, "flagsOffset", Integer.class)); GocadPropertyDefinition paintedProperty = TestUtils.getField(classUnderTest, "paintedProperty", GocadPropertyDefinition.class); assertNotNull(paintedProperty); assertEquals(null, paintedProperty.getFile()); assertEquals(0, paintedProperty.getOffset()); assertEquals("layer", paintedProperty.getName()); assertEquals(1, paintedProperty.getId()); assertEquals(-99999, paintedProperty.getNoDataValue(), 0.001); assertEquals(true, paintedProperty.isCellCentred()); }
@Override protected boolean doLoadData(URL url, VolumeLayer layer) { this.layer = layer; Object source = null; try { source = openSource(url); if (source == null) { throw new IOException("Unable to load SGrid from URL " + url); } parseHeaderFile(source); validatePaintedPropertyAvailable(); validateDataFileSpecified(); validateNonZeroDimensions(); readSGridData(source); validateDataFileLoadedCorrectly(); correctForReversedAxes(); } catch (IOException e) { e.printStackTrace(); return false; } finally { closeSource(source); } layer.dataAvailable(this); return true; }
SGridVolumeDataProvider extends AbstractVolumeDataProvider { @Override protected boolean doLoadData(URL url, VolumeLayer layer) { this.layer = layer; Object source = null; try { source = openSource(url); if (source == null) { throw new IOException("Unable to load SGrid from URL " + url); } parseHeaderFile(source); validatePaintedPropertyAvailable(); validateDataFileSpecified(); validateNonZeroDimensions(); readSGridData(source); validateDataFileLoadedCorrectly(); correctForReversedAxes(); } catch (IOException e) { e.printStackTrace(); return false; } finally { closeSource(source); } layer.dataAvailable(this); return true; } }
SGridVolumeDataProvider extends AbstractVolumeDataProvider { @Override protected boolean doLoadData(URL url, VolumeLayer layer) { this.layer = layer; Object source = null; try { source = openSource(url); if (source == null) { throw new IOException("Unable to load SGrid from URL " + url); } parseHeaderFile(source); validatePaintedPropertyAvailable(); validateDataFileSpecified(); validateNonZeroDimensions(); readSGridData(source); validateDataFileLoadedCorrectly(); correctForReversedAxes(); } catch (IOException e) { e.printStackTrace(); return false; } finally { closeSource(source); } layer.dataAvailable(this); return true; }  }
SGridVolumeDataProvider extends AbstractVolumeDataProvider { @Override protected boolean doLoadData(URL url, VolumeLayer layer) { this.layer = layer; Object source = null; try { source = openSource(url); if (source == null) { throw new IOException("Unable to load SGrid from URL " + url); } parseHeaderFile(source); validatePaintedPropertyAvailable(); validateDataFileSpecified(); validateNonZeroDimensions(); readSGridData(source); validateDataFileLoadedCorrectly(); correctForReversedAxes(); } catch (IOException e) { e.printStackTrace(); return false; } finally { closeSource(source); } layer.dataAvailable(this); return true; }  @Override double getSliceElevationPercent(double slice); @Override double getElevationPercentSlice(double elevationPercent); @Override int getZSubsamples(); }
SGridVolumeDataProvider extends AbstractVolumeDataProvider { @Override protected boolean doLoadData(URL url, VolumeLayer layer) { this.layer = layer; Object source = null; try { source = openSource(url); if (source == null) { throw new IOException("Unable to load SGrid from URL " + url); } parseHeaderFile(source); validatePaintedPropertyAvailable(); validateDataFileSpecified(); validateNonZeroDimensions(); readSGridData(source); validateDataFileLoadedCorrectly(); correctForReversedAxes(); } catch (IOException e) { e.printStackTrace(); return false; } finally { closeSource(source); } layer.dataAvailable(this); return true; }  @Override double getSliceElevationPercent(double slice); @Override double getElevationPercentSlice(double elevationPercent); @Override int getZSubsamples();  }