|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISegmentCollection
Provides access to members that manipulate the segments of a path, ring, polyline, or polygon.
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.
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.
ICircularArc
,
IPointCollection
,
IEllipticArc
,
IBezierCurve
,
ISegmentCollection
,
ILine
,
ISegment
,
IGeometryCollection
Method Summary | |
---|---|
void |
addSegment(ISegment inSegment,
Object before,
Object after)
Adds a reference to the input segment at the end, or before or after a specified index. |
void |
addSegmentCollection(ISegmentCollection segments)
Adds references to the segments from the specified segment collection. |
void |
addSegments(int count,
ISegment newSegments)
Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by GeometryEnvironment.addSegments(com.esri.arcgis.geometry.ISegmentCollection, com.esri.arcgis.geometry.ISegment[]) . |
IEnumCurve |
getEnumCurve()
A new curve enumerator for this segment collection. |
IEnumSegment |
getEnumSegments()
A new enumerator for this segment collection. |
IEnumSegment |
getIndexedEnumSegments(IGeometry queryGeometry)
A new indexed segment enumerator for this segment collection. |
ISegment |
getSegment(int i)
A reference to the ith segment. |
int |
getSegmentCount()
The number of segments. |
void |
hasNonLinearSegments(boolean[] nonLinearSegments)
Indicates if this segment collection contains segments other than lines. |
void |
insertSegmentCollection(int index,
ISegmentCollection newSegments)
Inserts references to the segments in the input collectoin. |
void |
insertSegmentCollectionEx(int index,
int start,
int count,
ISegmentCollection newSegments)
Inserts references to some of the segments from the input collection. |
void |
insertSegments(int index,
int count,
ISegment newSegments)
Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by GeometryEnvironment.insertSegments(com.esri.arcgis.geometry.ISegmentCollection, int, com.esri.arcgis.geometry.ISegment[]) . |
void |
querySegments(int index,
int count,
ISegment[] segments)
Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by GeometryEnvironment.querySegments(com.esri.arcgis.geometry.ISegmentCollection, int, com.esri.arcgis.geometry.ISegment[][]) . |
void |
removeSegments(int index,
int count,
boolean closeGap)
Removes references to some segments. |
void |
replaceSegmentCollection(int index,
int goingAway,
ISegmentCollection newSegments)
Remove and inserts some segments. |
void |
replaceSegments(int index,
int comingIn,
int goingAway,
ISegment newSegments)
Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by GeometryEnvironment.replaceSegments(com.esri.arcgis.geometry.ISegmentCollection, int, int, com.esri.arcgis.geometry.ISegment[]) . |
void |
segmentsChanged()
Informs the segment collection that any cached values that it may be maintaining (envelope, length, etc.) are invalid. |
void |
setCircle(IPoint cp,
double circleRadius)
Defines this path, ring, polyline or polygon to contain a single circular arc segment that is closed. |
void |
setRectangle(IEnvelope inEnvelope)
Defines this path, ring, polyline or polygon to have four line segments in the same positions as the sides of the input envelope. |
void |
setSegmentCollection(ISegmentCollection newSegments)
Replaces all segments with references to segments from the input collection. |
void |
setSegments(int count,
ISegment newSegments)
Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by GeometryEnvironment.setSegments(com.esri.arcgis.geometry.ISegmentCollection, com.esri.arcgis.geometry.ISegment[]) . |
Method Detail |
---|
int getSegmentCount() throws IOException, AutomationException
Returns the number of Segments in the Segment Collection. The last Segment in the Segment Collection has an index equal to SegmentCount - 1.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ISegment getSegment(int i) throws IOException, AutomationException
i
- The i (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void addSegment(ISegment inSegment, Object before, Object after) throws IOException, AutomationException
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.
inSegment
- A reference to a com.esri.arcgis.geometry.ISegment (in)before
- A Variant (in, optional, pass null if not required)after
- A Variant (in, optional, pass null if not required)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void querySegments(int index, int count, ISegment[] segments) throws IOException, AutomationException
GeometryEnvironment.querySegments(com.esri.arcgis.geometry.ISegmentCollection, int, com.esri.arcgis.geometry.ISegment[][])
.
Queries a specified number (Count) of Segments starting at the given index into an array of Segments.
index
- The index (in)count
- The count (in)segments
- A reference to a com.esri.arcgis.geometry.ISegment (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void addSegments(int count, ISegment newSegments) throws IOException, AutomationException
GeometryEnvironment.addSegments(com.esri.arcgis.geometry.ISegmentCollection, com.esri.arcgis.geometry.ISegment[])
.
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.
Note: the array must contains only ISegment pointers, otherwise it night crash the application.
count
- The count (in)newSegments
- A reference to a com.esri.arcgis.geometry.ISegment (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void addSegmentCollection(ISegmentCollection segments) throws IOException, AutomationException
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.
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.
segments
- A reference to a com.esri.arcgis.geometry.ISegmentCollection (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void insertSegments(int index, int count, ISegment newSegments) throws IOException, AutomationException
GeometryEnvironment.insertSegments(com.esri.arcgis.geometry.ISegmentCollection, int, com.esri.arcgis.geometry.ISegment[])
.
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.
index
- The index (in)count
- The count (in)newSegments
- A reference to a com.esri.arcgis.geometry.ISegment (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void insertSegmentCollection(int index, ISegmentCollection newSegments) throws IOException, AutomationException
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.
index
- The index (in)newSegments
- A reference to a com.esri.arcgis.geometry.ISegmentCollection (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void insertSegmentCollectionEx(int index, int start, int count, ISegmentCollection newSegments) throws IOException, AutomationException
index
- The index (in)start
- The start (in)count
- The count (in)newSegments
- A reference to a com.esri.arcgis.geometry.ISegmentCollection (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void replaceSegments(int index, int comingIn, int goingAway, ISegment newSegments) throws IOException, AutomationException
GeometryEnvironment.replaceSegments(com.esri.arcgis.geometry.ISegmentCollection, int, int, com.esri.arcgis.geometry.ISegment[])
.
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.
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.
index
- The index (in)comingIn
- The comingIn (in)goingAway
- The goingAway (in)newSegments
- A reference to a com.esri.arcgis.geometry.ISegment (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void replaceSegmentCollection(int index, int goingAway, ISegmentCollection newSegments) throws IOException, AutomationException
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).
index
- The index (in)goingAway
- The goingAway (in)newSegments
- A reference to a com.esri.arcgis.geometry.ISegmentCollection (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void removeSegments(int index, int count, boolean closeGap) throws IOException, AutomationException
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 will
be connected at the midpoint of the gap by modifying the segments adjacent to the gap.This will create a
connected Path.
index
- The index (in)count
- The count (in)closeGap
- The closeGap (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setCircle(IPoint cp, double circleRadius) throws IOException, AutomationException
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.
cp
- A reference to a com.esri.arcgis.geometry.IPoint (in)circleRadius
- The circleRadius (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IConstructCircularArc.constructCircle(com.esri.arcgis.geometry.IPoint, double, boolean)
,
ISegmentCollection.setCircle(com.esri.arcgis.geometry.IPoint, double)
void setRectangle(IEnvelope inEnvelope) throws IOException, AutomationException
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.
inEnvelope
- A reference to a com.esri.arcgis.geometry.IEnvelope (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setSegments(int count, ISegment newSegments) throws IOException, AutomationException
GeometryEnvironment.setSegments(com.esri.arcgis.geometry.ISegmentCollection, com.esri.arcgis.geometry.ISegment[])
.
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).
count
- The count (in)newSegments
- A reference to a com.esri.arcgis.geometry.ISegment (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setSegmentCollection(ISegmentCollection newSegments) throws IOException, AutomationException
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).
newSegments
- A reference to a com.esri.arcgis.geometry.ISegmentCollection (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IEnumSegment getEnumSegments() throws IOException, AutomationException
Returns an IEnumSegment enumerator for the current SegmentCollection.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IEnumCurve getEnumCurve() throws IOException, AutomationException
Returns an IEnumCurve enumerator for the current SegmentCollection.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void hasNonLinearSegments(boolean[] nonLinearSegments) throws IOException, AutomationException
Returns TRUE if the Segment Collection contains CircularArcs, BezierCurves, or EllipticArcs. Returns FALSE if all segments are Lines.
nonLinearSegments
- The nonLinearSegments (in/out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IEnumSegment getIndexedEnumSegments(IGeometry queryGeometry) throws IOException, AutomationException
queryGeometry
- A reference to a com.esri.arcgis.geometry.IGeometry (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void segmentsChanged() throws IOException, AutomationException
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.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |