com.esri.arcgis.geometry
Interface ICurve

All Superinterfaces:
IGeometry, Serializable
All Known Subinterfaces:
IBezierCurve, IBezierCurve2, IBezierCurve3, ICircularArc, ICurve2, ICurve3, IEllipticArc, ILine, ILine2, ILine3, IPath, IPolycurve, IPolycurve2, IPolycurve3, IPolygon, IPolygon2, IPolygon3, IPolygon4, IPolyline, IPolyline2, IPolyline3, IPolyline4, IPolyline5, IPolyline6, IRing, IRing2, ISegment, ITopologicalSegment, ITopologicalSegment2
All Known Implementing Classes:
BezierCurve, CircularArc, EllipticArc, ICurveProxy, IPolycurve2Proxy, IPolycurve3Proxy, IPolycurveProxy, IPolyline2Proxy, IPolyline3Proxy, IPolyline4Proxy, IPolyline5Proxy, IPolyline6Proxy, IPolylineProxy, ISegmentProxy, ITopologicalSegment2Proxy, ITopologicalSegmentProxy, Line, Path, Polygon, Polyline, Ring

public interface ICurve
extends IGeometry, Serializable

Provides access to properties and methods of all 1 dimensional curves (polylines, segments, boundaries of polygons, etc.).

Superseded By

ICurve3

Description

A curve is an abstract one-dimensional geometry between specific From and To points. A curve can be composed of a single Segment, a Path of connected segments, or a Polycurve containing many paths of segments. The properties and methods of the curve allow the user to query information about the entire curve or points along the curve. The distance along the curve can be specified in a fixed unit of measure or as a ratio of the Length of the curve. The user can obtain information about Tangents, Normals, Subcurves, and Points along the curve.

Example:

\/*
* Application Name: CurveDemo.java
*\/

import com.esri.arcgis.geometry.CircularArc;
import com.esri.arcgis.geometry.ICircularArc;
import com.esri.arcgis.geometry.ICircularArcProxy;
import com.esri.arcgis.geometry.ICurve;
import com.esri.arcgis.geometry.ILine;
import com.esri.arcgis.geometry.IPoint;
import com.esri.arcgis.geometry.Line;
import com.esri.arcgis.geometry.Point;
import com.esri.arcgis.geometry.esriSegmentExtension;
import com.esri.arcgis.system.EngineInitializer;


public class CurveDemo {

private static boolean asRatio;
private static boolean[] right;
private static double[] distOnCurve;
private static double[] nearDist;

public static String outputPoint(IPoint pnt) throws Exception{
String output = "(" + pnt.getX() + ", " + pnt.getY() + ")";
return output;
}

public static String outputLine(ILine line) throws Exception{
IPoint fromPnt = new Point();
IPoint toPnt = new Point();
line.queryFromPoint(fromPnt);
line.queryToPoint(toPnt);

String output = "From " + outputPoint(fromPnt) + " to " + outputPoint(toPnt);
return output;
}

public static void main(String[] args) throws Exception{
EngineInitializer.initializeEngine();
System.out.println("CurveDemo");
IPoint origin = new Point();
CircularArc cArc = new CircularArc();
ICurve[] subArc = {new CircularArc()};

\/* define the center point of the circle *\/
origin.putCoords(0, 0);
cArc.putCoordsByAngle(origin, 0, 2 * Math.PI, 100); // 0 to 2PI = Full Circle
\/* subArc is set by GetSubcurve. Half-arc (Pi/2 to 3Pi/2) *\/
cArc.getSubcurve(0.25, 0.75, true, subArc);
ICircularArc subArc2 = new ICircularArcProxy(subArc[0]);
System.out.println(" Main Closed = " + cArc.IsClosed());
System.out.println(" Length: " + cArc.getLength());
System.out.println(" Sub Closed = " + subArc2.IsClosed());
System.out.println(" Length: " + subArc2.getLength());

\/*
* Subcurve From point (0.0) is the same as the main curve point at 0.25 (25%)
* Subcurve To point (1.0) is the same as the main curve point at 0.75 (75%)
*\/
System.out.println(" Subcurve from: " + outputPoint(subArc2.getFromPoint()));
System.out.println(" Subcurve to: " + outputPoint(subArc2.getToPoint()));

\/*
* Query the tangent (length 20) of the point 0.3 (30%) along the subcurve
* Query the normal (length 10) of the point 0.4 (40%) along the main curve
* Note: 0.3 (30%) along the subcurve is the same point as the point
* 0.4 (40%) along the main curve
*\/
ILine tangent = new Line();
ILine normal = new Line();
subArc2.queryTangent(esriSegmentExtension.esriExtendTangentAtFrom, 0.3, true, 20, tangent);
cArc.queryNormal(esriSegmentExtension.esriExtendTangentAtFrom, 2 * subArc2.getLength()/5, false, 10, normal);
System.out.println(" Tangent: " + outputLine(tangent));
System.out.println(" Normal: " + outputLine(normal));

\/*Finds the point along the To tangent extended 20% beyond the ToPoint*\/
IPoint tangentPnt = new Point();
cArc.queryPoint(esriSegmentExtension.esriExtendTangentAtTo, 1.2, true, tangentPnt);
System.out.println(" Point on Tangent: " + outputPoint(tangentPnt));

\/*
* Finds the point on the Circular Arc nearest to the point extended tangentially
* Returns the nearest point, the distance to the point, the distance along the curve,
* whether the point is on the right side of the curve, and AsRatio indicator
*\/
IPoint nearPnt = new Point();
cArc.queryPointAndDistance(esriSegmentExtension.esriNoExtension, tangentPnt, asRatio, nearPnt, distOnCurve, nearDist, right);
System.out.println(" Nearest Point: " + outputPoint(nearPnt));
System.out.println(" Distance: " + nearDist);

subArc2.reverseOrientation(); // subArc now is the arc from 3Pi/2 to Pi/2
}
}

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

See Also:
IPolycurve, ICircularArc, IPoint, IPolygon, IEllipticArc, IGeometry, IRing, IBezierCurve, IPolycurve2, ILine, IPolyline, ISegment, IPath

Method Summary
 IPoint getFromPoint()
          The 'from' point of the curve.
 double getLength()
          The length of the curve.
 void getSubcurve(double fromDistance, double toDistance, boolean asRatio, ICurve[] outSubcurve)
          Extracts a portion of this curve into a new curve.
 IPoint getToPoint()
          The 'to' point of the curve.
 boolean isClosed()
          Indicates if 'from' and 'to' points (of each part) are identical.
 void queryFromPoint(IPoint from)
          Copies this curve's 'from' point to the input point.
 void queryNormal(int extension, double distanceAlongCurve, boolean asRatio, double length, ILine normal)
          Constructs a line normal to a curve from a point at a specified distance along the curve.
 void queryPoint(int extension, double distanceAlongCurve, boolean asRatio, IPoint outPoint)
          Copies to outPoint the properties of a point on the curve at a specified distance from the beginning of the curve.
 void queryPointAndDistance(int extension, IPoint inPoint, boolean asRatio, IPoint outPoint, double[] distanceAlongCurve, double[] distanceFromCurve, boolean[] bRightSide)
          Finds the point on the curve closest to inPoint, then copies that point to outPoint; optionally calculates related items.
 void queryTangent(int extension, double distanceAlongCurve, boolean asRatio, double length, ILine tangent)
          Constructs a line tangent to a curve from a point at a specified distance along the curve.
 void queryToPoint(IPoint to)
          Copies the curve's 'to' point into the input point.
 void reverseOrientation()
          Reverses the parameterization of the curve ('from' point becomes 'to' point, first segment becomes last segment, etc).
 void setFromPoint(IPoint from)
          The 'from' point of the curve.
 void setToPoint(IPoint to)
          The 'to' point of the curve.
 
Methods inherited from interface com.esri.arcgis.geometry.IGeometry
geoNormalize, geoNormalizeFromLongitude, getDimension, getEnvelope, getGeometryType, getSpatialReference, isEmpty, project, queryEnvelope, setEmpty, setSpatialReferenceByRef, snapToSpatialReference
 

Method Detail

getLength

double getLength()
                 throws IOException,
                        AutomationException
The length of the curve.

Description

Returns the length of the entire curve. The length of the curve is the sum of the lengths along each parameterized Segment between vertices along the curve.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The length
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFromPoint

IPoint getFromPoint()
                    throws IOException,
                           AutomationException
The 'from' point of the curve.

Description

Returns or Sets the FromPoint of the first segment of the first part of the curve. While the curve may be composed of many parts and segments each with their own FromPoint, each curve only has a single From Point.

Remarks

FromPoint Example

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.geometry.IPoint
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IPoint, ICurve.queryFromPoint(com.esri.arcgis.geometry.IPoint), ICurve.getFromPoint(), ICurve.queryToPoint(com.esri.arcgis.geometry.IPoint), ICurve.getToPoint()

setFromPoint

void setFromPoint(IPoint from)
                  throws IOException,
                         AutomationException
The 'from' point of the curve.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
from - A reference to a com.esri.arcgis.geometry.IPoint (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryFromPoint

void queryFromPoint(IPoint from)
                    throws IOException,
                           AutomationException
Copies this curve's 'from' point to the input point.

Description

Used to query the FromPoint of the first Segment of the first part of the curve.

Remarks

Note: The output geometry must be co-created prior to the query. The output geometry is not co-created by the method; it is populated. This can be used in performance critical situations. For example, creating the geometry only once outside a loop and use the query method could improve performance.

QueryFromPoint Example

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
from - A reference to a com.esri.arcgis.geometry.IPoint (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IPoint, ICurve.queryFromPoint(com.esri.arcgis.geometry.IPoint), ICurve.getFromPoint(), ICurve.queryToPoint(com.esri.arcgis.geometry.IPoint), ICurve.getToPoint()

getToPoint

IPoint getToPoint()
                  throws IOException,
                         AutomationException
The 'to' point of the curve.

Description

Returns or Sets the ToPoint of the first Segment of the first part of the curve. While the curve may be composed of many parts and segments each with their own ToPoint, each curve only has a single To Point.

Remarks

ToPoint Example

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.geometry.IPoint
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IPoint, ICurve.queryFromPoint(com.esri.arcgis.geometry.IPoint), ICurve.getFromPoint(), ICurve.queryToPoint(com.esri.arcgis.geometry.IPoint), ICurve.getToPoint()

setToPoint

void setToPoint(IPoint to)
                throws IOException,
                       AutomationException
The 'to' point of the curve.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
to - A reference to a com.esri.arcgis.geometry.IPoint (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryToPoint

void queryToPoint(IPoint to)
                  throws IOException,
                         AutomationException
Copies the curve's 'to' point into the input point.

Description

Used to query the ToPoint of the first Segment of the first part of the curve.

Remarks

Note: The output geometry must be co-created prior to the query. The output geometry is not co-created by the method; it is populated. This can be used in performance critical situations. For example, creating the geometry only once outside a loop and use the query method could improve performance.

QueryToPoint Example

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
to - A reference to a com.esri.arcgis.geometry.IPoint (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IPoint, ICurve.queryFromPoint(com.esri.arcgis.geometry.IPoint), ICurve.getFromPoint(), ICurve.queryToPoint(com.esri.arcgis.geometry.IPoint), ICurve.getToPoint()

queryPoint

void queryPoint(int extension,
                double distanceAlongCurve,
                boolean asRatio,
                IPoint outPoint)
                throws IOException,
                       AutomationException
Copies to outPoint the properties of a point on the curve at a specified distance from the beginning of the curve.

Description

Returns the Point at a given distance along the curve or extended curve. If the distance is less than the length of the curve, then the returned point is the point at that distance along the curve. If the distance is less than zero, or greater than the length of the curve, then the returned point is on the curve specified by the extension method. The distance may be specified as a fixed unit of measure or a ratio of the length of the curve.

Remarks

Note: The output geometry must be co-created prior to the query. The output geometry is not co-created by the method; it is populated. This can be used in performance critical situations. For example, creating the geometry only once outside a loop and use the query method could improve performance.

ICurve QueryPoint Example

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
extension - A com.esri.arcgis.geometry.esriSegmentExtension constant (in)
distanceAlongCurve - The distanceAlongCurve (in)
asRatio - The asRatio (in)
outPoint - A reference to a com.esri.arcgis.geometry.IPoint (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IPoint, esriSegmentExtension

queryPointAndDistance

void queryPointAndDistance(int extension,
                           IPoint inPoint,
                           boolean asRatio,
                           IPoint outPoint,
                           double[] distanceAlongCurve,
                           double[] distanceFromCurve,
                           boolean[] bRightSide)
                           throws IOException,
                                  AutomationException
Finds the point on the curve closest to inPoint, then copies that point to outPoint; optionally calculates related items.

Description

Finds the Point on the specified extended curve nearest to the input point and the distance between those points. Also returns information about the side of the curve the input point is on as well as the distance along the curve that the nearest point occurs.

Remarks

AsRatio is an input parameter that only affects the DistanceAlongCurve

distanceFromCurve is an output parameter that represents the minimum distance between the curve and the input point.

DistanceAlongCurve is an output parameter that represents the distance between the Frompoint of the input curve and the returned point on the curve.

bRightSide is an output parameter that tells if the input point is on the right side of the curve. The direction of the curve determines the right and left sides.

Note: The output geometry must be co-created prior to the query. The output geometry is not co-created by the method; it is populated. This can be used in performance critical situations. For example, creating the geometry only once outside a loop and use the query method could improve performance.

QueryPointAndDistance Example

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
extension - A com.esri.arcgis.geometry.esriSegmentExtension constant (in)
inPoint - A reference to a com.esri.arcgis.geometry.IPoint (in)
asRatio - The asRatio (in)
outPoint - A reference to a com.esri.arcgis.geometry.IPoint (in)
distanceAlongCurve - The distanceAlongCurve (in/out: use single element array)
distanceFromCurve - The distanceFromCurve (in/out: use single element array)
bRightSide - The bRightSide (in/out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IPoint

queryTangent

void queryTangent(int extension,
                  double distanceAlongCurve,
                  boolean asRatio,
                  double length,
                  ILine tangent)
                  throws IOException,
                         AutomationException
Constructs a line tangent to a curve from a point at a specified distance along the curve.

Description

Given a distance along the curve specified either as a ratio of the length or as a specific fixed distance, QueryTangent returns the Line tangent to the Point. The length and method of tangential extension of the tangent line are given by the user. The method of tangential extension determines the direction of the tangent line as though it were being extended at a From point or a To point.

Remarks

QueryTangent Example

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
extension - A com.esri.arcgis.geometry.esriSegmentExtension constant (in)
distanceAlongCurve - The distanceAlongCurve (in)
asRatio - The asRatio (in)
length - The length (in)
tangent - A reference to a com.esri.arcgis.geometry.ILine (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ILine

queryNormal

void queryNormal(int extension,
                 double distanceAlongCurve,
                 boolean asRatio,
                 double length,
                 ILine normal)
                 throws IOException,
                        AutomationException
Constructs a line normal to a curve from a point at a specified distance along the curve.

Description

Given a distance along the curve specified either as a ratio of the Length or as a specific fixed distance, QueryNormal returns the Line normal to the Point. The length and method of tangential extension of the normal line are given by the user. The method of tangential extension determines the direction of the normal line as though it were being extended at a From point or a To point.

Remarks

QueryNormal Example

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
extension - A com.esri.arcgis.geometry.esriSegmentExtension constant (in)
distanceAlongCurve - The distanceAlongCurve (in)
asRatio - The asRatio (in)
length - The length (in)
normal - A reference to a com.esri.arcgis.geometry.ILine (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ILine

getSubcurve

void getSubcurve(double fromDistance,
                 double toDistance,
                 boolean asRatio,
                 ICurve[] outSubcurve)
                 throws IOException,
                        AutomationException
Extracts a portion of this curve into a new curve.

Description

Gets the subcurve between the specified points along the original curve and creates a new curve. The elements in the new subcurve are the same type and have the same properties as the elements of the original curve. Which means if:

Input Geometry Output Geometry
Polygon Polyline
Polyline Polyline
Ring Path
Path Path
Segment Segment

If the input geometry is a polygon, you may want to use IRing::GetSubCurveEx which has more capabilities.

Remarks

Subcurve Example

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
fromDistance - The fromDistance (in)
toDistance - The toDistance (in)
asRatio - The asRatio (in)
outSubcurve - A reference to a com.esri.arcgis.geometry.ICurve (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IRing.getSubcurveEx(double, double, boolean, boolean, boolean), ICurve.getSubcurve(double, double, boolean, com.esri.arcgis.geometry.ICurve[])

reverseOrientation

void reverseOrientation()
                        throws IOException,
                               AutomationException
Reverses the parameterization of the curve ('from' point becomes 'to' point, first segment becomes last segment, etc).

Description

ReverseOrientation changes the direction of the curve without changing the spatial position of the curve. The From Point and To Point of each Segment in each part of the curve are interchanged.

Remarks

The ReverseOrientation method works the same way as the Arcedit FLIP command. It reverses the order of the vertices in the Curve.

Caution should be taken in using ReverseOrientation on Polygons. Since ReverseOrientation changes the direction of each Ring within the Polygon, all Exterior Rings become Interior Rings and vice versa.

Reverse Orientation Example

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isClosed

boolean isClosed()
                 throws IOException,
                        AutomationException
Indicates if 'from' and 'to' points (of each part) are identical.

Description

A curve is closed if the From and To points of each part of the curve are equal.

Remarks

IsClosed may still return TRUE if the curve consists of improperly constructed geometries (ex. non-continuous paths). IsClosed only checks the location of the From and To points of each part, it does not check the internal parts for topological consistency.

ICurve IsClosed Example

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The isClosed
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.