Interface ISegmentCollection
Provides access to members that manipulate the segments of a path, ring, polyline, or polygon.
[Guid("B3FE6B20-4FC2-11D1-834E-0000F8775BE9")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ISegmentCollection
Properties
EnumCurve
A new curve enumerator for this segment collection.
IEnumCurve EnumCurve { get; }
Property Value
EnumSegments
A new enumerator for this segment collection.
IEnumSegment EnumSegments { get; }
Property Value
IndexedEnumSegments[IGeometry]
A new indexed segment enumerator for this segment collection.
IEnumSegment IndexedEnumSegments[IGeometry queryGeometry] { get; }
Parameters
queryGeometryIGeometry
Property Value
Remarks
Note: In order to have this method returning an indexed segment enumerator the ISpatialIndex::AllowIndexing property must be set to 'true' on the geometry.
Segment[int]
A reference to the ith segment.
ISegment Segment[int i] { get; }
Parameters
iint
Property Value
SegmentCount
The number of segments.
int SegmentCount { get; }
Property Value
Methods
AddSegment(ISegment, ref object, ref object)
Adds a reference to the input segment at the end, or before or after a specified index.
void AddSegment(ISegment inSegment, ref object before, ref object after)
Parameters
AddSegmentCollection(ISegmentCollection)
Adds references to the segments from the specified segment collection.
void AddSegmentCollection(ISegmentCollection segments)
Parameters
segmentsISegmentCollection
Remarks
AddSegmentCollection add the other geometry to the last part of the current geometry.
For example, adding a polyline (with one part) to another polyline (with one part)
is adding the second polyline segments into the first part of the other polyline
even if the polylines are disjoint.
AddSegments(int, ref ISegment)
Adds references to segments. This method is intended for internal use only.
void AddSegments(int Count, ref ISegment newSegments)
Parameters
Remarks
Note: the array must contains only ISegment pointers, otherwise it night crash the application.
When using C# you must use the IGeometryBridge interface to call this method.
When using VBNET you must use the IGeometryBridge interface to call this method.
HasNonLinearSegments(ref bool)
Indicates if this segment collection contains segments other than lines.
void HasNonLinearSegments(ref bool nonLinearSegments)
Parameters
nonLinearSegmentsbool
InsertSegmentCollection(int, ISegmentCollection)
Inserts references to the segments in the input collectoin.
void InsertSegmentCollection(int Index, ISegmentCollection newSegments)
Parameters
IndexintnewSegmentsISegmentCollection
InsertSegmentCollectionEx(int, int, int, ISegmentCollection)
Inserts references to some of the segments from the input collection.
void InsertSegmentCollectionEx(int Index, int start, int Count, ISegmentCollection newSegments)
Parameters
IndexintstartintCountintnewSegmentsISegmentCollection
InsertSegments(int, int, ref ISegment)
Inserts references to the input segments. This method is intended for internal use only.
void InsertSegments(int Index, int Count, ref ISegment newSegments)
Parameters
QuerySegments(int, int, out ISegment)
Returns references to some of the input segments. This method is intended for internal use only.
void QuerySegments(int Index, int Count, out ISegment segments)
Parameters
RemoveSegments(int, int, bool)
Removes references to some segments. If closeGap is TRUE, then any remaining internal gap in the path, ring, polyline or polygon is connected with a single line segment.
void RemoveSegments(int Index, int Count, bool closeGap)
Parameters
ReplaceSegmentCollection(int, int, ISegmentCollection)
Remove and inserts some segments.
void ReplaceSegmentCollection(int Index, int goingAway, ISegmentCollection newSegments)
Parameters
IndexintgoingAwayintnewSegmentsISegmentCollection
ReplaceSegments(int, int, int, ref ISegment)
Removes and inserts from segments. This method is intended for internal use only.
void ReplaceSegments(int Index, int comingIn, int goingAway, ref ISegment newSegments)
Parameters
Remarks
ReplaceSegments will return an error ("The index is either too large or too small") if the inputs are inconsistent. For example, specifying index = 4 on a polyline with only 2 segments.
On multipart geometry, segments cannot be replaced on more than one part at the time. For example, an error (("The index is either too large or too small") is returned on a polyline with two parts containing three segments each when specifying index= 2, incoming= 2, removal= 2. The error is returned because the first part doesn't contain enough segments to remove two segments starting at index = 2. This behavior is enforced for performance reasons. Please see the example.
When using C# you must use the IGeometryBridge interface to call this method.
When using VBNET you must use the IGeometryBridge interface to call this method.
SegmentsChanged()
Informs the segment collection that any cached values that it may be maintaining (envelope, length, etc.) are invalid. Use this method after editing segments directly.
void SegmentsChanged()
SetCircle(IPoint, double)
Defines this path, ring, polyline or polygon to contain a single circular arc segment that is closed.
void SetCircle(IPoint cp, double circleRadius)
Parameters
SetRectangle(IEnvelope)
Defines this path, ring, polyline or polygon to have four line segments in the same positions as the sides of the input envelope.
void SetRectangle(IEnvelope inEnvelope)
Parameters
inEnvelopeIEnvelope
Remarks
The method uses the spatial reference of the input envelope to determine whether or not the output geometry is simple.
If the input envelope does not have a spatial reference, the output geometry will be assumed non-simple geometry.
If the input envelope has a spatial reference, and its width and height are greater than 3*tolerance, then the output geometry is a simple geometry. Otherwise, the output is non-simple.
SetSegmentCollection(ISegmentCollection)
Replaces all segments with references to segments from the input collection.
void SetSegmentCollection(ISegmentCollection newSegments)
Parameters
newSegmentsISegmentCollection
SetSegments(int, ref ISegment)
Replaces all segments with references to the input segments. This method is intended for internal use only.
void SetSegments(int Count, ref ISegment newSegments)
Parameters
SynchronizeEmptyAttributes()
If, at end point shared by two segments, one segment has an empty value for an attribute and the other has a non-empty value, use the non-empty value for both.
void SynchronizeEmptyAttributes()