Provides access to members that identify a ring and define its behavior.
Description
A Ring is a type of surface patch that defines a two dimensional area and can be used to construct a MultiPatch, defined by a collection of points forming a closed Path, such that the From and To points have the same coordinates. The front side is established by orienting its vertices clockwise.
Members
Name | Description | |
---|---|---|
Close | Makes sure that this ring is closed by adding a line segment between the ring's 'to' and 'from' points if necessary. | |
Dimension | The topological dimension of this geometry. | |
Envelope | Creates a copy of this geometry's envelope and returns it. | |
FromPoint | The 'from' point of the curve. | |
Generalize | Generalizes this path using the Douglas-Peucker algorithm. | |
GeometryType | The type of this geometry. | |
GeoNormalize | Shifts longitudes, if need be, into a continuous range of 360 degrees. | |
GeoNormalizeFromLongitude | Normalizes longitudes into a continuous range containing the longitude. This method is obsolete. | |
GetSubcurve | Extracts a portion of this curve into a new curve. | |
GetSubcurveEx | 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. | |
IsClosed | Indicates if 'from' and 'to' points (of each part) are identical. | |
IsEmpty | Indicates whether this geometry contains any points. | |
IsExterior | Indicates if this ring can function as the exterior ring in a polygon (ring orientation is clockwise, area > 0). | |
Length | The length of the curve. | |
Project | Projects this geometry into a new spatial reference. | |
QueryChordLengthTangents | Returns tangent vectors (relative to corresponding endpoint) at both sides of a Bezier end point; and whether they have been set by user or by smoothing process. | |
QueryEnvelope | Copies this geometry's envelope properties into the specified envelope. | |
QueryFromPoint | Copies this curve's 'from' point to the input point. | |
QueryNormal | Constructs a line normal to a curve from a point at a specified distance along the curve. | |
QueryPoint | Copies to outPoint the properties of a point on the curve at a specified distance from the beginning of the curve. | |
QueryPointAndDistance | Finds the point on the curve closest to inPoint, then copies that point to outPoint; optionally calculates related items. | |
QueryTangent | Constructs a line tangent to a curve from a point at a specified distance along the curve. | |
QueryToPoint | Copies the curve's 'to' point into the input point. | |
Reshape | Modifies this ring by replacing some of its segments with some segments from reshapeSource. | |
ReverseOrientation | Reverses the parameterization of the curve ('from' point becomes 'to' point, first segment becomes last segment, etc). | |
SetChordLengthTangents | Sets tangent vectors (relative to corresponding endpoint) at both sides of a Bezier end point; if either is Nothing, they will be set by smoothing process. | |
SetEmpty | Removes all points from this geometry. | |
Smooth | Converts this path into a smooth approximation of itself that contains only Bezier curve segments. | |
SmoothLocal | Replaces up to four segments (two on each of the specified vertex index) with bezier curves. | |
SnapToSpatialReference | Moves points of this geometry so that they can be represented in the precision of the geometry's associated spatial reference system. | |
SpatialReference | The spatial reference associated with this geometry. | |
ToPoint | The 'to' point of the curve. |
IRing.Close Method
Makes sure that this ring is closed by adding a line segment between the ring's 'to' and 'from' points if necessary.
Public Sub Close ( _
)
public void Close (
);
Description
Checks whether or not the From and To Points of the Path occur at the same Point. If the From and To Point have the same X and Y coordinates, the Ring is considered closed, and no action is taken. However, if the From and To Points are not at the same X and Y coordinates, a Line segment is added at the end of the Ring between the To Point and the From Point. This Line segment completes the Ring making it closed.
Remarks
This method should generally not be called in a 3D context, due to the fact that Close() only compares X and Y and not Z vertex values. Instead, the first point in the point collection should be manually re-added as the last point in the point collection to close the geometry.
IRing.GetSubcurveEx Method
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.
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
public ICurve GetSubcurveEx (
double fromDistance,
double toDistance,
bool asRatio,
bool isCCW,
bool useRingOrientation
);
Description
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.
Remarks
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.IsExterior Property
Indicates if this ring can function as the exterior ring in a polygon (ring orientation is clockwise, area > 0).
Public ReadOnly Property IsExterior As Boolean
public bool IsExterior {get;}
Description
IsExterior returns TRUE if the ring is oriented in a Clockwise direction. Exterior rings are always oriented clockwise, and interior rings are always oriented counterclockwise.
Remarks
IRing.Reshape Method
Modifies this ring by replacing some of its segments with some segments from reshapeSource.
Public Function Reshape ( _
ByVal reshapeSource As IPath _
) As Boolean
public bool Reshape (
IPath reshapeSource
);
Description
Reshape replaces the Segments in the Ring between consecutive Intersections with the input Path segments that connect those intersections. Reshape returns a boolean indicating whether or not a modification to the Ring occurred.
Remarks
To Reshape a Polygon, the Polygon must be Reshaped one Ring at a time.
Inherited Interfaces
Interfaces | Description |
---|---|
IPath | Provides access to members that identify a path and define its behavior. |
ICurve | Provides access to properties and methods of all 1 dimensional curves (polylines, segments, boundaries of polygons, etc.). |
IGeometry | Provides access to members that describe properties and behavior of all geometric objects. |
Classes that implement IRing
Classes | Description |
---|---|
Ring | An area bounded by one, closed sequence of connected segments; optionally has measure, height and ID attributes at each vertex. |