This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IT > ITopologicalOperator Interface > ITopologicalOperator.Cut Method (ArcObjects .NET 10.5 SDK) |
Splits this geometry into a part left of the cutting polyline, and a part right of it.
[Visual Basic .NET] Public Sub Cut ( _ ByVal cutter As IPolyline, _ ByRef leftGeom As IGeometry, _ ByRef rightGeom As IGeometry _ )
[C#] public void Cut ( IPolyline cutter, ref IGeometry leftGeom, ref IGeometry rightGeom );
[C++]
HRESULT Cut(
IPolyline* cutter,
IGeometry** leftGeom,
IGeometry** rightGeom
);
[C++]
Parameters cutter
cutter is a parameter of type IPolyline leftGeom [out]
leftGeom is a parameter of type IGeometry rightGeom [out]
rightGeom is a parameter of type IGeometry
ITopologicalOperator methods must be applied on high-level geometries only. High-Level geometries are point, multipoint, polyline and polygon. To use this method with low-level geometries such as segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), paths or rings, they must be wrapped into high-level geometries types.
When a polyline/polygon is cut, it is split where it intersects the cutter polyline. Each piece is classified as ‘left of’ or ‘right of’ the cutter. This classification is based on the orientation of the cutter line. Parts of the target polyline that do not intersect the cutting polyline are returned as part of the ‘right of’ result for that input polyline. If a geometry is not cut, the left geometry will be empty.
When using a multi-part polyline to cut a single ring of a polyline, the orientation of the polyline paths is important. The cut piece of the ring must be on the same side of each cutting path as defined by the orientation of each path.
This method does not support GeometryBags.
//The following code shows to wrap a line segment into a polyline in C#
//Assume a line (line1 as ILine) is already created
object obj=Type.Missing;
ISegmentCollection segCollection=new PolylineClass() as ISegmentCollection;
segCollection.AddSegment((ISegment)line1, ref obj, ref obj);
//Set the spatial reference on the new polyline
//The spatial reference is not transfered automatically from the segments
IGeometry geom=segCollection as IGeometry;
geom.SpatialReference=spatialRef;
//Can now be used with ITopologicalOperator methods