实现类似与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;