Class SurfaceImage

    • Field Detail

      • alwaysOnTop

        protected boolean alwaysOnTop
      • pickLayer

        protected Layer pickLayer
      • imageSource

        protected java.lang.Object imageSource
      • sourceTexture

        protected WWTexture sourceTexture
      • generatedTexture

        protected WWTexture generatedTexture
      • corners

        protected java.util.List<LatLon> corners
      • previousSourceTexture

        protected WWTexture previousSourceTexture
      • previousGeneratedTexture

        protected WWTexture previousGeneratedTexture
      • generatedTextureExpired

        protected boolean generatedTextureExpired
      • dragEnabled

        protected boolean dragEnabled
      • thisList

        protected java.util.List<SurfaceImage> thisList
        A list that contains only a reference to this instance. Used as an argument to the surface tile renderer to prevent its having to create a list every time this surface image is rendered.
    • Constructor Detail

      • SurfaceImage

        public SurfaceImage()
        Create a new surface image with no image source. The image will not be rendered until an image source is set.
      • SurfaceImage

        public SurfaceImage​(java.lang.Object imageSource,
                            Sector sector)
        Renders a single image tile from a local image source.
        Parameters:
        imageSource - either the file path to a local image or a BufferedImage reference.
        sector - the sector covered by the image.
      • SurfaceImage

        public SurfaceImage​(java.lang.Object imageSource,
                            java.lang.Iterable<? extends LatLon> corners)
    • Method Detail

      • dispose

        public void dispose()
        Description copied from interface: Disposable
        Disposes of any internal resources allocated by the object.
        Specified by:
        dispose in interface Disposable
      • setImageSource

        public void setImageSource​(java.lang.Object imageSource,
                                   Sector sector)
      • setImageSource

        public void setImageSource​(java.lang.Object imageSource,
                                   java.lang.Iterable<? extends LatLon> corners)
      • isPickEnabled

        public boolean isPickEnabled()
      • setPickEnabled

        public void setPickEnabled​(boolean pickEnabled)
      • isAlwaysOnTop

        public boolean isAlwaysOnTop()
        Indicates the state of this surface image's always-on-top flag.
        Returns:
        true if the always-on-top flag is set, otherwise false.
        See Also:
        setAlwaysOnTop(boolean)
      • setAlwaysOnTop

        public void setAlwaysOnTop​(boolean alwaysOnTop)
        Specifies whether this surface image should appear on top of other image layers and surface shapes in the scene. If the flag is true, this surface image appears visually above other image layers and surface shapes. Otherwise, this surface image appears interleaved with other image layers according to its relative order in the layer list, and appears beneath all surface shapes. The default is false.
        Parameters:
        alwaysOnTop - true if the surface image should appear always on top, otherwise false.
      • initializeGeometry

        protected void initializeGeometry​(java.lang.Iterable<? extends LatLon> corners)
      • getImageSource

        public java.lang.Object getImageSource()
      • getOpacity

        public double getOpacity()
      • setOpacity

        public void setOpacity​(double opacity)
      • setCorners

        public void setCorners​(java.lang.Iterable<? extends LatLon> corners)
      • getDistanceFromEye

        public double getDistanceFromEye()
        Description copied from interface: OrderedRenderable
        Returns the ordered renderable's distance from the current view's eye point. Intended to be used only to sort a list of ordered renderables according to eye distance, and only during frame generation when a view is active.
        Specified by:
        getDistanceFromEye in interface OrderedRenderable
        Returns:
        the distance of the ordered renderable from the current view's eye point.
      • render

        public void render​(DrawContext dc)
        Description copied from interface: Renderable
        Causes this Renderable to render itself using the provided draw context.
        Specified by:
        render in interface Renderable
        Parameters:
        dc - the DrawContext to be used
        See Also:
        DrawContext
      • pick

        public void pick​(DrawContext dc,
                         java.awt.Point pickPoint)
        Description copied from interface: OrderedRenderable
        Executes a pick of the ordered renderable.
        Specified by:
        pick in interface OrderedRenderable
        Parameters:
        dc - the current draw context.
        pickPoint - the pick point.
      • initializeSourceTexture

        protected void initializeSourceTexture​(DrawContext dc)
      • move

        public void move​(Position delta)
        Description copied from interface: Movable
        Shift the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.
        Specified by:
        move in interface Movable
        Parameters:
        delta - the latitude and longitude to add to the shape's reference position.
      • moveTo

        public void moveTo​(Position position)
        Description copied from interface: Movable
        Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.
        Specified by:
        moveTo in interface Movable
        Parameters:
        position - the new position of the shape's reference position.
      • getReferencePosition

        public Position getReferencePosition()
        Description copied from interface: Movable
        A position associated with the object that indicates its aggregate geographic position. The chosen position varies among implementers of this interface. For objects defined by a list of positions, the reference position is typically the first position in the list. For symmetric objects the reference position is often the center of the object. In many cases the object's reference position may be explicitly specified by the application.
        Specified by:
        getReferencePosition in interface Movable
        Returns:
        the object's reference position, or null if no reference position is available.
      • setReferencePosition

        protected void setReferencePosition​(Position referencePosition)
      • isDragEnabled

        public boolean isDragEnabled()
        Description copied from interface: Draggable
        Indicates whether the object is enabled for dragging.
        Specified by:
        isDragEnabled in interface Draggable
        Returns:
        true if the object is enabled, else false.
      • setDragEnabled

        public void setDragEnabled​(boolean enabled)
        Description copied from interface: Draggable
        Controls whether the object is enabled for dragging.
        Specified by:
        setDragEnabled in interface Draggable
        Parameters:
        enabled - true if the object is enabled, else false.
      • doDrag

        protected void doDrag​(DragContext dragContext)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • export

        public void export​(java.lang.String mimeType,
                           java.lang.Object output)
                    throws java.io.IOException
        Export the Surface Image. The output object will receive the exported data. The type of this object depends on the export format. The formats and object types supported by this class are:
         Format                                         Supported output object types
         ================================================================================
         KML (application/vnd.google-earth.kml+xml)     java.io.Writer
                                                        java.io.OutputStream
                                                        javax.xml.stream.XMLStreamWriter
         
        Specified by:
        export in interface Exportable
        Parameters:
        mimeType - MIME type of desired export format.
        output - An object that will receive the exported data. The type of this object depends on the export format (see above).
        Throws:
        java.io.IOException - If an exception occurs writing to the output object.
        See Also:
        Exportable.isExportFormatSupported(String)
      • exportAsKML

        protected void exportAsKML​(java.lang.Object output)
                            throws java.io.IOException,
                                   javax.xml.stream.XMLStreamException
        Export the surface image to KML as a <GroundOverlay> element. The output object will receive the data. This object must be one of: java.io.Writer java.io.OutputStream javax.xml.stream.XMLStreamWriter
        Parameters:
        output - Object to receive the generated KML.
        Throws:
        javax.xml.stream.XMLStreamException - If an exception occurs while writing the KML
        java.io.IOException - if an exception occurs while exporting the data.
        See Also:
        export(String, Object)
      • exportKMLLatLonBox

        protected void exportKMLLatLonBox​(javax.xml.stream.XMLStreamWriter xmlWriter)
                                   throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • exportKMLLatLonQuad

        protected void exportKMLLatLonQuad​(javax.xml.stream.XMLStreamWriter xmlWriter)
                                    throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException