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, _typeFields 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
ConstructorsModifierConstructorDescriptionprotectedAiShapePolygon(int type) AiShapePolygon(int index, Vector worldRegions) -
Method Summary
Modifier and TypeMethodDescriptionclone()booleanChecks if point is contained in AiShapePolygon shape.intReturns the number of bytes in the body of the shape.booleandoublegetArea()Returns the area for this polygon.booleanChecks if point is in one of the World region in AiShapePolygon, and adds it to the selected region.intreadRecord(EndianInputStream input) booleanChecks if point is in one of the World region in AiShapePolygon, and removes it from the selected region.voidwriteRecord(EndianOutputStream output) Methods inherited from class hec.map.aishape.AiShapeObject
getAttribute, getBytesRead, getExtent, getFields, getIndex, printFields, readBoundingBox, readRecordHeader, recordByteLength, setAttribute, writeBoundingBox, writeRecordHeaderMethods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
contentByteLengthin classAiShapeObject
-
writeRecord
- Specified by:
writeRecordin classAiShapeObject- Throws:
IOException
-
readRecord
- Overrides:
readRecordin classAiShapeObject
-
getReferencePt
-
getRegions
- Specified by:
getRegionsin 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:
containsin 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:
clonein classObject- Throws:
CloneNotSupportedException
-