com.partnersoft.formats.shapefile
Class ShpCurve

java.lang.Object
  extended by com.partnersoft.formats.shapefile.ShpCurve
All Implemented Interfaces:
Immutable

public class ShpCurve
extends java.lang.Object
implements Immutable

Curved arcs are not specified in the ESRI shapefile document; however they do occur in Arc/Info shapes. The actual shape encountered we have dubbed a "ShpPolyCurve", since it is essentially a variation on a ShpPolyLine that contains curved as well as straight segments.

Despite the name prefix, this is not currently an implementation of ShpShape, since we have yet to find it in an ESRI blob as a standalone geometry. It is used to store the parts of a ShpPolyCurve.

Copyright 2007-2008 Partner Software, Inc.

Version:
$Id: ShpCurve.java 1701 2009-01-13 22:11:48Z paul $
Author:
Paul Reavis

Constructor Summary
ShpCurve(double x, double y)
           
ShpCurve(double x, double y, int code1, double controlX, double controlY, int code2)
           
 
Method Summary
 boolean equals(java.lang.Object nother)
           
 int getCode1()
          The first integer code for the arc.
 int getCode2()
          The second integer code for the arc.
 double getControlX()
           
 double getControlY()
           
 double getX()
           
 double getY()
           
 boolean isClockwise()
          Returns true if the arc proceeds clockwise from this ShpCurve's xy position to the next's.
 boolean isControlTheCenter()
          Returns true if the arc control point is the center of the arc's circle.
 boolean isCurved()
          Returns true if this is actually a curved segment.
 java.lang.String toString()
           
 XyPath toXyPath(ShpCurve curve2, ShpCurve curve3)
          Converts this ShpCurve to an XyPath, using the ones following it.
 XyPoint toXyPoint()
          Converts just the starting point to an XyPoint.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ShpCurve

public ShpCurve(double x,
                double y)

ShpCurve

public ShpCurve(double x,
                double y,
                int code1,
                double controlX,
                double controlY,
                int code2)
Method Detail

toXyPoint

public XyPoint toXyPoint()
Converts just the starting point to an XyPoint.


toXyPath

public XyPath toXyPath(ShpCurve curve2,
                       ShpCurve curve3)
Converts this ShpCurve to an XyPath, using the ones following it.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object nother)
Overrides:
equals in class java.lang.Object

isCurved

public boolean isCurved()
Returns true if this is actually a curved segment.


getX

public double getX()

getY

public double getY()

getControlX

public double getControlX()

getControlY

public double getControlY()

getCode1

public int getCode1()
The first integer code for the arc. Without a reference specification, we don't know what the right name for this is. This is the integer that appears at the beginning of the arc definition, before the control coordinates.

Returns:
first code

getCode2

public int getCode2()
The second integer code for the arc. Without a reference specification, we don't know what the right name for this is. This is the integer that appears at the end of the arc definition, after the control coordinates.

Returns:
first code

isClockwise

public boolean isClockwise()
Returns true if the arc proceeds clockwise from this ShpCurve's xy position to the next's.


isControlTheCenter

public boolean isControlTheCenter()
Returns true if the arc control point is the center of the arc's circle.