ISegmentCollection Interface

Provides access to members that manipulate the segments of a path, ring, polyline, or polygon.

Description

A Segment Collection is a collection of Segments that compose a segment-based geometry. A Segment Collection can be used to access any segment within a segment-based geometry without regard to the overall geometry that the Segment Collection represents. As a geometry, the Segment Collection is assumed to be a valid Path. Although it is possible to access the Segment Collection of an entire Polyline or Polygon, manipulation of Polyline and Polygons is best done with a Geometry Collection.

When To Use

If you are using a development language that does not support C style arrays, use IGeometryBridge instead. The IGeometryBridge interface solves that problem allowing you to pass safe arrays instead.

Members

Name Description
Method AddSegment Adds a reference to the input segment at the end, or before or after a specified index.
Method AddSegmentCollection Adds references to the segments from the specified segment collection.
Method AddSegments Adds references to segments. This method is intended for internal use only.
Read-only property EnumCurve A new curve enumerator for this segment collection.
Read-only property EnumSegments A new enumerator for this segment collection.
Method HasNonLinearSegments Indicates if this segment collection contains segments other than lines.
Read-only property IndexedEnumSegments A new indexed segment enumerator for this segment collection.
Method InsertSegmentCollection Inserts references to the segments in the input collectoin.
Method InsertSegmentCollectionEx Inserts references to some of the segments from the input collection.
Method InsertSegments Inserts references to the input segments. This method is intended for internal use only.
Method QuerySegments Returns references to some of the input segments. This method is intended for internal use only.
Method RemoveSegments 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.
Method ReplaceSegmentCollection Remove and inserts some segments.
Method ReplaceSegments Removes and inserts from segments. This method is intended for internal use only.
Read-only property Segment A reference to the ith segment.
Read-only property SegmentCount The number of segments.
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.
Method SetCircle Defines this path, ring, polyline or polygon to contain a single circular arc segment that is closed.
Method SetRectangle Defines this path, ring, polyline or polygon to have four line segments in the same positions as the sides of the input envelope.
Method SetSegmentCollection Replaces all segments with references to segments from the input collection.
Method SetSegments Replaces all segments with references to the input segments. This method is intended for internal use only.
Method 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.

ISegmentCollection.AddSegment Method

Adds a reference to the input segment at the end, or before or after a specified index.

Public Sub AddSegment ( _
    ByVal inSegment As ISegment, _
    [ByRef before As Object], _
    [ByRef after As Object] _
)
public void AddSegment (
    ISegment inSegment,
    ref object before,
    ref object after
);

Description

Adds a Segment to a Segment Collection. If before and after are omitted, the Segment is added to the end of the Segment Collection. Additionally, by specifying either the before or after index, the Segment can be added at a specific location in the Segment Collection.

ISegmentCollection.AddSegmentCollection Method

Adds references to the segments from the specified segment collection.

Public Sub AddSegmentCollection ( _
    ByVal segments As ISegmentCollection _
)
public void AddSegmentCollection (
    ISegmentCollection segments
);

Description

Adds a Segment Collection of Segments to the end of the existing Segment Collection. It is assumed that the From Point of the new Segment Collection is the same as the To Point of the existing Segment Collection.

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 polylineeven if the polylines are disjoint.

ISegmentCollection.AddSegments Method

Adds references to segments. This method is intended for internal use only.

Public Sub AddSegments ( _
    ByVal Count As Integer, _
    ByRef newSegments As ISegment _
)
public void AddSegments (
    int Count,
    ref ISegment newSegments
);

Description

Adds the first specified number (Count) of Segments to the Segment Collection from an array of Segments (with at least Count segments). The Segments are all added to the end of the Segment Collection in the same sequence as they are ordered in the array.

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.

ISegmentCollection.EnumCurve Property

A new curve enumerator for this segment collection.

Public ReadOnly Property EnumCurve As IEnumCurve
public IEnumCurve EnumCurve {get;}

Description

Returns an IEnumCurve enumerator for the current SegmentCollection.

ISegmentCollection.EnumSegments Property

A new enumerator for this segment collection.

Public ReadOnly Property EnumSegments As IEnumSegment
public IEnumSegment EnumSegments {get;}

Description

Returns an IEnumSegment enumerator for the current SegmentCollection.

ISegmentCollection.HasNonLinearSegments Method

Indicates if this segment collection contains segments other than lines.

Public Sub HasNonLinearSegments ( _
    ByRef nonLinearSegments As Boolean _
)
public void HasNonLinearSegments (
    ref bool nonLinearSegments
);

Description

Returns TRUE if the Segment Collection contains CircularArcs, BezierCurves, or EllipticArcs. Returns FALSE if all segments are Lines.

ISegmentCollection.IndexedEnumSegments Property

A new indexed segment enumerator for this segment collection.

Public Function get_IndexedEnumSegments ( _
    ByVal queryGeometry As IGeometry _
) As IEnumSegment
public IEnumSegment get_IndexedEnumSegments (
    IGeometry queryGeometry
);

Description

The IndexedEnumSegments method returns a spatially indexed enumerator of segments. For example this enumerator can be used to quickly retrieve a small set of segments near a point or an envelope and then perform operations on those segments. Any 2D geometry type can be passed to the IndexedEnumSegments method. Depending on the input geometry the type of spatial index varies.

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.

ISegmentCollection.InsertSegmentCollection Method

Inserts references to the segments in the input collectoin.

Public Sub InsertSegmentCollection ( _
    ByVal Index As Integer, _
    ByVal newSegments As ISegmentCollection _
)
public void InsertSegmentCollection (
    int Index,
    ISegmentCollection newSegments
);

Description

Inserts a Segment Collection of segments into the Segment Collection at the specified index. The resulting Segment Collection does not retain information about the distinction between the old and new Segment Collections.

ISegmentCollection.InsertSegmentCollectionEx Method

Inserts references to some of the segments from the input collection.

Public Sub InsertSegmentCollectionEx ( _
    ByVal Index As Integer, _
    ByVal start As Integer, _
    ByVal Count As Integer, _
    ByVal newSegments As ISegmentCollection _
)
public void InsertSegmentCollectionEx (
    int Index,
    int start,
    int Count,
    ISegmentCollection newSegments
);

ISegmentCollection.InsertSegments Method

Inserts references to the input segments. This method is intended for internal use only.

Public Sub InsertSegments ( _
    ByVal Index As Integer, _
    ByVal Count As Integer, _
    ByRef newSegments As ISegment _
)
public void InsertSegments (
    int Index,
    int Count,
    ref ISegment newSegments
);

Description

Inserts a specified number (Count) of Segments into the Segment Collection at the given index from an array of Segments. The first Count segments from the array are inserted.

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.

ISegmentCollection.QuerySegments Method

Returns references to some of the input segments. This method is intended for internal use only.

Public Sub QuerySegments ( _
    ByVal Index As Integer, _
    ByVal Count As Integer, _
    ByRef segments As ISegment _
)
public void QuerySegments (
    int Index,
    int Count,
    ref ISegment segments
);

Description

Queries a specified number (Count) of Segments starting at the given index into an array of Segments.

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.

ISegmentCollection.RemoveSegments Method

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.

Public Sub RemoveSegments ( _
    ByVal Index As Integer, _
    ByVal Count As Integer, _
    ByVal closeGap As Boolean _
)
public void RemoveSegments (
    int Index,
    int Count,
    bool closeGap
);

Description

Removes a specified number (Count) of Segments from a Segment Collection starting at a given index.If the removal created a disjoint Path and if closeGap is TRUE, then the remaining segments willbe connected at the midpoint of the gap by modifying the segments adjacent to the gap.This will create aconnected Path.

ISegmentCollection.ReplaceSegmentCollection Method

Remove and inserts some segments.

Public Sub ReplaceSegmentCollection ( _
    ByVal Index As Integer, _
    ByVal goingAway As Integer, _
    ByVal newSegments As ISegmentCollection _
)
public void ReplaceSegmentCollection (
    int Index,
    int goingAway,
    ISegmentCollection newSegments
);

Description

Replaces a specified number (goingAway) of Segments in the Segment Collection begining at a given index with a Segment Collection of Segments (inserted at the given index).

ISegmentCollection.ReplaceSegments Method

Removes and inserts from segments. This method is intended for internal use only.

Public Sub ReplaceSegments ( _
    ByVal Index As Integer, _
    ByVal comingIn As Integer, _
    ByVal goingAway As Integer, _
    ByRef newSegments As ISegment _
)
public void ReplaceSegments (
    int Index,
    int comingIn,
    int goingAway,
    ref ISegment newSegments
);

Description

Removes a specified number (goingAway) of Segments from a Segment Collection starting at a given index and replaces them (starting at the same index) with a specified number (comingIn) of Segments from an array of Segments.

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.

ISegmentCollection.Segment Property

A reference to the ith segment.

Public Function get_Segment ( _
    ByVal i As Integer _
) As ISegment
public ISegment get_Segment (
    int i
);

Description

Returns the ith Segment from the Segment Collection. The first Segment has index 0 and the last Segment has index equal to SegmentCount - 1. The last Segment can also be referenced using index -1.

ISegmentCollection.SegmentCount Property

The number of segments.

Public ReadOnly Property SegmentCount As Integer
public int SegmentCount {get;}

Description

Returns the number of Segments in the Segment Collection. The last Segment in the Segment Collection has an index equal to SegmentCount - 1.

ISegmentCollection.SegmentsChanged Method

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.

Public Sub SegmentsChanged ( _
)
public void SegmentsChanged (
);

Description

SegmentsChanged forces the SegmentCollection to recalculate any values that it has cached. SegmentsChanged should be used whenever the Segments in the SegmentCollection are modified without using the SegmentCollection methods. As long as the SegmentCollection is only modified using SegmentCollection methods, the cached values are current and consistent.

ISegmentCollection.SetCircle Method

Defines this path, ring, polyline or polygon to contain a single circular arc segment that is closed.

Public Sub SetCircle ( _
    ByVal cp As IPoint, _
    ByVal circleRadius As Double _
)
public void SetCircle (
    IPoint cp,
    double circleRadius
);

Description

Sets a SegmentCollection equal to a single segment CircularArc. The CircularArc is a complete circle centered at the input point with a given input Radius. After SetCircle is called, the SegmentCollection contains only the CiruclarArc (regardless of what it may have contained previously). The To and From Points at located at the top (Pi/2 Radians) of the circle.

ISegmentCollection.SetRectangle Method

Defines this path, ring, polyline or polygon to have four line segments in the same positions as the sides of the input envelope.

Public Sub SetRectangle ( _
    ByVal inEnvelope As IEnvelope _
)
public void SetRectangle (
    IEnvelope inEnvelope
);

Description

Sets the contents of the SegmentCollection equal to four Line segments that form the sides of the input Envelope. The Segments begin with the LowerLeft point and proceed clockwise (the first side is the left side). After SetRectangle is called, the SegmentCollection contains only the 4 Line segments (regardless of what it may have contained previously). The spatial reference of the envelope is transferred to the SegmentCollection.

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.

ISegmentCollection.SetSegmentCollection Method

Replaces all segments with references to segments from the input collection.

Public Sub SetSegmentCollection ( _
    ByVal newSegments As ISegmentCollection _
)
public void SetSegmentCollection (
    ISegmentCollection newSegments
);

Description

Sets the contents of the Segment Collection equal to the contents of the input Segment Collection. After SetSegmentCollection is called, the Segment Collection contains only the segments from the input Segment Collection (regardless of what it may have contained previously).

ISegmentCollection.SetSegments Method

Replaces all segments with references to the input segments. This method is intended for internal use only.

Public Sub SetSegments ( _
    ByVal Count As Integer, _
    ByRef newSegments As ISegment _
)
public void SetSegments (
    int Count,
    ref ISegment newSegments
);

Description

Sets the contents of the Segment Collection equal to the first Count segments from the input array of Segments. After SetSegments is called, the Segment Collection contains only count segments from the input Segment array (regardless of what it may have contained previously).

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.

ISegmentCollection.SynchronizeEmptyAttributes Method

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.

Public Sub SynchronizeEmptyAttributes ( _
)
public void SynchronizeEmptyAttributes (
);

Classes that implement ISegmentCollection

Classes Description
Path A sequence of connected segments.
Polygon A collection of rings ordered by their containment relationship; optionally has measure, height and ID attributes.
Polyline An ordered collection of paths; optionally has measure, height and ID attributes.
Ring An area bounded by one, closed sequence of connected segments; optionally has measure, height and ID attributes at each vertex.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.