arcgis engine 图形操作函数 (面切面)
来源:互联网 发布:mac word 首选项 编辑:程序博客网 时间:2024/04/30 01:24
1.封闭线与打断操作,这部分新手未必知道。
///< summary>
/// 利用面生成闭合的曲线
///< /summary>
///< param name="pPolygon">传入的面图形</param>
///< returns></returns>
/// 创建人: 懒羊羊
private IPolyline PolygonToLine(IPolygon pPolygon)
{
IGeometryCollection pGeometryCollectionPolygon;
IClone pClone;
ISegmentCollection pSegmentCollectionPath;
object o = Type.Missing;
IGeometryCollection pGeoCol = new PolylineClass();
pClone = (IClone)pPolygon;
pGeometryCollectionPolygon = pClone.Clone() as IGeometryCollection;
for (int i = 0; i < pGeometryCollectionPolygon.GeometryCount; i++)
{
pSegmentCollectionPath = new PathClass();
pSegmentCollectionPath.AddSegmentCollection(pGeometryCollectionPolygon.get_Geometry(i) as ISegmentCollection);
pGeoCol.AddGeometry(pSegmentCollectionPath as IGeometry, ref o, ref o);
}
return pGeoCol as IPolyline;
}
///< summary>
/// 线上距离FromPoint的DisOnLine距离上的一点,在这点处把线打断为两段
///< /summary>
///< param name="myPolyline">传入的限图形</param>
///< param name="DisOnLine">离FromPoint的距离</param>
///< returns></returns>
/// 创建人:懒羊羊
private IPolyline[] BreakLineToTwoPart(IPolyline myPolyline,double DisOnLine)
{
if (DisOnLine < myPolyline.Length) //如果传入的长度大于线的长度,不与操作