Class AiShapePolygon

java.lang.Object
hec.map.aishape.AiShapeObject
hec.map.aishape.AiShapePolygon
All Implemented Interfaces:
AiShapeConst, ImportObject, ImportPolygon, Serializable
Direct Known Subclasses:
AiShapePolygonM, AiShapePolygonZ

public class AiShapePolygon extends AiShapeObject implements ImportPolygon
AiShapePolygon class replicates Arc Info Polygon shape type
September 1998
See Also:
  • Constructor Details

  • Method Details

    • getArea

      public double getArea()
      Returns the area for this polygon. It is computed by taking the enclosing area and subtracting all of the "holes". "Holes" are defined as areas that have a counter-clockwise rotation of points. The area computation for each sub polygon are defined in WorldRegion
      Returns:
      double
      See Also:
    • contentByteLength

      public int contentByteLength()
      Returns the number of bytes in the body of the shape.
      Specified by:
      contentByteLength in class AiShapeObject
    • writeRecord

      public void writeRecord(EndianOutputStream output) throws IOException
      Specified by:
      writeRecord in class AiShapeObject
      Throws:
      IOException
    • readRecord

      public int readRecord(EndianInputStream input)
      Overrides:
      readRecord in class AiShapeObject
    • getReferencePt

      public WorldPt getReferencePt()
    • getRegions

      public Vector<WorldRegion> getRegions()
      Specified by:
      getRegions in interface ImportPolygon
      Returns:
    • contains

      public boolean contains(double tolerance, WorldPt wpt)
      Checks if point is contained in AiShapePolygon shape. This overrides WorldRegion contains() in that if the point lies inside an interior region (a hole) contains() returns false
      Overrides:
      contains in class AiShapeObject
    • insertPt

      public boolean insertPt(WorldPt wpt, double tol)
      Checks if point is in one of the World region in AiShapePolygon, and adds it to the selected region. In present form, add point to first region which is within tol
    • removePt

      public boolean removePt(WorldPt wpt, double tol)
      Checks if point is in one of the World region in AiShapePolygon, and removes it from the selected region. In present form, removes point from first region which is within tol
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • clone

      public Object clone() throws CloneNotSupportedException
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException