com.moximedia.aims
Class AimsLine

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

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

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

Constructor Summary
AimsLine()
          Do not use.
AimsLine(AimsPoint startPoint, AimsPoint endPoint)
          Creates new AimsLine
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(AimsLine line)
           
 AimsPoints getCrossings(AimsRing ring)
           
 AimsPoint getEndPoint()
           
 AimsPoint getIntersection(AimsLine line)
           
 double getLength()
          Gets the length of the line.
 AimsPoint getStartPoint()
           
 boolean intersects(AimsLine line)
          Tests if the line segment in the argument intersects this line.
 void offsetBy(AimsPoint offset)
          Offsets the points in the line by the x and y in a point.
 int relativeCCW(double X1, double Y1, double X2, double Y2, double PX, double PY)
          Returns an indicator of where the specified point (PX, PY) lies with respect to the line segment from (X1, Y1) to (X2, Y2).
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AimsLine

public AimsLine()
Do not use. For serialization only


AimsLine

public AimsLine(AimsPoint startPoint,
                AimsPoint endPoint)
Creates new AimsLine

Method Detail

getLength

public double getLength()
Gets the length of the line.

Returns:
The length of the line.

offsetBy

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

Parameters:
offset - An AimsPoint object containing the offset.

getStartPoint

public AimsPoint getStartPoint()

getEndPoint

public AimsPoint getEndPoint()

getCrossings

public AimsPoints getCrossings(AimsRing ring)

relativeCCW

public int relativeCCW(double X1,
                       double Y1,
                       double X2,
                       double Y2,
                       double PX,
                       double PY)
Returns an indicator of where the specified point (PX, PY) lies with respect to the line segment from (X1, Y1) to (X2, Y2). The value is 1 if the line segment must turn counterclockwise to point at the specified point, -1 if it must turn clockwise, or 0 if the point lies exactly on the line segment. If the point is colinear with the line segment, but not between the endpoints, then the value will be -1 if the point lies "beyond (X1, Y1)" or 1 if the point lies "beyond (X2, Y2)". Note that an indicator value of 0 is rare and not useful for determining colinearity because of floating point rounding issues.

Returns:
an integer that indicates the position of the third specified coordinates with respect to the line segment formed by the first two specified coordinates.

intersects

public boolean intersects(AimsLine line)
Tests if the line segment in the argument intersects this line.

Parameters:
line - The line to compare.
Returns:
true if the specified line segment intersects this line; false otherwise.

getIntersection

public AimsPoint getIntersection(AimsLine line)

equals

public boolean equals(AimsLine line)

clone

public java.lang.Object clone()


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