Class RadarVolume

    • Field Detail

      • positions

        protected java.util.List<Position> positions
      • obstructionFlags

        protected int[] obstructionFlags
      • width

        protected int width
      • height

        protected int height
      • sideIndices

        protected java.nio.IntBuffer sideIndices
      • enableSides

        protected boolean enableSides
    • Constructor Detail

      • RadarVolume

        public RadarVolume​(java.util.List<Position> positions,
                           int[] obstructionFlags,
                           int width,
                           int height)
        Constructs a radar volume.
        Parameters:
        positions - the volume's positions, organized as two grids. The near grid is held in the first width x height entries, the far grid is held in the next width x height entries. This list is retained as-is and is not copied.
        obstructionFlags - flags indicating the obstruction state of the specified positions. This array is retained as-is and is not copied. Recognized values are NO_OBSTRUCTION indicating that the specified position is unobstructed, INTERNAL_OBSTRUCTION indicating that the position is obstructed beyond the near grid but before the far grid, EXTERNAL_OBSTRUCTION indicating that the position is obstructed before the near grid.
        width - the horizontal dimension of the grid.
        height - the vertical dimension of the grid.
        Throws:
        java.lang.IllegalArgumentException - if the positions list or inclusion flags array is null, the size of the inclusion flags array is less than the number of grid positions, the positions list is less than the specified size, or the width or height are less than 2.
    • Method Detail

      • isEnableSides

        public boolean isEnableSides()
      • setEnableSides

        public void setEnableSides​(boolean enableSides)
      • initialize

        protected void initialize()
        Description copied from class: AbstractShape
        Called during construction to establish any subclass-specific state such as different default values than those set by this class.
        Specified by:
        initialize in class AbstractShape
      • getCurrent

        protected RadarVolume.ShapeData getCurrent()
        Returns the current shape data cache entry.
        Returns:
        the current data cache entry.
      • getPositions

        public java.util.List<Position> getPositions()
        Returns the grid positions as specified to this object's constructor.
        Returns:
        this object's grid positions.
      • getObstructionFlags

        public int[] getObstructionFlags()
        Returns the inclusion flags as specified to this object's constructor.
        Returns:
        this object's inclusion flags.
      • getWidth

        public int getWidth()
        Indicates the grid width.
        Returns:
        the grid width.
      • getHeight

        public int getHeight()
        Indicates the grid height.
        Returns:
        the grid height.
      • mustApplyTexture

        protected boolean mustApplyTexture​(DrawContext dc)
        Description copied from class: AbstractShape
        Indicates whether texture should be applied to this shape. Called during rendering to determine whether texture state should be established during preparation for interior drawing.

        Note: This method always returns false during the pick pass.

        Specified by:
        mustApplyTexture in class AbstractShape
        Parameters:
        dc - the current draw context
        Returns:
        true if texture should be applied, otherwise false.
      • shouldUseVBOs

        protected boolean shouldUseVBOs​(DrawContext dc)
        Description copied from class: AbstractShape
        Indicates whether this shape should use OpenGL vertex buffer objects.
        Overrides:
        shouldUseVBOs in class AbstractShape
        Parameters:
        dc - the current draw context.
        Returns:
        true if this shape should use vertex buffer objects, otherwise false.
      • drawModel

        protected void drawModel​(DrawContext dc,
                                 int displayMode)
      • makeGridVertices

        protected void makeGridVertices​(DrawContext dc)
      • makeGridNormals

        protected void makeGridNormals()
      • computeCenterPoint

        protected void computeCenterPoint()
      • makeGridTriangles

        protected void makeGridTriangles()
        Forms the volume's front, back and bottom vertices and computes appropriate normals.
      • setTriangleNormals

        protected void setTriangleNormals​(int[] flags,
                                          int[] indices)
      • trimBuffer

        protected static java.nio.FloatBuffer trimBuffer​(java.nio.FloatBuffer buffer)
      • makeSides

        protected void makeSides()
      • fillVBO

        protected void fillVBO​(DrawContext dc)
        Description copied from class: AbstractShape
        Fill this shape's vertex buffer objects. If the vertex buffer object resource IDs don't yet exist, create them.

        A AbstractShape.AbstractShapeData must be current when this method is called.

        Specified by:
        fillVBO in class AbstractShape
        Parameters:
        dc - the current draw context.
      • getExtent

        public Extent getExtent​(Globe globe,
                                double verticalExaggeration)
        Description copied from interface: ExtentHolder
        Returns the objects enclosing volume as an Extent in model coordinates, given a specified Globe and vertical exaggeration (see SceneController.getVerticalExaggeration().
        Specified by:
        getExtent in interface ExtentHolder
        Overrides:
        getExtent in class AbstractShape
        Parameters:
        globe - the Globe the object is related to.
        verticalExaggeration - the vertical exaggeration of the scene containing this object.
        Returns:
        the object's Extent in model coordinates.
      • getSector

        public Sector getSector()
        Description copied from interface: GeographicExtent
        Returns the object's geographic extent.
        Returns:
        the object's geographic extent.
      • 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.
        Returns:
        the object's reference position, or null if no reference position is available.
      • 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.
        Parameters:
        position - the new position of the shape's reference position.
      • intersect

        public java.util.List<Intersection> intersect​(Line line,
                                                      Terrain terrain)
                                               throws java.lang.InterruptedException
        Description copied from class: AbstractShape
        Compute the intersections of a specified line with this shape. If the shape's altitude mode is other than WorldWind.ABSOLUTE, the shape's geometry is created relative to the specified terrain rather than the terrain used during rendering, which may be at lower level of detail than required for accurate intersection determination.
        Specified by:
        intersect in class AbstractShape
        Parameters:
        line - the line to intersect.
        terrain - the Terrain to use when computing the shape's geometry.
        Returns:
        a list of intersections identifying where the line intersects the shape, or null if the line does not intersect the shape.
        Throws:
        java.lang.InterruptedException - if the operation is interrupted.
        See Also:
        Terrain
      • doExportAsKML

        protected void doExportAsKML​(javax.xml.stream.XMLStreamWriter xmlWriter)
                              throws java.io.IOException,
                                     javax.xml.stream.XMLStreamException
        Description copied from class: AbstractShape
        Exports shape-specific fields.
        Specified by:
        doExportAsKML in class AbstractShape
        Parameters:
        xmlWriter - the export writer to write to.
        Throws:
        java.io.IOException - if an IO error occurs while writing to the output destination.
        javax.xml.stream.XMLStreamException - if an exception occurs converting this shape's fields to XML.