Class ContourLine

  • All Implemented Interfaces:
    Renderable
    Direct Known Subclasses:
    ContourLinePolygon

    public class ContourLine
    extends java.lang.Object
    implements Renderable
    Renders a contour line on the terrain at a given elevation. The contour line extent can be bounded by a Sector.
    • Field Detail

      • globeStateKey

        protected java.lang.Object globeStateKey
      • maxConnectingDistance

        protected int maxConnectingDistance
    • Constructor Detail

      • ContourLine

        public ContourLine()
      • ContourLine

        public ContourLine​(double elevation)
      • ContourLine

        public ContourLine​(Sector sector)
      • ContourLine

        public ContourLine​(double elevation,
                           Sector sector)
    • Method Detail

      • getElevation

        public double getElevation()
        Get the contour line current elevation.
        Returns:
        the contour line current elevation.
      • setElevation

        public void setElevation​(double elevation)
        Set the contour line elevation.
        Parameters:
        elevation - the contour line elevation.
      • getSector

        public Sector getSector()
        Get the contour line current bounding sector.
        Returns:
        the contour line current bounding sector.
      • setSector

        public void setSector​(Sector sector)
        Set the contour line bounding sector.
        Parameters:
        sector - the contour line bounding sector.
      • getColor

        public java.awt.Color getColor()
        Get the contour line color.
        Returns:
        the contour line color.
      • setColor

        public void setColor​(java.awt.Color color)
        Set the contour line color.
        Parameters:
        color - the contour line color.
      • getLineWidth

        public double getLineWidth()
        Get the contour line width.
        Returns:
        the contour line width.
      • setLineWidth

        public void setLineWidth​(double width)
        Set the contour line width.
        Parameters:
        width - the contour line width.
      • isEnabled

        public boolean isEnabled()
      • setEnabled

        public void setEnabled​(boolean state)
      • isViewClippingEnabled

        public boolean isViewClippingEnabled()
        Indicates whether view volume clipping is performed.
        Returns:
        true if view volume clipping is performed, otherwise false (the default).
      • setViewClippingEnabled

        public void setViewClippingEnabled​(boolean viewClippingEnabled)
        Set whether view volume clipping is performed.
        Parameters:
        viewClippingEnabled - true if view clipping should be performed, otherwise false (the default).
      • update

        public void update()
        Update the contour line according to the current terrain geometry.
      • getRenderables

        public java.util.List<Renderable> getRenderables()
      • 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
      • isValid

        protected boolean isValid​(DrawContext dc)
      • makeContourLine

        protected void makeContourLine​(DrawContext dc)
        Update the renderable list with appropriate renderables to display the contour line.
        Parameters:
        dc - the current DrawContext.
      • filterIntersectionsOnViewFrustum

        protected java.util.ArrayList<Intersection> filterIntersectionsOnViewFrustum​(DrawContext dc,
                                                                                     java.util.ArrayList<Intersection> list)
        Filters the given intersection segments list according to the current view frustum.
        Parameters:
        dc - the current DrawContext
        list - the list of Intersection to be filtered.
        Returns:
        the filtered list.
      • filterIntersections

        protected java.util.ArrayList<Intersection> filterIntersections​(DrawContext dc,
                                                                        java.util.ArrayList<Intersection> list)
        Filters the given intersection segments list according to some criteria - here the inclusion inside the bounding sector.
        Parameters:
        dc - the current DrawContext
        list - the list of Intersection to be filtered.
        Returns:
        the filtered list.
      • makePathsConnected

        protected int makePathsConnected​(DrawContext dc,
                                         java.util.ArrayList<Intersection> inter,
                                         int tolerance)
        Add a set of Path objects to the contour line renderable list by connecting as much as possible the segments from the given Intersection array.
        Parameters:
        dc - the current DrawContext.
        inter - the list of Intersection to sort out.
        tolerance - how far in meter can two points be considered connected.
        Returns:
        the number of Path objects added.