Package hec.map.aishape
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
AiShapePolygon class replicates Arc Info Polygon
shape type
September 1998
September 1998
- See Also:
-
Field Summary
Fields inherited from class hec.map.aishape.AiShapeObject
_contentLength, _contentRead, _index, _type
Fields inherited from interface hec.map.aishape.AiShapeConst
DEBUG, FILE_CODE, HIGHLIGHT_MODIFIER, QUERY_FLASH_LENGTH, SHAPE_TYPE_ARC, SHAPE_TYPE_MULTI_POINT, SHAPE_TYPE_NULL, SHAPE_TYPE_POINT, SHAPE_TYPE_POINT_M, SHAPE_TYPE_POINT_Z, SHAPE_TYPE_POLYGON, SHAPE_TYPE_POLYGON_M, SHAPE_TYPE_POLYGON_Z, SHAPE_TYPE_POLYLINE_M, SHAPE_TYPE_POLYLINE_Z, VERSION, XY_QUERY_TOLERANCE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AiShapePolygon
(int type) AiShapePolygon
(int index, Vector worldRegions) -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
Checks if point is contained in AiShapePolygon shape.int
Returns the number of bytes in the body of the shape.boolean
double
getArea()
Returns the area for this polygon.boolean
Checks if point is in one of the World region in AiShapePolygon, and adds it to the selected region.int
readRecord
(EndianInputStream input) boolean
Checks if point is in one of the World region in AiShapePolygon, and removes it from the selected region.void
writeRecord
(EndianOutputStream output) Methods inherited from class hec.map.aishape.AiShapeObject
getAttribute, getBytesRead, getExtent, getFields, getIndex, printFields, readBoundingBox, readRecordHeader, recordByteLength, setAttribute, writeBoundingBox, writeRecordHeader
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface hec.map.importer.ImportObject
getAttribute
-
Constructor Details
-
AiShapePolygon
public AiShapePolygon() -
AiShapePolygon
protected AiShapePolygon(int type) -
AiShapePolygon
- Throws:
SelfIntersectingPolygonException
-
-
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 classAiShapeObject
-
writeRecord
- Specified by:
writeRecord
in classAiShapeObject
- Throws:
IOException
-
readRecord
- Overrides:
readRecord
in classAiShapeObject
-
getReferencePt
-
getRegions
- Specified by:
getRegions
in interfaceImportPolygon
- Returns:
-
contains
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 classAiShapeObject
-
insertPt
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
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
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-