NASA World Wind

gov.nasa.worldwind.render
Class ContourLine

java.lang.Object
  extended by gov.nasa.worldwind.render.ContourLine
All Implemented Interfaces:
Renderable
Direct Known Subclasses:
ContourLinePolygon

public class ContourLine
extends 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 Summary
protected  Object globeStateKey
           
protected  int maxConnectingDistance
           
 
Constructor Summary
ContourLine()
           
ContourLine(double elevation)
           
ContourLine(double elevation, Sector sector)
           
ContourLine(Sector sector)
           
 
Method Summary
protected  ArrayList<Intersection> filterIntersections(DrawContext dc, ArrayList<Intersection> list)
          Filters the given intersection segments list according to some criteria - here the inclusion inside the bounding sector.
protected  ArrayList<Intersection> filterIntersectionsOnViewFrustum(DrawContext dc, ArrayList<Intersection> list)
          Filters the given intersection segments list according to the current view frustum.
 Color getColor()
          Get the contour line color.
 double getElevation()
          Get the contour line current elevation.
 double getLineWidth()
          Get the contour line width.
 List<Renderable> getRenderables()
           
 Sector getSector()
          Get the contour line current bounding sector.
 boolean isEnabled()
           
protected  boolean isValid(DrawContext dc)
           
 boolean isViewClippingEnabled()
          Indicates whether view volume clipping is performed.
protected  void makeContourLine(DrawContext dc)
          Update the renderable list with appropriate renderables to display the contour line.
protected  int makePolylinesConnected(DrawContext dc, ArrayList<Intersection> inter, int tolerance)
          Add a set of Polyline objects to the contour line renderable list by connecting as much as possible the segments from the given Intersection array.
 void render(DrawContext dc)
          Causes this Renderable to render itself using the provided draw context.
 void setColor(Color color)
          Set the contour line color.
 void setElevation(double elevation)
          Set the contour line elevation.
 void setEnabled(boolean state)
           
 void setLineWidth(double width)
          Set the contour line width.
 void setSector(Sector sector)
          Set the contour line bounding sector.
 void setViewClippingEnabled(boolean viewClippingEnabled)
          Set whether view volume clipping is performed.
 void update()
          Update the contour line according to the current terrain geometry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

globeStateKey

protected Object globeStateKey

maxConnectingDistance

protected int maxConnectingDistance
Constructor Detail

ContourLine

public ContourLine()

ContourLine

public ContourLine(double elevation)

ContourLine

public ContourLine(double elevation,
                   Sector sector)

ContourLine

public ContourLine(Sector sector)
Method Detail

filterIntersections

protected ArrayList<Intersection> filterIntersections(DrawContext dc,
                                                      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.

filterIntersectionsOnViewFrustum

protected ArrayList<Intersection> filterIntersectionsOnViewFrustum(DrawContext dc,
                                                                   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.

getColor

public Color getColor()
Get the contour line color.

Returns:
the contour line color.

getElevation

public double getElevation()
Get the contour line current elevation.

Returns:
the contour line current elevation.

getLineWidth

public double getLineWidth()
Get the contour line width.

Returns:
the contour line width.

getRenderables

public List<Renderable> getRenderables()

getSector

public Sector getSector()
Get the contour line current bounding sector.

Returns:
the contour line current bounding sector.

isEnabled

public boolean isEnabled()

isValid

protected boolean isValid(DrawContext dc)

isViewClippingEnabled

public boolean isViewClippingEnabled()
Indicates whether view volume clipping is performed.

Returns:
true if view volume clipping is performed, otherwise false (the default).

makeContourLine

protected void makeContourLine(DrawContext dc)
Update the renderable list with appropriate renderables to display the contour line.

Parameters:
dc - the current DrawContext.

makePolylinesConnected

protected int makePolylinesConnected(DrawContext dc,
                                     ArrayList<Intersection> inter,
                                     int tolerance)
Add a set of Polyline 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 Polyline objects added.

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

setColor

public void setColor(Color color)
Set the contour line color.

Parameters:
color - the contour line color.

setElevation

public void setElevation(double elevation)
Set the contour line elevation.

Parameters:
elevation - the contour line elevation.

setEnabled

public void setEnabled(boolean state)

setLineWidth

public void setLineWidth(double width)
Set the contour line width.

Parameters:
width - the contour line width.

setSector

public void setSector(Sector sector)
Set the contour line bounding sector.

Parameters:
sector - the contour line bounding sector.

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.


NASA World Wind