for the cut polygon snippet, i used "base tool" & in the base tool, we have a class by name "class1" where i pasted the snippet. could you please tell me in order to access this tool how the declaration has to be done and where it has to be done - whether onclick(), onmousedown();...
public override void OnClick()
{
// TODO: Add cut1.OnClick implementation
}
public override void OnMouseDown(int Button, int Shift, int X, int Y)
{
// TODO: Add cut1.OnMouseDown implementation
}
public override void OnMouseMove(int Button, int Shift, int X, int Y)
{
// TODO: Add cut1.OnMouseMove implementation
}
public override void OnMouseUp(int Button, int Shift, int X, int Y)
{
// TODO: Add cut1.OnMouseUp implementation
}
#region "Cut Polygon"
///<summary>Use a polyline to cut a polygon.</summary>
///
///<param name="polygon">An IPolygon interface that is the polygon to be split.</param>
///<param name="polyline">An IPolyline interface that is used to cut the input polygon.</param>
///
///<returns>An IGeometryCollection with polygons resulting from the split.</returns>
///
///<remarks></remarks>
public IGeometryCollection CutPolygon(IPolygon polygon, IPolyline polyline)
{
if(polygon == null || polyline == null)
{
return null;
}
ITopologicalOperator4 topologicalOperator4 = polygon as ITopologicalOperator4; // Dynamic Cast
IGeometryCollection geometryCollection = topologicalOperator4.Cut2(polyline);
return geometryCollection;
}
#endregion