com.moximedia.aims
Class AimsHole

java.lang.Object
  extended bycom.moximedia.aims.AimsHole
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class AimsHole
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Implementation of an ArcIMS polygon ring hole object.

Author:
Doug Cates - www.moximedia.com
See Also:
Serialized Form

Constructor Summary
AimsHole()
          Creates a new hole object with no arguments.
AimsHole(AimsPoints pts)
          Creates a new hole object with an AimsPoints object.
 
Method Summary
 void addPoint(AimsPoint pt)
          Adds a point to the hole.
protected  boolean addVertexToSegmentAtDistance(AimsPoint pt, double segmentDistance)
           
 java.lang.Object clone()
          Creates a copy of this symbol.
 boolean contains(AimsPoint pt)
          Tests to see if the hole contains a point.
 void densify(double distance)
          Densifies the points in the shape by a distance.
 void generalize(double distance)
          Generalizes the points in the shape by a distance.
 double getArea()
          Returns the area of the hole, in square map units.
 AimsPoint getClosestVertex(AimsPoint pt)
          Gets the point in the hole boundary that is closest to the indicated point.
 double getDistanceToClosestLineSegment(AimsPoint pt)
           
 AimsEnvelope getExtent()
          Returns the extent of the hol3, or null if the hole has no points.
 AimsPoints getPoints()
          Gets the points of the hole object.
 boolean movePoint(AimsPoint ptFrom, AimsPoint ptTo)
          Moves a point of the polygon hole to a new position.
 void offsetBy(AimsPoint offset)
          Offsets the points in the hole by the x and y in a point.
 AimsHole project(Projection projection)
          Projects this object to the specified projection.
 AimsHole project(Projection fromProjection, Projection toProjection)
          Projects this object from one projection to another.
 boolean removePoint(AimsPoint pt)
          Removes a point from the hole, retaining matching first and last point.
 void setPoints(AimsPoints points)
          Sets the points of the ring hole object.
 java.lang.String toAxlString()
          Returns the AXL string to refresh this object.
 java.lang.String toAxlString(AimsEnvironment env)
          Returns the AXL string to refresh this object.
 java.lang.String toGmlString()
           
 com.vividsolutions.jts.geom.LinearRing toJtsLinearRing()
           
 java.lang.String toString()
          Returns a text representation of of this object.
 AimsHole unproject(Projection projection)
          Unprojects this object to geographic from the specified projection.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AimsHole

public AimsHole()
Creates a new hole object with no arguments.


AimsHole

public AimsHole(AimsPoints pts)
Creates a new hole object with an AimsPoints object.

Parameters:
pts - The points of the boundary.
Method Detail

getArea

public double getArea()
Returns the area of the hole, in square map units.

Returns:
The area.

getClosestVertex

public AimsPoint getClosestVertex(AimsPoint pt)
Gets the point in the hole boundary that is closest to the indicated point.

Parameters:
pt - The point to test.
Returns:
The closest point, or null if the hole has no boundary.

getDistanceToClosestLineSegment

public double getDistanceToClosestLineSegment(AimsPoint pt)

addVertexToSegmentAtDistance

protected boolean addVertexToSegmentAtDistance(AimsPoint pt,
                                               double segmentDistance)

addPoint

public void addPoint(AimsPoint pt)
Adds a point to the hole.

Parameters:
pt - The point to add to the hole.

densify

public void densify(double distance)
Densifies the points in the shape by a distance.

Parameters:
distance - The densify distance.

generalize

public void generalize(double distance)
Generalizes the points in the shape by a distance.

Parameters:
distance - The generalize distance.

offsetBy

public void offsetBy(AimsPoint offset)
Offsets the points in the hole by the x and y in a point.

Parameters:
offset - An AimsPoint object containing the offset.

removePoint

public boolean removePoint(AimsPoint pt)
Removes a point from the hole, retaining matching first and last point.

Parameters:
pt - The point to remove,
Returns:
True if the point is removed, otherwise false.

movePoint

public boolean movePoint(AimsPoint ptFrom,
                         AimsPoint ptTo)
Moves a point of the polygon hole to a new position.

Parameters:
ptFrom - The point to move.
ptTo - Where to move it.
Returns:
True if the point is moved, otherwise false.

contains

public boolean contains(AimsPoint pt)
Tests to see if the hole contains a point.

Parameters:
pt - A point to test to see if it is contained in the hole.
Returns:
True if the hole contains the point, otherwise false.

getExtent

public AimsEnvelope getExtent()
Returns the extent of the hol3, or null if the hole has no points.

Returns:
An AimsEnvelope containing the extent.

getPoints

public AimsPoints getPoints()
Gets the points of the hole object.

Returns:
An AimsPoints object containing the ring hole.

setPoints

public void setPoints(AimsPoints points)
Sets the points of the ring hole object.

Parameters:
points - An AimsPoints object containing the ring hole points.

toString

public java.lang.String toString()
Returns a text representation of of this object.

Returns:
A string describing the object

toAxlString

public java.lang.String toAxlString()
Returns the AXL string to refresh this object. This method is not typically used by the application programmer.

Returns:
The AXL string to refresh this object.

toAxlString

public java.lang.String toAxlString(AimsEnvironment env)
Returns the AXL string to refresh this object. This method is not typically used by the application programmer.

Parameters:
env - The AimsEnvironment object used to generate the proper AXL for the ArcIMS version in use.
Returns:
The AXL string to refresh this object.

toGmlString

public java.lang.String toGmlString()

clone

public java.lang.Object clone()
Creates a copy of this symbol.

Returns:
An object that is a copy of this object. The object must be cast to an AimsHole before use.

toJtsLinearRing

public com.vividsolutions.jts.geom.LinearRing toJtsLinearRing()

project

public AimsHole project(Projection fromProjection,
                        Projection toProjection)
Projects this object from one projection to another.

Parameters:
fromProjection - The projection of this object.
toProjection - The target projection.
Returns:
The projected object.

project

public AimsHole project(Projection projection)
Projects this object to the specified projection. It is assumed that the coordinate system of the original object is geographic.

Parameters:
projection - The original projection system.
Returns:
An object containing the projected coordinates.

unproject

public AimsHole unproject(Projection projection)
Unprojects this object to geographic from the specified projection.

Parameters:
projection - The projection system.
Returns:
An object containing the unprojected coordinates.


Internet Mapping Framework for ArcIMS Java Object Model API (v5.1.00)
Copyright © 2006 Moxi Media Inc. and Province of British Columbia. All Rights Reserved.