## com.bbn.openmap.omGraphics.geom
Class PolygonGeometry.LL

    java.lang.Object
      com.bbn.openmap.omGraphics.geom.BasicGeometry
          com.bbn.openmap.omGraphics.geom.PolygonGeometry
              com.bbn.openmap.omGraphics.geom.PolygonGeometry.LL

All Implemented Interfaces:
  OMGeometry, OMGraphicConstants, java.io.Serializable

Direct Known Subclasses:
  PolylineGeometry.LL

Enclosing class:
  PolygonGeometry

public static class PolygonGeometry.LL
extends PolygonGeometry

See Also:
  Serialized Form

Nested Class Summary

Nested classes inherited from class com.bbn.openmap.omGraphics.geom.PolygonGeometry
`PolygonGeometry.LL, PolygonGeometry.Offset, PolygonGeometry.XY`

Field Summary
`protected int` `nsegs` Number of segments to draw (used only for LINETYPE_GREATCIRCLE or LINETYPE_RHUMB lines).
`protected float[]` `rawllpts` raw float lats and lons stored internally in radians.

Fields inherited from class com.bbn.openmap.omGraphics.geom.PolygonGeometry
`doShapes, isPolygon, xpoints, ypoints`

Fields inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry
`APP_OBJECT_KEY, appObject, ATT_MAP_KEY, lineType, needToRegenerate, shape, visible`

Fields inherited from interface com.bbn.openmap.omGraphics.OMGraphicConstants

`ADD_GRAPHIC_MASK, BASIC_STROKE, CHANGE_APPEARANCE, clear, DECIMAL_DEGREES, DECLUTTERTYPE_LINE, DECLUTTERTYPE_MOVE, DECLUTTERTYPE_NONE, DECLUTTERTYPE_SPACE, DEFAULT_ROTATIONANGLE, DELETE_GRAPHIC_MASK, DESELECT_GRAPHIC_MASK, DESELECTALL_GRAPHIC_MASK, GRAPHICTYPE_ARC, GRAPHICTYPE_BITMAP, GRAPHICTYPE_CIRCLE, GRAPHICTYPE_ELLIPSE, GRAPHICTYPE_GRAPHIC, GRAPHICTYPE_GRID, GRAPHICTYPE_LINE, GRAPHICTYPE_POINT, GRAPHICTYPE_POLY, GRAPHICTYPE_RASTER, GRAPHICTYPE_RECTANGLE, GRAPHICTYPE_TEXT, INFOLINE, LABEL, LINETYPE_GREATCIRCLE, LINETYPE_RHUMB, LINETYPE_STRAIGHT, LINETYPE_UNKNOWN, LOWER_GRAPHIC_MASK, LOWER_TO_BOTTOM_GRAPHIC_MASK, RADIANS, RAISE_GRAPHIC_MASK, RAISE_TO_TOP_GRAPHIC_MASK, REMOVABLE, RENDERTYPE_LATLON, RENDERTYPE_OFFSET, RENDERTYPE_UNKNOWN, RENDERTYPE_XY, SELECT_GRAPHIC_MASK, SORT_GRAPHICS_MASK, TOOLTIP, UPDATE_GRAPHIC_MASK`

Constructor Summary
`PolygonGeometry.LL(float[] llPoints, int units, int lType)` Create an LL PolygonGeometry from a list of float lat/lon pairs.
`PolygonGeometry.LL(float[] llPoints, int units, int lType, int nsegs)` Create an OMPoly from a list of float lat/lon pairs.

Method Summary
`protected void` `createShape()` Since OMPoly has the option to not create a Shape, this method is here to create it if it is asked for.
`boolean` `generate(Projection proj)` Prepare the geometry for rendering.
`float[]` `getLatLonArray()` Return the rawllpts array.
`int` `getNumSegs()` Get the number of subsegments for each segment in the poly.
`int` `getRenderType()` Return the render type.
`void` `setLocation(float[] llPoints, int units)` Set an OMPoly from a list of float lat/lon pairs.
`void` `setNumSegs(int nsegs)` Set the number of subsegments for each segment in the poly.

Methods inherited from class com.bbn.openmap.omGraphics.geom.PolygonGeometry
`distance, getDoShapes, getIsPolygon, getShape, setDoShapes, setIsPolygon`

Methods inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry

`_distance, appendShapeEdge, appendShapeEdge, appendShapeEdge, appendShapeEdge, checkAttributeMap, checkAttributeMap, clearAttributes, contains, createAttributeMap, createBoxShape, createShape, createShape, describeShapeDetail, describeShapeDetail, deselect, distanceToEdge, draw, fill, getAppObject, getAppObject, getAttribute, getAttributeMap, getAttributes, getLineType, getNeedToRegenerate, isRenderable, isVisible, putAttribute, regenerate, removeAttribute, replaceAppObjectWithAttributeMap, select, setAppObject, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape, setVisible`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.bbn.openmap.omGraphics.OMGeometry
`clearAttributes, contains, deselect, draw, fill, getAppObject, getAttribute, getAttributes, getLineType, getNeedToRegenerate, isRenderable, isVisible, putAttribute, regenerate, removeAttribute, select, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape, setVisible`

Field Detail

### rawllpts

    protected float[] rawllpts

  raw float lats and lons stored internally in radians.

### nsegs

    protected int nsegs

  Number of segments to draw (used only for LINETYPE_GREATCIRCLE or LINETYPE_RHUMB lines).

Constructor Detail

### PolygonGeometry.LL

    public PolygonGeometry.LL(float[] llPoints,
                              int units,
                              int lType,
                              int nsegs)

  Create an OMPoly from a list of float lat/lon pairs.

  NOTES:

  - llPoints array is converted into radians IN PLACE for more efficient handling internally if it's not already in radians! For even better performance, you should send us an array already in radians format!
  - If you want the poly to be connected (as a polygon), you need to ensure that the first and last coordinate pairs are the same.

Parameters:
  `llPoints` - array of lat/lon points, arranged lat, lon, lat, lon, etc.
  `units` - radians or decimal degrees. Use OMGraphic.RADIANS or OMGraphic.DECIMAL_DEGREES
  `lType` - line type, from a list defined in OMGraphic.
  `nsegs` - number of segment points (only for LINETYPE_GREATCIRCLE or LINETYPE_RHUMB line types, and if < 1, this value is generated internally)

### PolygonGeometry.LL

    public PolygonGeometry.LL(float[] llPoints,
                              int units,
                              int lType)

  Create an LL PolygonGeometry from a list of float lat/lon pairs.

  NOTES:

  - llPoints array is converted into radians IN PLACE for more efficient handling internally if it's not already in radians! For even better performance, you should send us an array already in radians format!
  - If you want the poly to be connected (as a polygon), you need to ensure that the first and last coordinate pairs are the same.

Parameters:
  `llPoints` - array of lat/lon points, arranged lat, lon, lat, lon, etc.
  `units` - radians or decimal degrees. Use OMGraphic.RADIANS or OMGraphic.DECIMAL_DEGREES
  `lType` - line type, from a list defined in OMGraphic.

Method Detail

### setLocation

    public void setLocation(float[] llPoints,
                            int units)

  Set an OMPoly from a list of float lat/lon pairs.

  NOTES:

  - llPoints array is converted into radians IN PLACE for more efficient handling internally if it's not already in radians! If you don't want the array to be changed, send in a copy.
  - If you want the poly to be connected (as a polygon), you need to ensure that the first and last coordinate pairs are the same.
  This is for RENDERTYPE_LATLON polys.

  Parameters:
    `llPoints` - array of lat/lon points, arranged lat, lon, lat, lon, etc.
    `units` - radians or decimal degrees. Use OMGraphic.RADIANS or OMGraphic.DECIMAL_DEGREES

### getLatLonArray

    public float[] getLatLonArray()

  Return the rawllpts array. NOTE: this is an unsafe method to access the rawllpts array. Use with caution. These are RADIANS!

  Returns:
    float[] rawllpts of lat, lon, lat, lon

### setNumSegs

    public void setNumSegs(int nsegs)

  Set the number of subsegments for each segment in the poly. (This is only for LINETYPE_GREATCIRCLE or LINETYPE_RHUMB line types, and if < 1, this value is generated internally).

  Parameters:
    `nsegs` - number of segment points

### getNumSegs

    public int getNumSegs()

  Get the number of subsegments for each segment in the poly. (This is only for LINETYPE_GREATCIRCLE or LINETYPE_RHUMB line types).

  Returns:
    int number of segment points

### generate

    public boolean generate(Projection proj)

  Description copied from interface: `OMGeometry`
  Prepare the geometry for rendering. This must be done before calling `render()`! If a vector graphic has lat-lon components, then we project these vertices into x-y space. For raster graphics we prepare in a different fashion.

  If the generate is unsuccessful, it's usually because of some oversight, (for instance if `proj` is null), and if debugging is enabled, a message may be output to the controlling terminal.

  Specified by:
    `generate` in interface `OMGeometry`
  Specified by:
    `generate` in class `BasicGeometry`
  Parameters:
    `proj` - Projection
  Returns:
    boolean true if successful, false if not.
  See Also:
    `BasicGeometry.regenerate(com.bbn.openmap.proj.Projection)`

### createShape

    protected void createShape()

  Description copied from class: `PolygonGeometry`
  Since OMPoly has the option to not create a Shape, this method is here to create it if it is asked for. The OMPoly needs to be generated.

  Specified by:
    `createShape` in class `PolygonGeometry`

### getRenderType

    public int getRenderType()

  Description copied from interface: `OMGeometry`
  Return the render type.

  Specified by:
    `getRenderType` in interface `OMGeometry`
  Specified by:
    `getRenderType` in class `BasicGeometry`
  Returns:
    the rendertype of the object - RENDERTYPE_LATLON, RENDERTYPE_XY, RENDERTYPE_OFFSET and RENDERTYPE_UNKNOWN.

Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details