diff --git a/cave/com.raytheon.viz.core.gl/META-INF/MANIFEST.MF b/cave/com.raytheon.viz.core.gl/META-INF/MANIFEST.MF index 5c2a9aace6..8a5771db4e 100644 --- a/cave/com.raytheon.viz.core.gl/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.viz.core.gl/META-INF/MANIFEST.MF @@ -21,6 +21,7 @@ Bundle-ActivationPolicy: lazy Export-Package: com.raytheon.viz.core.gl, com.raytheon.viz.core.gl.dataformat, com.raytheon.viz.core.gl.ext, + com.raytheon.viz.core.gl.ext.imaging, com.raytheon.viz.core.gl.glsl, com.raytheon.viz.core.gl.images Import-Package: com.raytheon.uf.common.status, diff --git a/cave/com.raytheon.viz.core.gl/plugin.xml b/cave/com.raytheon.viz.core.gl/plugin.xml index 41ff5356f2..3c1006b9e1 100644 --- a/cave/com.raytheon.viz.core.gl/plugin.xml +++ b/cave/com.raytheon.viz.core.gl/plugin.xml @@ -36,22 +36,22 @@ + class="com.raytheon.viz.core.gl.ext.GLColormapShadedShapeExtension"> + class="com.raytheon.viz.core.gl.ext.GLMapMeshExtension"> + class="com.raytheon.viz.core.gl.ext.imaging.GLColormappedImageExtension"> + class="com.raytheon.viz.core.gl.ext.imaging.GLSingleColorImageExtension"> + class="com.raytheon.viz.core.gl.ext.imaging.GLDefaultImagingExtension"> diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/GLColormapShadedShapeExtension.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/GLColormapShadedShapeExtension.java similarity index 99% rename from cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/GLColormapShadedShapeExtension.java rename to cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/GLColormapShadedShapeExtension.java index e207ef3c82..672e3070cd 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/GLColormapShadedShapeExtension.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/GLColormapShadedShapeExtension.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.viz.core.gl.internal.ext; +package com.raytheon.viz.core.gl.ext; import java.util.ArrayList; import java.util.List; diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/GLMapMeshExtension.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/GLMapMeshExtension.java similarity index 98% rename from cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/GLMapMeshExtension.java rename to cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/GLMapMeshExtension.java index 710e7fc079..b4fe6637d5 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/GLMapMeshExtension.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/GLMapMeshExtension.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.viz.core.gl.internal.ext; +package com.raytheon.viz.core.gl.ext; import org.geotools.coverage.grid.GeneralGridGeometry; import org.geotools.coverage.grid.GridGeometry2D; diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/GLOffscreenRenderingExtension.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/GLOffscreenRenderingExtension.java index 87e50716e3..7d387623e8 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/GLOffscreenRenderingExtension.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/GLOffscreenRenderingExtension.java @@ -44,10 +44,10 @@ import com.raytheon.viz.core.gl.dataformat.AbstractGLColorMapDataFormat; import com.raytheon.viz.core.gl.dataformat.GLByteDataFormat; import com.raytheon.viz.core.gl.dataformat.GLColorMapDataFormatFactory; import com.raytheon.viz.core.gl.dataformat.IGLColorMapDataFormatProvider; +import com.raytheon.viz.core.gl.ext.imaging.GLColormappedImageExtension; import com.raytheon.viz.core.gl.images.AbstractGLImage; import com.raytheon.viz.core.gl.images.GLColormappedImage; import com.raytheon.viz.core.gl.internal.GLView2D; -import com.raytheon.viz.core.gl.internal.ext.GLColormappedImageExtension; /** * diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/AbstractGLImagingExtension.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/AbstractGLImagingExtension.java similarity index 99% rename from cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/AbstractGLImagingExtension.java rename to cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/AbstractGLImagingExtension.java index a2f2837142..13923d30fc 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/AbstractGLImagingExtension.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/AbstractGLImagingExtension.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.viz.core.gl.ext; +package com.raytheon.viz.core.gl.ext.imaging; import java.nio.ByteBuffer; import java.nio.ByteOrder; diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/GLColormappedImageExtension.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLColormappedImageExtension.java similarity index 99% rename from cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/GLColormappedImageExtension.java rename to cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLColormappedImageExtension.java index b814d1093a..1974b0d966 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/GLColormappedImageExtension.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLColormappedImageExtension.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.viz.core.gl.internal.ext; +package com.raytheon.viz.core.gl.ext.imaging; import java.nio.ByteBuffer; diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/GLDefaultImagingExtension.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLDefaultImagingExtension.java similarity index 95% rename from cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/GLDefaultImagingExtension.java rename to cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLDefaultImagingExtension.java index 83b6fba72a..f86080d9ba 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/GLDefaultImagingExtension.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLDefaultImagingExtension.java @@ -17,12 +17,11 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.viz.core.gl.internal.ext; +package com.raytheon.viz.core.gl.ext.imaging; import com.raytheon.uf.viz.core.drawables.IImage; import com.raytheon.uf.viz.core.drawables.PaintProperties; import com.raytheon.uf.viz.core.exception.VizException; -import com.raytheon.viz.core.gl.ext.AbstractGLImagingExtension; import com.raytheon.viz.core.gl.glsl.GLShaderProgram; import com.raytheon.viz.core.gl.images.AbstractGLImage; diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/GLSingleColorImageExtension.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLSingleColorImageExtension.java similarity index 98% rename from cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/GLSingleColorImageExtension.java rename to cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLSingleColorImageExtension.java index 855c39d9b1..0425cc1554 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/GLSingleColorImageExtension.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLSingleColorImageExtension.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.viz.core.gl.internal.ext; +package com.raytheon.viz.core.gl.ext.imaging; import org.eclipse.swt.graphics.RGB; diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/glsl/AbstractGLSLImagingExtension.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/glsl/AbstractGLSLImagingExtension.java index 058ec899f7..f29322c83f 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/glsl/AbstractGLSLImagingExtension.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/glsl/AbstractGLSLImagingExtension.java @@ -21,7 +21,7 @@ package com.raytheon.viz.core.gl.glsl; import com.raytheon.viz.core.gl.GLCapabilities; import com.raytheon.viz.core.gl.IGLTarget; -import com.raytheon.viz.core.gl.ext.AbstractGLImagingExtension; +import com.raytheon.viz.core.gl.ext.imaging.AbstractGLImagingExtension; import com.raytheon.viz.core.gl.internal.GLTarget; /** diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/glsl/GLShaderProgram.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/glsl/GLShaderProgram.java index 859735f588..a7e72634a3 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/glsl/GLShaderProgram.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/glsl/GLShaderProgram.java @@ -220,10 +220,12 @@ public class GLShaderProgram { gl.glUniform1i(getUniformLocation(uniformName), ((Boolean) value) == true ? 1 : 0); } else if (value instanceof int[]) { - gl.glUniform1iv(getUniformLocation(uniformName), MAX_MULTIGRIDS, + int[] ints = (int[]) value; + gl.glUniform1iv(getUniformLocation(uniformName), ints.length, (int[]) value, 0); } else if (value instanceof float[]) { - gl.glUniform1fv(getUniformLocation(uniformName), MAX_MULTIGRIDS, + float[] floats = (float[]) value; + gl.glUniform1fv(getUniformLocation(uniformName), floats.length, (float[]) value, 0); } else if (value instanceof RGB) { gl.glUniform3f(getUniformLocation(uniformName), diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLSingleColorImage.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLSingleColorImage.java index 71c75e92c5..cf719ca5fd 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLSingleColorImage.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLSingleColorImage.java @@ -23,7 +23,7 @@ import org.eclipse.swt.graphics.RGB; import com.raytheon.uf.viz.core.data.IRenderedImageCallback; import com.raytheon.uf.viz.core.drawables.ext.ISingleColorImageExtension.ISingleColorImage; -import com.raytheon.viz.core.gl.internal.ext.GLSingleColorImageExtension; +import com.raytheon.viz.core.gl.ext.imaging.GLSingleColorImageExtension; /** * GL Image object that all non-zero values should be mapped to a single color diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/GLTarget.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/GLTarget.java index ee9968ae0f..f8bda189e6 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/GLTarget.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/GLTarget.java @@ -85,12 +85,12 @@ import com.raytheon.viz.core.gl.GLDisposalManager; import com.raytheon.viz.core.gl.GLStats; import com.raytheon.viz.core.gl.IGLFont; import com.raytheon.viz.core.gl.IGLTarget; +import com.raytheon.viz.core.gl.ext.imaging.GLColormappedImageExtension; +import com.raytheon.viz.core.gl.ext.imaging.GLDefaultImagingExtension; import com.raytheon.viz.core.gl.glsl.GLSLFactory; import com.raytheon.viz.core.gl.glsl.GLShaderProgram; import com.raytheon.viz.core.gl.images.GLColormappedImage; import com.raytheon.viz.core.gl.images.GLImage; -import com.raytheon.viz.core.gl.internal.ext.GLColormappedImageExtension; -import com.raytheon.viz.core.gl.internal.ext.GLDefaultImagingExtension; import com.raytheon.viz.core.gl.objects.GLTextureObject; import com.sun.opengl.util.Screenshot; import com.sun.opengl.util.j2d.TextRenderer; diff --git a/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/topo/TopoResource.java b/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/topo/TopoResource.java index 9a34bcd027..f4e9721872 100644 --- a/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/topo/TopoResource.java +++ b/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/topo/TopoResource.java @@ -64,6 +64,7 @@ import com.raytheon.uf.viz.core.style.StyleManager; import com.raytheon.uf.viz.core.style.StyleManager.StyleType; import com.raytheon.uf.viz.core.style.StyleRule; import com.raytheon.uf.viz.core.tile.TileSetRenderable; +import com.raytheon.uf.viz.core.tile.TileSetRenderable.TileImageCreator; import com.raytheon.viz.core.style.image.DataScale; import com.raytheon.viz.core.style.image.ImagePreferences; import com.raytheon.viz.core.style.image.SamplePreferences; @@ -94,9 +95,9 @@ public class TopoResource extends } }; - private File dataFile; + protected File dataFile; - private TileSetRenderable topoTileSet; + protected TileSetRenderable topoTileSet; protected TopoResource(TopoResourceData topoData, LoadProperties loadProperties, File dataFile) throws VizException { @@ -214,11 +215,14 @@ public class TopoResource extends topoTileSet = new TileSetRenderable( getCapability(ImagingCapability.class), getTopoGeometry(), - new TopoTileImageCreator(this, dataFile), - getNumberOfTopoLevels(), 512); + getTopoTileImageCreator(), getNumberOfTopoLevels(), 512); topoTileSet.project(descriptor.getGridGeometry()); } + protected TileImageCreator getTopoTileImageCreator() { + return new TopoTileImageCreator(this, dataFile); + } + private int getNumberOfTopoLevels() throws VizException { IDataStore ds = DataStoreFactory.getDataStore(dataFile); try { diff --git a/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/topo/TopoResourceData.java b/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/topo/TopoResourceData.java index 799f2dc898..0dbf479f48 100644 --- a/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/topo/TopoResourceData.java +++ b/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/topo/TopoResourceData.java @@ -52,7 +52,7 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties; @XmlAccessorType(XmlAccessType.NONE) public class TopoResourceData extends AbstractResourceData { - private static final String TOPO_DIR = "topo"; + protected static final String TOPO_DIR = "topo"; @XmlElement private String topoFile = "srtm30.hdf"; @@ -85,7 +85,7 @@ public class TopoResourceData extends AbstractResourceData { public TopoResource construct(LoadProperties loadProperties, IDescriptor descriptor) throws VizException { return new TopoResource(this, loadProperties, new File(TOPO_DIR - + IPathManager.SEPARATOR + topoFile)); + + IPathManager.SEPARATOR + getTopoFile())); } public String getTopoFile() { diff --git a/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/topo/TopoTileImageCreator.java b/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/topo/TopoTileImageCreator.java index ee5f121c80..2cda455f69 100644 --- a/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/topo/TopoTileImageCreator.java +++ b/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/topo/TopoTileImageCreator.java @@ -28,6 +28,7 @@ import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.IGraphicsTarget.RasterMode; import com.raytheon.uf.viz.core.IMesh; import com.raytheon.uf.viz.core.PixelCoverage; +import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback; import com.raytheon.uf.viz.core.data.prep.HDF5DataRetriever; import com.raytheon.uf.viz.core.drawables.IColormappedImage; import com.raytheon.uf.viz.core.drawables.ext.colormap.IColormappedImageExtension; @@ -56,7 +57,7 @@ import com.raytheon.uf.viz.core.tile.TileSetRenderable.TileImageCreator; public class TopoTileImageCreator implements TileImageCreator { - private TopoResource resource; + protected TopoResource resource; private File dataFile; @@ -76,15 +77,9 @@ public class TopoTileImageCreator implements TileImageCreator { @Override public DrawableImage createTileImage(IGraphicsTarget target, Tile tile, GeneralGridGeometry targetGeometry) throws VizException { - int level = tile.tileLevel; - String dataset = "/full"; - if (level > 0) { - dataset = "/interpolated/" + level; - } - IColormappedImage image = target.getExtension( IColormappedImageExtension.class).initializeRaster( - new HDF5DataRetriever(dataFile, dataset, tile.getRectangle()), + createColormapImageCallback(tile), resource.getCapability(ColorMapCapability.class) .getColorMapParameters()); IMesh mesh = target.getExtension(IMapMeshExtension.class) @@ -92,4 +87,14 @@ public class TopoTileImageCreator implements TileImageCreator { return new DrawableImage(image, new PixelCoverage(mesh), RasterMode.ASYNCHRONOUS); } + + protected IColorMapDataRetrievalCallback createColormapImageCallback( + Tile tile) { + int level = tile.tileLevel; + String dataset = "/full"; + if (level > 0) { + dataset = "/interpolated/" + level; + } + return new HDF5DataRetriever(dataFile, dataset, tile.getRectangle()); + } }