NASA World Wind

gov.nasa.worldwind.render
Class SurfaceShape

java.lang.Object
  extended by gov.nasa.worldwind.render.SurfaceShape
All Implemented Interfaces:
Disposable, Movable, Renderable
Direct Known Subclasses:
SurfacePolygon

public abstract class SurfaceShape
extends Object
implements Renderable, Disposable, Movable


Field Summary
protected  Globe globe
           
protected  ArrayList<LatLon> positions
           
static Dimension TEXTURE_SIZE_1024
           
static Dimension TEXTURE_SIZE_128
           
static Dimension TEXTURE_SIZE_16
           
static Dimension TEXTURE_SIZE_256
           
static Dimension TEXTURE_SIZE_32
           
static Dimension TEXTURE_SIZE_512
           
static Dimension TEXTURE_SIZE_64
           
static Dimension TEXTURE_SIZE_8
           
 
Constructor Summary
SurfaceShape(Iterable<LatLon> positions, Color color, Color borderColor, Dimension textureSize)
           
 
Method Summary
static SurfaceShape createEllipse(Globe globe, LatLon center, double majorAxisLength, double minorAxisLength, Angle orientation, int intervals, Color interiorColor, Color borderColor, Dimension textureSize)
           
protected  void createTextureTiles()
           
 void dispose()
           
protected abstract  BufferedImage drawShape(Globe globe, Sector sector, BufferedImage image)
           
 Color getBorderColor()
           
 double getNumEdgeIntervalsPerDegree()
           
 Paint getPaint()
           
 Iterable<LatLon> getPositions()
           
 Position getReferencePosition()
           
 ArrayList<Sector> getSectors()
           
 Stroke getStroke()
           
 Dimension getTextureSize()
           
 boolean isAntiAlias()
           
 boolean isDrawBorder()
           
 boolean isDrawInterior()
           
 void move(Position delta)
          Shift the shape over the globe's surface while maintaining its original azimuth -- its orientation relative to North.
 void moveTo(Position position)
          Move the shape over the sphereoid surface while maintaining its original azimuth -- its orientation relative to North.
 void render(DrawContext dc)
          Causes this Renderable to render itself using the DrawContext provided.
 void setAntiAlias(boolean antiAlias)
           
 void setBorderColor(Color borderColor)
           
 void setDrawBorder(boolean drawBorder)
           
 void setDrawInterior(boolean drawInterior)
           
 void setNumEdgeIntervalsPerDegree(double numEdgeIntervals)
           
 void setPaint(Paint paint)
           
 void setPositions(Iterable<LatLon> positions)
           
 void setStroke(Stroke stroke)
           
 void setTextureSize(Dimension textureSize)
           
 void shiftTo(Position position)
          Move the shape over the sphereoid surface without maintaining its original azimuth -- its orientation relative to North.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

globe

protected Globe globe

positions

protected ArrayList<LatLon> positions

TEXTURE_SIZE_1024

public static Dimension TEXTURE_SIZE_1024

TEXTURE_SIZE_128

public static Dimension TEXTURE_SIZE_128

TEXTURE_SIZE_16

public static Dimension TEXTURE_SIZE_16

TEXTURE_SIZE_256

public static Dimension TEXTURE_SIZE_256

TEXTURE_SIZE_32

public static Dimension TEXTURE_SIZE_32

TEXTURE_SIZE_512

public static Dimension TEXTURE_SIZE_512

TEXTURE_SIZE_64

public static Dimension TEXTURE_SIZE_64

TEXTURE_SIZE_8

public static Dimension TEXTURE_SIZE_8
Constructor Detail

SurfaceShape

public SurfaceShape(Iterable<LatLon> positions,
                    Color color,
                    Color borderColor,
                    Dimension textureSize)
Method Detail

createEllipse

public static SurfaceShape createEllipse(Globe globe,
                                         LatLon center,
                                         double majorAxisLength,
                                         double minorAxisLength,
                                         Angle orientation,
                                         int intervals,
                                         Color interiorColor,
                                         Color borderColor,
                                         Dimension textureSize)

createTextureTiles

protected void createTextureTiles()

dispose

public void dispose()
Specified by:
dispose in interface Disposable

drawShape

protected abstract BufferedImage drawShape(Globe globe,
                                           Sector sector,
                                           BufferedImage image)

getBorderColor

public Color getBorderColor()

getNumEdgeIntervalsPerDegree

public double getNumEdgeIntervalsPerDegree()

getPaint

public Paint getPaint()

getPositions

public Iterable<LatLon> getPositions()

getReferencePosition

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

getSectors

public ArrayList<Sector> getSectors()

getStroke

public Stroke getStroke()

getTextureSize

public Dimension getTextureSize()

isAntiAlias

public boolean isAntiAlias()

isDrawBorder

public boolean isDrawBorder()

isDrawInterior

public boolean isDrawInterior()

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 shapes reference position.

moveTo

public void moveTo(Position position)
Move the shape over the sphereoid surface while maintaining its original azimuth -- its orientation relative to North.

Specified by:
moveTo in interface Movable
Parameters:
position - the new position to move the shapes reference position to.

render

public void render(DrawContext dc)
Description copied from interface: Renderable
Causes this Renderable to render itself using the DrawContext provided. The DrawContext provides the elevation model, openGl instance, globe and other information required for drawing. It is recommended that the DrawContext is non-null as most implementations do not support null DrawContexts.

Specified by:
render in interface Renderable
Parameters:
dc - the DrawContext to be used
See Also:
DrawContext

setAntiAlias

public void setAntiAlias(boolean antiAlias)

setBorderColor

public void setBorderColor(Color borderColor)

setDrawBorder

public void setDrawBorder(boolean drawBorder)

setDrawInterior

public void setDrawInterior(boolean drawInterior)

setNumEdgeIntervalsPerDegree

public void setNumEdgeIntervalsPerDegree(double numEdgeIntervals)

setPaint

public void setPaint(Paint paint)

setPositions

public void setPositions(Iterable<LatLon> positions)

setStroke

public void setStroke(Stroke stroke)

setTextureSize

public void setTextureSize(Dimension textureSize)

shiftTo

public void shiftTo(Position position)
Move the shape over the sphereoid surface without maintaining its original azimuth -- its orientation relative to North.

Parameters:
position - the new position to move the shapes reference position to.

NASA World Wind