![]() |
This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IR > IRing Interface > IRing.GetSubcurveEx Method (ArcObjects .NET 10.4 SDK) |
Extracts a portion of this curve into a new curve. The interior of the new curve may contain the from/to point of the ring when useRingOrientation is true.
[Visual Basic .NET] Public Function GetSubcurveEx ( _ ByVal fromDistance As Double, _ ByVal toDistance As Double, _ ByVal asRatio As Boolean, _ ByVal isCCW As Boolean, _ ByVal useRingOrientation As Boolean _ ) As ICurve
[C#] public ICurve GetSubcurveEx ( double fromDistance, double toDistance, bool asRatio, bool isCCW, bool useRingOrientation );
[C++]
HRESULT GetSubcurveEx(
double fromDistance,
double toDistance,
VARIANT_BOOL asRatio,
VARIANT_BOOL isCCW,
VARIANT_BOOL useRingOrientation,
ICurve** outSubcurve
);
[C++]
Parameters fromDistance fromDistance is a parameter of type double toDistance toDistance is a parameter of type double asRatio asRatio is a parameter of type VARIANT_BOOL isCCW isCCW is a parameter of type VARIANT_BOOL useRingOrientation useRingOrientation is a parameter of type VARIANT_BOOL outSubcurve [out, retval]
outSubcurve is a parameter of type ICurve
The GetSubCurveEx method creates a subcurve of a ring. The subcurve may include the ring origin. The result is always a path object which may be closed.
Parameters description:
fromDistance: (Input) A double that represents the distance along the curve which will define one of the subcurve's endpoints. The value can be positive or negative.
toDistance: (Input) A double that represents the distance along the curve which will define the other endpoint of the subcurve. The value can be positive or negative.
If the fromDistance and toDistance values are equal, the output is a closed path with fromPoint and toPoint of the path at the specified distance. The orientation may be reversed, depending upon the other parameter settings.
asRatio: (Input) A boolean value that determines whether or not the input distances are interpreted as a ratio of the total length. If 'True', a fromDistance of 0 is at the beginning of the curve and a toDistance of 1 represents the end of the curve.
isCCW: (Input) A boolean expression that decides which of the two possible paths fromfromDistance to toDistance is chosen for output: counter-clockwise or not. This does not decide the orientation of the output path.
useRingOrientation: (Input) A boolean that determines whether the output path should follow the ring orientation or not. If bUseRingOrientation is true, the output subcurve must have the same orientation as the ring, even if it means that the subcurve starts at toDistance and ends at fromDistance. If bUseRingOrientation is false, the output subcurve always starts at fromDistance and ends at toDistance; it may have the opposite orientation as the original ring.
private void PrintSubcurveProperties(IRing ring, bool asRatio, bool isCCW, bool useRingOrientation)
{
String report="asRatio=" + asRatio + ", isCCW=" + isCCW + ", useRingOrientation= " + useRingOrientation + "\n";
double totalDistance=ring.Length;
for (int distance=0; distance < totalDistance; distance=(int)(distance + (totalDistance / 10)))
{
double fromDistance=distance / totalDistance;
double toDistance=(distance + (totalDistance / 10)) / totalDistance;
ICurve outCurve=ring.GetSubcurveEx(fromDistance, toDistance, asRatio, isCCW, useRingOrientation);
report=report + "From distance : " + fromDistance + "\n";
report=report + "To distance : " + toDistance + "\n";
report=report + "From X, Y : " + outCurve.FromPoint.X + " , " + outCurve.FromPoint.Y + "\n";
report=report + "To X, Y : " + outCurve.ToPoint.X + " , " + outCurve.ToPoint.Y + "\n";
report=report + "Curve Length : " + outCurve.Length + "\n\n";
}
System.Windows.Forms.MessageBox.Show(report);
}
IRing Interface | IRing.GetSubcurveEx Method | ICurve.GetSubcurve Method