diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/AbstractGraphicsTarget.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/AbstractGraphicsTarget.java index 5169a11e1b..120e47f913 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/AbstractGraphicsTarget.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/AbstractGraphicsTarget.java @@ -47,7 +47,6 @@ import com.raytheon.uf.viz.core.drawables.ImagingSupport; import com.raytheon.uf.viz.core.drawables.PaintProperties; import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension.IGraphicsExtensionInterface; import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtensionManager; -import com.raytheon.uf.viz.core.drawables.ext.IOffscreenRenderingExtension; import com.raytheon.uf.viz.core.drawables.ext.colormap.IColormappedImageExtension; import com.raytheon.uf.viz.core.exception.VizException; @@ -382,17 +381,6 @@ public abstract class AbstractGraphicsTarget implements IGraphicsTarget { magnification); } - @Override - public void renderOffscreen(IImage offscreenImage) throws VizException { - getExtension(IOffscreenRenderingExtension.class).renderOffscreen( - offscreenImage); - } - - @Override - public void renderOnscreen() throws VizException { - getExtension(IOffscreenRenderingExtension.class).renderOnscreen(); - } - @Override public void drawString(IFont font, String text, double x, double y, double z, TextStyle textStyle, RGB color, diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/IGraphicsTarget.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/IGraphicsTarget.java index 1d3dba3da3..f685a10688 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/IGraphicsTarget.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/IGraphicsTarget.java @@ -731,20 +731,6 @@ public interface IGraphicsTarget extends IImagingExtension { */ public IView getView(); - /** - * Use getExtension(IOffscreenRenderingExtension.class).renderOffscreen( - * offscreenImage) instead; - */ - @Deprecated - public void renderOffscreen(IImage offscreenImage) throws VizException; - - /** - * Use getExtension(IOffscreenRenderingExtension.class).renderOnscreen() - * instead; - */ - @Deprecated - public void renderOnscreen() throws VizException; - /** * Use drawStrings(DrawableString parameters) */ diff --git a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/mosaic/ext/IRadarMosaicImageExtension.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ext/IMosaicImageExtension.java similarity index 84% rename from cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/mosaic/ext/IRadarMosaicImageExtension.java rename to cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ext/IMosaicImageExtension.java index c0d3a883f7..d27c2d0a13 100644 --- a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/mosaic/ext/IRadarMosaicImageExtension.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ext/IMosaicImageExtension.java @@ -17,17 +17,18 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.viz.radar.rsc.mosaic.ext; +package com.raytheon.uf.viz.core.drawables.ext; import com.raytheon.uf.viz.core.DrawableImage; import com.raytheon.uf.viz.core.IExtent; import com.raytheon.uf.viz.core.drawables.ColorMapParameters; import com.raytheon.uf.viz.core.drawables.IColormappedImage; -import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension; import com.raytheon.uf.viz.core.exception.VizException; /** - * Radar mosaic image extension, creates IMosaicImages + * Mosaic image extension, creates IMosaicImages. Mosaicing should be used when + * multiple overlapping images are being drawn to the screen. The mosaic + * extension will combine these images into a single mosaic image. * *
  * 
@@ -43,7 +44,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
  * @version 1.0
  */
 
-public interface IRadarMosaicImageExtension extends IImagingExtension {
+public interface IMosaicImageExtension extends IImagingExtension {
 
     public static interface IMosaicImage extends IColormappedImage {
 
diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ext/IMosaicMaxValImageExtension.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ext/IMosaicMaxValImageExtension.java
new file mode 100644
index 0000000000..65541ba015
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ext/IMosaicMaxValImageExtension.java
@@ -0,0 +1,42 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ * 
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ * 
+ * Contractor Name:        Raytheon Company
+ * Contractor Address:     6825 Pine Street, Suite 340
+ *                         Mail Stop B8
+ *                         Omaha, NE 68106
+ *                         402.291.0100
+ * 
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.core.drawables.ext;
+
+/**
+ * A mosaicing extension that combines images by using the largest value for
+ * overlapped areas of multiple iamges.
+ * 
+ * 
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 10, 2012            bsteffen     Initial creation
+ * 
+ * 
+ * + * @author bsteffen + * @version 1.0 + */ + +public interface IMosaicMaxValImageExtension extends IMosaicImageExtension { + +} diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ext/IMosaicOrderedImageExtension.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ext/IMosaicOrderedImageExtension.java new file mode 100644 index 0000000000..d36fa8d94c --- /dev/null +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ext/IMosaicOrderedImageExtension.java @@ -0,0 +1,42 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.core.drawables.ext; + +/** + * A mosaicing extension that combines images by using the values from the last + * drawn image when images overalap. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 10, 2012            bsteffen     Initial creation
+ * 
+ * 
+ * + * @author bsteffen + * @version 1.0 + */ + +public interface IMosaicOrderedImageExtension extends IMosaicImageExtension { + +} diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ext/IOffscreenRenderingExtension.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ext/IOffscreenRenderingExtension.java deleted file mode 100644 index e8a69947d8..0000000000 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ext/IOffscreenRenderingExtension.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.raytheon.uf.viz.core.drawables.ext; - -import java.nio.Buffer; - -import com.raytheon.uf.viz.core.IExtent; -import com.raytheon.uf.viz.core.drawables.ColorMapParameters; -import com.raytheon.uf.viz.core.drawables.IColormappedImage; -import com.raytheon.uf.viz.core.drawables.IImage; -import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension.IGraphicsExtensionInterface; -import com.raytheon.uf.viz.core.exception.VizException; - -public interface IOffscreenRenderingExtension extends - IGraphicsExtensionInterface { - /** - * All drawing between a call to renderOffscreen and the next call to - * renderOnscreen will be drawn to offscreenImage rather than to the screen. - * Will use the current screen's world as the coverage area for the - * offscreen image - * - * @param offscreenImage - * image to render to - * @throws VizException - */ - public void renderOffscreen(IImage offscreenImage) throws VizException; - - /** - * All drawing between a call to renderOffscreen and the next call to - * renderOnscreen will be drawn to offscreenImage rather than to the screen. - * Will use the extent passed in as the world coverage area for the - * offscreen image - * - * @param offscreenImage - * @param offscreenExtent - * @throws VizException - */ - public void renderOffscreen(IImage offscreenImage, IExtent offscreenExtent) - throws VizException; - - /** - * Reset rendering to the screen. This only needs to be called if - * renderOffscreen has been called. - * - * @throws VizException - */ - public void renderOnscreen() throws VizException; - - /** - * Construct an offscreen image with the specified dimensions. This image - * will be an RGB based image - * - * @param dimensions - * @return - * @throws VizException - */ - public IImage constructOffscreenImage(int[] dimensions) throws VizException; - - /** - * Construct an offscreen image for given Buffer type and size - * - * @param dataType - * @param dataBounds - * @return - * @throws VizException - */ - public IColormappedImage constructOffscreenImage( - Class dataType, int[] dimensions) - throws VizException; - - /** - * Construct an offscreen image for given Buffer type and size, applying - * ColorMapParameters to offscreen image where possible - * - * @param dataType - * @param dataBounds - * @param parameters - * @return - * @throws VizException - */ - public IColormappedImage constructOffscreenImage( - Class dataType, int[] dimensions, - ColorMapParameters parameters) throws VizException; -} diff --git a/cave/com.raytheon.uf.viz.radar.gl/plugin.xml b/cave/com.raytheon.uf.viz.radar.gl/plugin.xml index aa3f2181c6..75cda94472 100644 --- a/cave/com.raytheon.uf.viz.radar.gl/plugin.xml +++ b/cave/com.raytheon.uf.viz.radar.gl/plugin.xml @@ -6,8 +6,5 @@ - - diff --git a/cave/com.raytheon.uf.viz.radar.gl/localization/glsl/mosaicMaxVal.glsl b/cave/com.raytheon.viz.core.gl/localization/glsl/mosaicMaxVal.glsl similarity index 70% rename from cave/com.raytheon.uf.viz.radar.gl/localization/glsl/mosaicMaxVal.glsl rename to cave/com.raytheon.viz.core.gl/localization/glsl/mosaicMaxVal.glsl index c6268a397a..d125aaf63d 100644 --- a/cave/com.raytheon.uf.viz.radar.gl/localization/glsl/mosaicMaxVal.glsl +++ b/cave/com.raytheon.viz.core.gl/localization/glsl/mosaicMaxVal.glsl @@ -1,7 +1,7 @@ // this shader program sets values into a mosaic texture // which is the same size as the screen (frame buffer) -uniform sampler2D radarData; +uniform sampler2D imageData; uniform sampler2D mosaicTexture; uniform int height; uniform int width; @@ -9,10 +9,10 @@ uniform int width; void main(void) { vec2 xy = gl_FragCoord.xy; - vec4 radarVal = texture2D(radarData,gl_TexCoord[0].st); + vec4 imageVal = texture2D(imageData,gl_TexCoord[0].st); vec4 curVal = texture2D(mosaicTexture, vec2((xy.x / float(width)), (xy.y / float(height)))); - if ( radarVal.r > curVal.r ) { - gl_FragColor = vec4(radarVal.r,0.0,0.0,1.0); + if ( imageVal.r > curVal.r ) { + gl_FragColor = vec4(imageVal.r,0.0,0.0,1.0); } else { gl_FragColor = vec4(curVal.r,0.0,0.0,1.0); } diff --git a/cave/com.raytheon.viz.core.gl/localization/glsl/mosaicOrdered.glsl b/cave/com.raytheon.viz.core.gl/localization/glsl/mosaicOrdered.glsl new file mode 100644 index 0000000000..7ba4d1088e --- /dev/null +++ b/cave/com.raytheon.viz.core.gl/localization/glsl/mosaicOrdered.glsl @@ -0,0 +1,20 @@ +// this shader program sets values into a mosaic texture +// which is the same size as the screen (frame buffer) + +uniform sampler2D imageData; +uniform sampler2D mosaicTexture; +uniform int height; +uniform int width; + +void main(void) +{ + vec2 xy = gl_FragCoord.xy; + vec4 imageVal = texture2D(imageData,gl_TexCoord[0].st); + vec4 curVal = texture2D(mosaicTexture, vec2((xy.x / float(width)), (xy.y / float(height)))); + // assume 0 or NaN is No Data and should be replaced if another image has better values. + if ( imageVal.r != 0 && imageVal.r == imageVal.r) { + gl_FragColor = vec4(imageVal.r,0.0,0.0,1.0); + } else { + gl_FragColor = vec4(curVal.r,0.0,0.0,1.0); + } +} \ No newline at end of file diff --git a/cave/com.raytheon.viz.core.gl/plugin.xml b/cave/com.raytheon.viz.core.gl/plugin.xml index 15298c9107..112cdc147f 100644 --- a/cave/com.raytheon.viz.core.gl/plugin.xml +++ b/cave/com.raytheon.viz.core.gl/plugin.xml @@ -56,5 +56,14 @@ + + + + + + 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 ef20f7d020..cd7ab01ed1 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 @@ -1,3 +1,22 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ package com.raytheon.viz.core.gl.ext; import java.awt.Rectangle; @@ -16,7 +35,7 @@ import com.raytheon.uf.viz.core.data.IRenderedImageCallback; import com.raytheon.uf.viz.core.drawables.ColorMapParameters; import com.raytheon.uf.viz.core.drawables.IImage; import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension; -import com.raytheon.uf.viz.core.drawables.ext.IOffscreenRenderingExtension; +import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension.IGraphicsExtensionInterface; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.viz.core.gl.IGLTarget; import com.raytheon.viz.core.gl.dataformat.AbstractGLColorMapDataFormat; @@ -27,8 +46,28 @@ 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; +/** + * + * Provides logic for creating offscreen images in GL so that data can be + * rendered and saved for better efficiency. When rendering offscreen all render + * events to the target are sent to an offscreen image, this image can later be + * rendered onscreen. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 10, 2012            bsteffen     Initial creation
+ * 
+ * 
+ * + * @author bsteffen + * @version 1.0 + */ public class GLOffscreenRenderingExtension extends GraphicsExtension - implements IOffscreenRenderingExtension { + implements IGraphicsExtensionInterface { private static class ViewInfo { private IView view; @@ -53,25 +92,10 @@ public class GLOffscreenRenderingExtension extends GraphicsExtension private ViewInfo currentInfo = null; - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.viz.core.drawables.ext.IOffscreenRenderingExtension# - * renderOffscreen(com.raytheon.uf.viz.core.drawables.IImage) - */ - @Override public void renderOffscreen(IImage offscreenImage) throws VizException { renderOffscreen(offscreenImage, target.getView().getExtent()); } - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.viz.core.drawables.ext.IOffscreenRenderingExtension# - * renderOffscreen(com.raytheon.uf.viz.core.drawables.IImage, - * com.raytheon.uf.viz.core.IExtent) - */ - @Override public void renderOffscreen(IImage offscreenImage, IExtent offscreenExtent) throws VizException { if (!(offscreenImage instanceof AbstractGLImage)) { @@ -100,7 +124,6 @@ public class GLOffscreenRenderingExtension extends GraphicsExtension setCurrentView(new ViewInfo(view, glImage)); } - @Override public void renderOnscreen() throws VizException { if (viewStack.size() > 0) { setCurrentView(viewStack.pop()); @@ -139,13 +162,6 @@ public class GLOffscreenRenderingExtension extends GraphicsExtension return Compatibilty.TARGET_COMPATIBLE; } - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.viz.core.drawables.ext.IOffscreenRenderingExtension# - * constructOffscreenImage(int[]) - */ - @Override public IImage constructOffscreenImage(final int[] dimensions) throws VizException { return target.initializeRaster(new IRenderedImageCallback() { @@ -157,26 +173,12 @@ public class GLOffscreenRenderingExtension extends GraphicsExtension }); } - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.viz.core.drawables.ext.IOffscreenRenderingExtension# - * constructOffscreenImage(java.lang.Class, java.awt.Rectangle) - */ - @Override public GLColormappedImage constructOffscreenImage( Class dataType, int[] dimensions) throws VizException { return constructOffscreenImage(dataType, dimensions, null); } - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.viz.core.drawables.ext.IOffscreenRenderingExtension# - * constructOffscreenImage(java.lang.Class, java.awt.Rectangle) - */ - @Override public GLColormappedImage constructOffscreenImage( Class dataType, final int[] dimensions, ColorMapParameters parameters) throws VizException { diff --git a/cave/com.raytheon.uf.viz.radar.gl/src/com/raytheon/uf/viz/radar/gl/mosaic/GLMosaicImage.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/mosaic/GLMosaicImage.java similarity index 91% rename from cave/com.raytheon.uf.viz.radar.gl/src/com/raytheon/uf/viz/radar/gl/mosaic/GLMosaicImage.java rename to cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/mosaic/GLMosaicImage.java index 6f9143b56b..66fac03819 100644 --- a/cave/com.raytheon.uf.viz.radar.gl/src/com/raytheon/uf/viz/radar/gl/mosaic/GLMosaicImage.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/mosaic/GLMosaicImage.java @@ -17,14 +17,15 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.radar.gl.mosaic; +package com.raytheon.viz.core.gl.internal.ext.mosaic; import com.raytheon.uf.viz.core.DrawableImage; import com.raytheon.uf.viz.core.IExtent; import com.raytheon.uf.viz.core.drawables.ColorMapParameters; +import com.raytheon.uf.viz.core.drawables.ext.IMosaicImageExtension; +import com.raytheon.uf.viz.core.drawables.ext.IMosaicImageExtension.IMosaicImage; import com.raytheon.viz.core.gl.images.GLColormappedImage; import com.raytheon.viz.core.gl.images.GLDelegateImage; -import com.raytheon.viz.radar.rsc.mosaic.ext.IRadarMosaicImageExtension.IMosaicImage; /** * GL implementation of IMosaicImage, wraps an offscreen image and contains @@ -61,8 +62,9 @@ public class GLMosaicImage extends GLDelegateImage * @param extensionClass */ public GLMosaicImage(GLColormappedImage image, int[] bounds, - IExtent imageExtent) { - super(image, GLRadarMosaicImageExtension.class); + IExtent imageExtent, + Class extensionClass) { + super(image, extensionClass); this.bounds = bounds; this.extent = imageExtent; } diff --git a/cave/com.raytheon.uf.viz.radar.gl/src/com/raytheon/uf/viz/radar/gl/mosaic/GLRadarMosaicImageExtension.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/mosaic/GLMosaicImageExtension.java similarity index 91% rename from cave/com.raytheon.uf.viz.radar.gl/src/com/raytheon/uf/viz/radar/gl/mosaic/GLRadarMosaicImageExtension.java rename to cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/mosaic/GLMosaicImageExtension.java index 8a5e5e6946..3fc6724494 100644 --- a/cave/com.raytheon.uf.viz.radar.gl/src/com/raytheon/uf/viz/radar/gl/mosaic/GLRadarMosaicImageExtension.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/mosaic/GLMosaicImageExtension.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.radar.gl.mosaic; +package com.raytheon.viz.core.gl.internal.ext.mosaic; import java.nio.ByteBuffer; @@ -30,13 +30,12 @@ import com.raytheon.uf.viz.core.drawables.ColorMapParameters; import com.raytheon.uf.viz.core.drawables.IImage; import com.raytheon.uf.viz.core.drawables.ImagingSupport; import com.raytheon.uf.viz.core.drawables.PaintProperties; -import com.raytheon.uf.viz.core.drawables.ext.IOffscreenRenderingExtension; +import com.raytheon.uf.viz.core.drawables.ext.IMosaicImageExtension; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.viz.core.gl.ext.GLOffscreenRenderingExtension; import com.raytheon.viz.core.gl.glsl.AbstractGLSLImagingExtension; import com.raytheon.viz.core.gl.glsl.GLShaderProgram; import com.raytheon.viz.core.gl.images.AbstractGLImage; -import com.raytheon.viz.radar.rsc.mosaic.ext.IRadarMosaicImageExtension; /** * Extension used for rendering radar mosaic images @@ -55,8 +54,8 @@ import com.raytheon.viz.radar.rsc.mosaic.ext.IRadarMosaicImageExtension; * @version 1.0 */ -public class GLRadarMosaicImageExtension extends AbstractGLSLImagingExtension - implements IRadarMosaicImageExtension { +public class GLMosaicImageExtension extends AbstractGLSLImagingExtension + implements IMosaicImageExtension { private AbstractGLImage writeToImage; @@ -65,7 +64,7 @@ public class GLRadarMosaicImageExtension extends AbstractGLSLImagingExtension return new GLMosaicImage(target.getExtension( GLOffscreenRenderingExtension.class).constructOffscreenImage( ByteBuffer.class, imageBounds, params), imageBounds, - imageExtent); + imageExtent, this.getClass()); } /* @@ -77,7 +76,7 @@ public class GLRadarMosaicImageExtension extends AbstractGLSLImagingExtension */ @Override public String getShaderProgramName() { - return "mosaicMaxVal"; + return "mosaicOrdered"; } /* @@ -95,8 +94,8 @@ public class GLRadarMosaicImageExtension extends AbstractGLSLImagingExtension GLMosaicImage mosaicImage = (GLMosaicImage) image; if (mosaicImage.isRepaint()) { writeToImage = mosaicImage.getWrappedImage(); - IOffscreenRenderingExtension extension = target - .getExtension(IOffscreenRenderingExtension.class); + GLOffscreenRenderingExtension extension = target + .getExtension(GLOffscreenRenderingExtension.class); try { extension.renderOffscreen(mosaicImage, mosaicImage.getImageExtent()); @@ -164,7 +163,7 @@ public class GLRadarMosaicImageExtension extends AbstractGLSLImagingExtension @Override public void loadShaderData(GLShaderProgram program, IImage image, PaintProperties paintProps) throws VizException { - program.setUniform("radarData", 0); + program.setUniform("imageData", 0); program.setUniform("mosaicTexture", 1); // pass in width and height diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/mosaic/GLMosaicMaxValImageExtension.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/mosaic/GLMosaicMaxValImageExtension.java new file mode 100644 index 0000000000..f9c650f516 --- /dev/null +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/mosaic/GLMosaicMaxValImageExtension.java @@ -0,0 +1,49 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.viz.core.gl.internal.ext.mosaic; + +import com.raytheon.uf.viz.core.drawables.ext.IMosaicMaxValImageExtension; + +/** + * GL implementation of the max val mosaic algorithm + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 10, 2012            bsteffen     Initial creation
+ * 
+ * 
+ * + * @author bsteffen + * @version 1.0 + */ + +public class GLMosaicMaxValImageExtension extends GLMosaicImageExtension + implements IMosaicMaxValImageExtension { + + @Override + public String getShaderProgramName() { + return "mosaicMaxVal"; + } + +} diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/mosaic/GLMosaicOrderedImageExtension.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/mosaic/GLMosaicOrderedImageExtension.java new file mode 100644 index 0000000000..6ddbea5789 --- /dev/null +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/mosaic/GLMosaicOrderedImageExtension.java @@ -0,0 +1,49 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.viz.core.gl.internal.ext.mosaic; + +import com.raytheon.uf.viz.core.drawables.ext.IMosaicOrderedImageExtension; + +/** + * GL implementation of the ordered mosaic algorithm + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 10, 2012            bsteffen     Initial creation
+ * 
+ * 
+ * + * @author bsteffen + * @version 1.0 + */ + +public class GLMosaicOrderedImageExtension extends GLMosaicImageExtension + implements IMosaicOrderedImageExtension { + + @Override + public String getShaderProgramName() { + return "mosaicOrdered"; + } + +} diff --git a/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/rsc/hdf5/AbstractTileSet.java b/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/rsc/hdf5/AbstractTileSet.java index 9c36f4dd6a..74a0b82adc 100644 --- a/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/rsc/hdf5/AbstractTileSet.java +++ b/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/rsc/hdf5/AbstractTileSet.java @@ -22,6 +22,7 @@ package com.raytheon.viz.core.rsc.hdf5; import java.awt.Point; import java.awt.Rectangle; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -434,7 +435,7 @@ public abstract class AbstractTileSet implements IRenderable, IMeshCallback { * @param isRecursiveCall * @throws VizException */ - protected void drawInternal(IGraphicsTarget target, + protected List drawInternal(IGraphicsTarget target, PaintProperties paintProps, int lvl, int depth) throws VizException { List intersectedTiles = new ArrayList(); @@ -504,12 +505,14 @@ public abstract class AbstractTileSet implements IRenderable, IMeshCallback { // Draw lower resolution data first if (needDrawLower && (lvl + 1) < levels) { - drawInternal(target, paintProps, lvl + 1, depth + 1); + // put lower levels first in the list so they are drawn first. + List lowerImages = drawInternal(target, paintProps, + lvl + 1, depth + 1); + lowerImages.addAll(drawableImages); + drawableImages = lowerImages; } - // Draw all tiles at once - target.drawRasters(paintProps, drawableImages - .toArray(new DrawableImage[drawableImages.size()])); + return drawableImages; } /* @@ -526,11 +529,16 @@ public abstract class AbstractTileSet implements IRenderable, IMeshCallback { return; } lastPaintedTarget = target; - do2D(target, paintProps); + List drawableImages = do2D(target, paintProps); + + // Draw all tiles at once + target.drawRasters(paintProps, drawableImages + .toArray(new DrawableImage[drawableImages.size()])); + } - protected void do2D(IGraphicsTarget target, PaintProperties paintProps) - throws VizException { + protected List do2D(IGraphicsTarget target, + PaintProperties paintProps) throws VizException { double screenToWorldRatio = paintProps.getCanvasBounds().width / paintProps.getView().getExtent().getWidth(); @@ -550,9 +558,11 @@ public abstract class AbstractTileSet implements IRenderable, IMeshCallback { if (this.tileSet.getTileSet() != null && tileSet.getTileSet().size() > 0) { - drawInternal(target, paintProps, usedTileLevel, 0); - lastPaintedLevel = usedTileLevel; + + return drawInternal(target, paintProps, usedTileLevel, 0); + } else { + return Collections.emptyList(); } } diff --git a/cave/com.raytheon.viz.radar/META-INF/MANIFEST.MF b/cave/com.raytheon.viz.radar/META-INF/MANIFEST.MF index 1ddadd3882..c1f4338aa6 100644 --- a/cave/com.raytheon.viz.radar/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.viz.radar/META-INF/MANIFEST.MF @@ -81,7 +81,6 @@ Export-Package: com.raytheon.viz.radar; com.raytheon.viz.radar.rsc.graphic, com.raytheon.viz.radar.rsc.image, com.raytheon.viz.radar.rsc.mosaic, - com.raytheon.viz.radar.rsc.mosaic.ext, com.raytheon.viz.radar.ui; uses:="com.raytheon.viz.radar, com.raytheon.viz.ui.dialogs, diff --git a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/mosaic/RadarMosaicRenderer.java b/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/mosaic/RadarMosaicRenderer.java index e1f58c89e1..2993990cfc 100644 --- a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/mosaic/RadarMosaicRenderer.java +++ b/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/mosaic/RadarMosaicRenderer.java @@ -31,6 +31,9 @@ import com.raytheon.uf.viz.core.PixelCoverage; import com.raytheon.uf.viz.core.drawables.ColorMapParameters; import com.raytheon.uf.viz.core.drawables.PaintProperties; import com.raytheon.uf.viz.core.drawables.ResourcePair; +import com.raytheon.uf.viz.core.drawables.ext.IMosaicImageExtension; +import com.raytheon.uf.viz.core.drawables.ext.IMosaicImageExtension.IMosaicImage; +import com.raytheon.uf.viz.core.drawables.ext.IMosaicMaxValImageExtension; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.rsc.AbstractVizResource; import com.raytheon.uf.viz.core.rsc.IRefreshListener; @@ -40,8 +43,6 @@ import com.raytheon.viz.core.rsc.BestResResource; import com.raytheon.viz.radar.rsc.MosaicPaintProperties; import com.raytheon.viz.radar.rsc.RadarImageResource; import com.raytheon.viz.radar.rsc.mosaic.RadarMosaicRendererFactory.IRadarMosaicRenderer; -import com.raytheon.viz.radar.rsc.mosaic.ext.IRadarMosaicImageExtension; -import com.raytheon.viz.radar.rsc.mosaic.ext.IRadarMosaicImageExtension.IMosaicImage; import com.vividsolutions.jts.geom.Coordinate; /** @@ -177,12 +178,21 @@ public class RadarMosaicRenderer implements IRadarMosaicRenderer, */ private void init(IGraphicsTarget target, PaintProperties paintProps, ColorMapParameters params) throws VizException { + IMosaicImageExtension ext = target + .getExtension(IMosaicMaxValImageExtension.class); + if (ext == null) { + // This could return about any mosaicing algorithm but it is better + // than drawing nothing + ext = target.getExtension(IMosaicImageExtension.class); + } + if (ext == null) { + + } // Construct texture for mosaicing - writeTo = target.getExtension(IRadarMosaicImageExtension.class) - .initializeRaster( - new int[] { paintProps.getCanvasBounds().width, - paintProps.getCanvasBounds().height }, - paintProps.getView().getExtent(), params); + writeTo = ext.initializeRaster( + new int[] { paintProps.getCanvasBounds().width, + paintProps.getCanvasBounds().height }, paintProps + .getView().getExtent(), params); } @Override diff --git a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/rsc/SatBlendedResource.java b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/rsc/SatBlendedResource.java index 17c04ab740..63e7d9677f 100644 --- a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/rsc/SatBlendedResource.java +++ b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/rsc/SatBlendedResource.java @@ -28,14 +28,16 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem; import com.raytheon.uf.common.geospatial.ReferencedCoordinate; import com.raytheon.uf.common.time.DataTime; +import com.raytheon.uf.viz.core.DrawableImage; import com.raytheon.uf.viz.core.IExtent; import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.PixelCoverage; -import com.raytheon.uf.viz.core.drawables.IImage; +import com.raytheon.uf.viz.core.drawables.ColorMapParameters; import com.raytheon.uf.viz.core.drawables.PaintProperties; -import com.raytheon.uf.viz.core.drawables.PaintStatus; import com.raytheon.uf.viz.core.drawables.ResourcePair; -import com.raytheon.uf.viz.core.drawables.ext.IOffscreenRenderingExtension; +import com.raytheon.uf.viz.core.drawables.ext.IMosaicImageExtension; +import com.raytheon.uf.viz.core.drawables.ext.IMosaicImageExtension.IMosaicImage; +import com.raytheon.uf.viz.core.drawables.ext.IMosaicOrderedImageExtension; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.map.MapDescriptor; import com.raytheon.uf.viz.core.rsc.AbstractVizResource; @@ -44,6 +46,8 @@ import com.raytheon.uf.viz.core.rsc.IResourceDataChanged; import com.raytheon.uf.viz.core.rsc.IResourceGroup; import com.raytheon.uf.viz.core.rsc.LoadProperties; import com.raytheon.uf.viz.core.rsc.ResourceList; +import com.raytheon.uf.viz.core.rsc.capabilities.ColorMapCapability; +import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability; import com.vividsolutions.jts.geom.Coordinate; /** @@ -67,9 +71,7 @@ public class SatBlendedResource extends AbstractVizResource implements IResourceGroup, IRefreshListener, IResourceDataChanged { - private IImage offscreenImage = null; - - private int[] imageBounds = null; + private IMosaicImage mosaicImage = null; private IExtent lastExtent = null; @@ -149,15 +151,21 @@ public class SatBlendedResource extends @Override protected void paintInternal(IGraphicsTarget target, PaintProperties paintProps) throws VizException { - if (offscreenImage == null - || Arrays.equals(imageBounds, - new int[] { paintProps.getCanvasBounds().width, - paintProps.getCanvasBounds().height }) == false) { + ColorMapParameters params = getCapability(ColorMapCapability.class) + .getColorMapParameters(); + + // If first paint, initialize and wait for next paint + if (mosaicImage == null) { + initImage(target, paintProps, params); + } else if (Arrays.equals( + new int[] { mosaicImage.getWidth(), mosaicImage.getHeight() }, + new int[] { paintProps.getCanvasBounds().width, + paintProps.getCanvasBounds().height }) == false) { + // If Window size changed, recreate the off screen buffer disposeImage(); - initImage(target, paintProps); + initImage(target, paintProps, params); } - boolean newTimes = false; List rscTimes = new ArrayList(); for (ResourcePair rp : getResourceList()) { AbstractVizResource rsc = rp.getResource(); @@ -165,41 +173,41 @@ public class SatBlendedResource extends rscTimes.add(descriptor.getTimeForResource(rsc)); } } - if (rscTimes.equals(lastTimes) == false) { - newTimes = true; - } - lastTimes = rscTimes; + IExtent extent = paintProps.getView().getExtent().clone(); + if (extent.equals(lastExtent) == false + || rscTimes.equals(lastTimes) == false) { + lastTimes = rscTimes; + lastExtent = extent; + List images = new ArrayList(); - if (paintProps.getView().getExtent().equals(lastExtent) == false - || newTimes) { - - IExtent extent = lastExtent = paintProps.getView().getExtent() - .clone(); - - // render offscreen so alpha can be applied to combined image rather - // than to each image. - target.renderOffscreen(offscreenImage); - - if (paintProps.getDataTime() != null) { - for (ResourcePair rp : getResourceList()) { - AbstractVizResource rsc = rp.getResource(); - if (rsc != null) { - DataTime timeForRsc = paintProps.getFramesInfo() - .getTimeForResource(rsc); - PaintProperties rscProps = new PaintProperties( - paintProps); - rscProps.setDataTime(timeForRsc); - rscProps.setAlpha(1.0f); - PaintStatus paintStatus = rsc.paint(target, rscProps); - if (paintStatus != PaintStatus.PAINTED) { - updatePaintStatus(paintStatus); + for (ResourcePair rp : getResourceList()) { + AbstractVizResource rsc = rp.getResource(); + DataTime time = paintProps.getFramesInfo().getTimeForResource( + rsc); + if (rsc != null && time != null) { + SatResource sr = (SatResource) rsc; + DataTime timeForRsc = paintProps.getFramesInfo() + .getTimeForResource(rsc); + PaintProperties rscProps = new PaintProperties(paintProps); + rscProps.setDataTime(timeForRsc); + rscProps.setAlpha(1.0f); + List rscImages = sr.getImages(target, + rscProps); + for (DrawableImage di : rscImages) { + if (di != null && di.getImage() != null + && di.getCoverage() != null + && di.getCoverage().getMesh() != null) { + // If image is ready to go, add + images.add(di); } } } } - target.renderOnscreen(); + mosaicImage.setImagesToMosaic(images + .toArray(new DrawableImage[images.size()])); + mosaicImage.setImageExtent(extent); Coordinate ul = new Coordinate(extent.getMinX(), extent.getMaxY()); Coordinate ur = new Coordinate(extent.getMaxX(), extent.getMaxY()); @@ -209,24 +217,35 @@ public class SatBlendedResource extends imageCoverage = new PixelCoverage(ul, ur, lr, ll); } - target.drawRaster(offscreenImage, imageCoverage, paintProps); + mosaicImage.setContrast(getCapability(ImagingCapability.class) + .getContrast()); + mosaicImage.setBrightness(getCapability(ImagingCapability.class) + .getBrightness()); + + target.drawRaster(mosaicImage, imageCoverage, paintProps); } - private void initImage(IGraphicsTarget target, PaintProperties paintProps) - throws VizException { - // Construct texture for fbo - imageBounds = new int[] { paintProps.getCanvasBounds().width, - paintProps.getCanvasBounds().height }; - offscreenImage = target - .getExtension(IOffscreenRenderingExtension.class) - .constructOffscreenImage(imageBounds); + private void initImage(IGraphicsTarget target, PaintProperties paintProps, + ColorMapParameters params) throws VizException { + IMosaicImageExtension ext = target + .getExtension(IMosaicOrderedImageExtension.class); + if (ext == null) { + // This could return about any mosaicing algorithm but it is better + // than drawing nothing + ext = target.getExtension(IMosaicImageExtension.class); + } + // Construct texture for mosaicing + mosaicImage = ext.initializeRaster( + new int[] { paintProps.getCanvasBounds().width, + paintProps.getCanvasBounds().height }, paintProps + .getView().getExtent(), params); } private void disposeImage() { // Dispose of all data, offscreen texture - if (offscreenImage != null) { - offscreenImage.dispose(); - offscreenImage = null; + if (mosaicImage != null) { + mosaicImage.dispose(); + mosaicImage = null; } } diff --git a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/rsc/SatFileBasedTileSet.java b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/rsc/SatFileBasedTileSet.java index 35b68d96d7..5196e322be 100644 --- a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/rsc/SatFileBasedTileSet.java +++ b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/rsc/SatFileBasedTileSet.java @@ -35,10 +35,12 @@ import com.raytheon.uf.common.datastorage.StorageException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.viz.core.DrawableImage; import com.raytheon.uf.viz.core.HDF5Util; import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.drawables.ColorMapParameters; import com.raytheon.uf.viz.core.drawables.IImage; +import com.raytheon.uf.viz.core.drawables.PaintProperties; import com.raytheon.uf.viz.core.drawables.ext.colormap.IColormappedImageExtension; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.rsc.AbstractVizResource; @@ -296,4 +298,9 @@ public class SatFileBasedTileSet extends FileBasedTileSet { public void cancelRequest(int level, int i, int j) { } + + public List getImages(IGraphicsTarget target, + PaintProperties paintProps) throws VizException { + return do2D(target, paintProps); + } } diff --git a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/rsc/SatResource.java b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/rsc/SatResource.java index 34a0006f9c..2faa74d71a 100644 --- a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/rsc/SatResource.java +++ b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/rsc/SatResource.java @@ -26,6 +26,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; +import java.util.List; import java.util.Map; import javax.measure.converter.UnitConverter; @@ -52,6 +53,7 @@ import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.time.BinOffset; import com.raytheon.uf.common.time.DataTime; +import com.raytheon.uf.viz.core.DrawableImage; import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.IMeshCallback; import com.raytheon.uf.viz.core.drawables.ColorMapParameters; @@ -107,13 +109,13 @@ public class SatResource extends private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(SatResource.class); - protected Map tileSet; + protected Map tileSet; private Map recordMap = new HashMap(); protected DataTime displayedDate; - protected FileBasedTileSet baseTile; + protected SatFileBasedTileSet baseTile; protected String legend; @@ -125,7 +127,7 @@ public class SatResource extends protected String viewType; - protected FileBasedTileSet currentTile; + protected SatFileBasedTileSet currentTile; protected GridGeometry recordGeometry; @@ -139,7 +141,7 @@ public class SatResource extends public SatResource(SatResourceData data, LoadProperties props) { super(data, props); data.addChangeListener(this); - this.tileSet = new HashMap(); + this.tileSet = new HashMap(); this.dataTimes = new ArrayList(); this.legend = null; SatelliteRecord[] records = data.getRecords(); @@ -224,12 +226,11 @@ public class SatResource extends if (sr != null && sr.getPreferences() instanceof ImagePreferences) { sampleRange = ((ImagePreferences) sr.getPreferences()) .getSamplePrefs(); - String lg = ((ImagePreferences) sr.getPreferences()) - .getLegend(); - // test, so legend is not over written with empty string - if (lg != null && !lg.trim().isEmpty()) { - legend = lg; - } + String lg = ((ImagePreferences) sr.getPreferences()).getLegend(); + // test, so legend is not over written with empty string + if (lg != null && !lg.trim().isEmpty()) { + legend = lg; + } } colorMapParameters = ColorMapParameterFactory.build(null, @@ -447,7 +448,7 @@ public class SatResource extends public void addRecord(PluginDataObject record) throws VizException { synchronized (this) { - FileBasedTileSet tile; + SatFileBasedTileSet tile; DataTime recordTime = null; if (resourceData.getBinOffset() != null || resourceData.equals(0)) { BinOffset binOffset = resourceData.getBinOffset(); @@ -562,4 +563,18 @@ public class SatResource extends issueRefresh(); } + public List getImages(IGraphicsTarget target, + PaintProperties paintProps) throws VizException { + this.target = target; + this.displayedDate = paintProps.getDataTime(); + if (this.displayedDate == null) + return Collections.emptyList(); + + currentTile = this.tileSet.get(this.displayedDate); + if (currentTile != null) { + return currentTile.getImages(target, paintProps); + } + return Collections.emptyList(); + } + }