NASA World Wind

gov.nasa.worldwind.render
Class ConformingPolygon

java.lang.Object
  extended by gov.nasa.worldwind.render.ConformingShape
      extended by gov.nasa.worldwind.render.ConformingPolygon
All Implemented Interfaces:
Disposable, MeasurableArea, MeasurableLength, Movable, Renderable, Restorable
Direct Known Subclasses:
ConformingEllipticalPolygon, ConformingQuad, ConformingSector

public class ConformingPolygon
extends ConformingShape


Nested Class Summary
 
Nested classes/interfaces inherited from class gov.nasa.worldwind.render.ConformingShape
ConformingShape.CacheKey
 
Field Summary
protected  Globe globe
           
 
Fields inherited from class gov.nasa.worldwind.render.ConformingShape
borderColor, borderWidth, CONFORMINGSHAPE_CACHE_KEY, CONFORMINGSHAPE_CACHE_NAME, drawBorder, drawInterior, fillColor
 
Constructor Summary
  ConformingPolygon(Globe g, Iterable<? extends LatLon> vertices)
          A Renderable polygon shape defined by a list of LatLon
  ConformingPolygon(Globe g, Iterable<? extends LatLon> vertices, Color fillColor, Color borderColor)
          A Renderable polygon shape defined by a list of LatLon
protected ConformingPolygon(Globe g, Iterable<? extends LatLon> vertices, Color fillColor, Color borderColor, boolean tessellateContour)
           
 
Method Summary
protected  void doGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)
           
protected  void doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
           
 double getArea(Globe globe)
          Returns the object's area in square meters.
 double getHeight(Globe globe)
          Returns the latitudanl length of the object in meters.
 double getLength(Globe globe)
          Returns the object's length in meters.
 double getPerimeter(Globe globe)
          Returns the length of the object's perimeter in meters.
 Position getReferencePosition()
           
 double getWidth(Globe globe)
          Returns the longitudinal length of the object in meters.
protected  void invalidateCache()
           
 void moveTo(Position position)
          Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.
protected  void renderBoundary(DrawContext dc, GL gl, boolean knownToBeVisible)
           
protected  boolean renderInterior(DrawContext dc, GL gl)
           
protected  void setOriginalVertices(Iterable<? extends LatLon> vertices)
           
 
Methods inherited from class gov.nasa.worldwind.render.ConformingShape
dispose, getBorderColor, getBorderWidth, getInteriorColor, getRestorableState, getUniqueSerialNumber, getUseFrustumCull, isAntiAlias, isDrawBorder, isDrawInterior, isExpired, move, render, restoreState, setAntiAlias, setBorderColor, setBorderWidth, setDrawBorder, setDrawInterior, setInteriorColor, setUseFrustumCull, sizeInBytesOf, updateExpiryCriteria
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

globe

protected Globe globe
Constructor Detail

ConformingPolygon

public ConformingPolygon(Globe g,
                         Iterable<? extends LatLon> vertices)
A Renderable polygon shape defined by a list of LatLon

Parameters:
g - the globe
vertices - the list of LatLon positions that makes the polygon

ConformingPolygon

public ConformingPolygon(Globe g,
                         Iterable<? extends LatLon> vertices,
                         Color fillColor,
                         Color borderColor)
A Renderable polygon shape defined by a list of LatLon

Parameters:
g - the globe
vertices - the list of LatLon positions that makes the polygon
fillColor - the interior fill color
borderColor - the border color

ConformingPolygon

protected ConformingPolygon(Globe g,
                            Iterable<? extends LatLon> vertices,
                            Color fillColor,
                            Color borderColor,
                            boolean tessellateContour)
Method Detail

doGetRestorableState

protected void doGetRestorableState(RestorableSupport rs,
                                    RestorableSupport.StateObject context)
Overrides:
doGetRestorableState in class ConformingShape

doRestoreState

protected void doRestoreState(RestorableSupport rs,
                              RestorableSupport.StateObject context)
Overrides:
doRestoreState in class ConformingShape

getArea

public double getArea(Globe globe)
Description copied from interface: MeasurableArea
Returns the object's area in square meters. If the object conforms to terrain, the area returned is the surface area of the terrain, including its hillsides and other undulations.

Parameters:
globe - The globe the object is related to.
Returns:
the object's area in square meters. Returns -1 if the object does not form an area due to an insufficient number of vertices or any other condition.

getHeight

public double getHeight(Globe globe)
Description copied from interface: MeasurableArea
Returns the latitudanl length of the object in meters. The length is the distance from the objects south-most point to its east-most position.

Parameters:
globe - The globe the object is related to.
Returns:
the height of the object in meters.

getLength

public double getLength(Globe globe)
Description copied from interface: MeasurableLength
Returns the object's length in meters. If the object conforms to terrain, the length is that along the terrain, including its hillsides and other undulations.

Parameters:
globe - The globe the object is related to.
Returns:
the object's length in meters.

getPerimeter

public double getPerimeter(Globe globe)
Description copied from interface: MeasurableArea
Returns the length of the object's perimeter in meters. If the object conforms to terrain, the perimeter is that along the terrain, including its hillsides and other undulations.

Parameters:
globe - The globe the object is related to.
Returns:
the object's perimeter in meters. Returns -1 if the object does not form an area due to an insufficient number of vertices or any other condition.

getReferencePosition

public Position getReferencePosition()
Specified by:
getReferencePosition in interface Movable
Specified by:
getReferencePosition in class ConformingShape

getWidth

public double getWidth(Globe globe)
Description copied from interface: MeasurableArea
Returns the longitudinal length of the object in meters. The length is the distance from the object's west-most point to its east-most. If the object is terrain conforming then the

Parameters:
globe - The globe the object is related to.
Returns:
the width of the object in meters.

invalidateCache

protected void invalidateCache()
Specified by:
invalidateCache in class ConformingShape

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
Specified by:
moveTo in class ConformingShape
Parameters:
position - the new position of the shape's reference position.

renderBoundary

protected void renderBoundary(DrawContext dc,
                              GL gl,
                              boolean knownToBeVisible)
Specified by:
renderBoundary in class ConformingShape

renderInterior

protected boolean renderInterior(DrawContext dc,
                                 GL gl)
Specified by:
renderInterior in class ConformingShape

setOriginalVertices

protected void setOriginalVertices(Iterable<? extends LatLon> vertices)

NASA World Wind