|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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.
| Method Summary | |
void |
addSegment(ISegment inSegment,
java.lang.Object before,
java.lang.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)
Replaces all segments with references to the input segments. |
| Method Detail |
public int getSegmentCount()
throws java.io.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.
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public ISegment getSegment(int i)
throws java.io.IOException,
AutomationException
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.
i - The i (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void addSegment(ISegment inSegment,
java.lang.Object before,
java.lang.Object after)
throws java.io.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)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void querySegments(int index,
int count,
ISegment[] segments)
throws java.io.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)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void addSegments(int count,
ISegment newSegments)
throws java.io.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)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void addSegmentCollection(ISegmentCollection segments)
throws java.io.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)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void insertSegments(int index,
int count,
ISegment newSegments)
throws java.io.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)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void insertSegmentCollection(int index,
ISegmentCollection newSegments)
throws java.io.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)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void insertSegmentCollectionEx(int index,
int start,
int count,
ISegmentCollection newSegments)
throws java.io.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)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void replaceSegments(int index,
int comingIn,
int goingAway,
ISegment newSegments)
throws java.io.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)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void replaceSegmentCollection(int index,
int goingAway,
ISegmentCollection newSegments)
throws java.io.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)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void removeSegments(int index,
int count,
boolean closeGap)
throws java.io.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)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void setCircle(IPoint cp,
double circleRadius)
throws java.io.IOException,
AutomationException
cp - A reference to a com.esri.arcgis.geometry.IPoint (in)circleRadius - The circleRadius (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void setRectangle(IEnvelope inEnvelope)
throws java.io.IOException,
AutomationException
inEnvelope - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void setSegments(int count,
ISegment newSegments)
throws java.io.IOException,
AutomationException
count - The count (in)newSegments - A reference to a com.esri.arcgis.geometry.ISegment (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void setSegmentCollection(ISegmentCollection newSegments)
throws java.io.IOException,
AutomationException
newSegments - A reference to a com.esri.arcgis.geometry.ISegmentCollection (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public IEnumSegment getEnumSegments()
throws java.io.IOException,
AutomationException
Returns an IEnumSegment enumerator for the current SegmentCollection.
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public IEnumCurve getEnumCurve()
throws java.io.IOException,
AutomationException
Returns an IEnumCurve enumerator for the current SegmentCollection.
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void hasNonLinearSegments(boolean[] nonLinearSegments)
throws java.io.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)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public IEnumSegment getIndexedEnumSegments(IGeometry queryGeometry)
throws java.io.IOException,
AutomationException
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.
Note: In order to have this method returning an indexed segment enumerator the ISpatialIndex::AllowIndexing property must be set to 'true' on the geometry.
queryGeometry - A reference to a com.esri.arcgis.geometry.IGeometry (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void segmentsChanged()
throws java.io.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.
java.io.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 | |||||||||