实现类似与ArcMap中的split tool的功能-----用点打断线

实现类似与ArcMap中的split tool的功能-----用点打断线

实现类似与ArcMap中的split tool的功能:

ICommand pCmd = new GISFunction.SplitFeatuer();
pCmd.OnCreate(this.Object);
ITool ptool = (ITool)pCmd;
this.CurrentTool = ptool;
this.Fun_SetEditorEnabled(false);
if (iType == 1)

{
this.m_bSplitByPoint = true;
}
if (iType == 2)
{
this.m_bSplitByline = true;
}
这是上层实现代码。


下面是基层实现的,但不过还要处理鼠标事件,这些代码就不贴了。
下面是用点打断线的代码:
if (pMap == null || pFeature == null)
{
return false;
}
IFeatureEdit pFeatureEdit = null;
pFeatureEdit = pFeature as IFeatureEdit;
ISet pSplitSet;
try
{
pSplitSet = pFeatureEdit.Split(pSplitPoint);
}
catch
{
return false;
}
pSplitSet.Reset();
IFeature pSplitFeature = null;
pSplitFeature = pSplitSet.Next() as IFeature;

while (pSplitFeature != null)
{
CreateSplitFeature(pMap,pSplitFeature.ShapeCopy);
FlashGeometry(pMap,pSplitFeature.ShapeCopy);
pSplitFeature = pSplitSet.Next() as IFeature;
}
return true;

这谢代码以调试通过。


[ 本帖最后由 qjhli2007 于 2007-8-25 14:49 编辑 ]

来自:http://bbs.esrichina-bj.cn/ESRI/thread-15821-1-2.html

你可能感兴趣的:(split)