Ejemplo n.º 1
0
        private void map_AfterDraw(IDisplay display, esriViewDrawPhase drawphase)
        {
            IColor pColor = null;
            IPoint pPoint = null;

            if (EditVertexClass.m_vertexGeoBag != null)
            {
                for (int i = 0; i <= EditVertexClass.m_vertexGeoBag.GeometryCount - 1; i++)
                {
                    pPoint = EditVertexClass.m_vertexGeoBag.get_Geometry(i) as IPoint;
                    if (pPoint == EditVertexClass.pHitPnt)
                    {
                        EditVertexClass.DisplayGraphic(pPoint, pColor, EditVertexClass.m_selPointSym as ISymbol);
                    }
                    if (pPoint.ID == 10)
                    {
                        EditVertexClass.DisplayGraphic(pPoint, pColor, EditVertexClass.m_endPointSym as ISymbol);
                    }
                    else
                    {
                        EditVertexClass.DisplayGraphic(pPoint, pColor, EditVertexClass.m_vertexSym as ISymbol);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void OnCreate(object Hook)
        {
            EditVertexClass.ClearResource();

            if (Hook == null)
            {
                return;
            }
            try
            {
                m_hookHelper      = new HookHelperClass();
                m_hookHelper.Hook = Hook;
                if (m_hookHelper.ActiveView == null)
                {
                    m_hookHelper = null;
                }
            }
            catch
            {
                m_hookHelper = null;
            }

            if (m_hookHelper == null)
            {
                bEnable = false;
            }
            else
            {
                bEnable = true;
            }
        }
Ejemplo n.º 3
0
 public void OnClick()
 {
     try
     {
         m_Map          = m_hookHelper.FocusMap;
         m_activeView   = m_Map as IActiveView;
         m_EngineEditor = MapManager.EngineEditor;
         EditVertexClass.ClearResource();
         if (m_EngineEditor == null)
         {
             return;
         }
         if (m_EngineEditor.EditState != esriEngineEditState.esriEngineStateEditing)
         {
             return;
         }
         IWorkspaceEdit2 pWSEdit = m_EngineEditor.EditWorkspace as IWorkspaceEdit2;
         if (pWSEdit == null)
         {
             return;
         }
         Boolean bHasUndo = false;
         pWSEdit.HasUndos(ref bHasUndo);
         if (bHasUndo)
         {
             pWSEdit.UndoEditOperation();
         }
         m_activeView.Refresh();
     }
     catch (Exception ex)
     {
     }
 }
Ejemplo n.º 4
0
 public void OnClick()
 {
     m_Map              = m_hookHelper.FocusMap;
     m_activeView       = m_Map as IActiveView;
     m_EngineEditor     = MapManager.EngineEditor;
     m_EngineEditLayers = MapManager.EngineEditor as IEngineEditLayers;
     EditVertexClass.ClearResource();
 }
Ejemplo n.º 5
0
        public void OnClick()
        {
            m_Map              = m_hookHelper.FocusMap;
            m_activeView       = m_Map as IActiveView;
            m_EngineEditor     = MapManager.EngineEditor;
            m_EngineEditLayers = MapManager.EngineEditor as IEngineEditLayers;

            EditVertexClass.m_activeView = m_activeView;
            EditVertexClass.m_Map        = m_Map;

            EditVertexClass.ClearResource();

            if (m_EngineEditor == null)
            {
                return;
            }
            if (m_EngineEditor.EditState != esriEngineEditState.esriEngineStateEditing)
            {
                return;
            }
            if (m_EngineEditLayers == null)
            {
                return;
            }

            IFeatureLayer pFeatLyr = m_EngineEditLayers.TargetLayer;

            if (pFeatLyr == null)
            {
                return;
            }
            IFeatureCursor pFeatCur = MapManager.GetSelectedFeatures(pFeatLyr);

            if (pFeatCur == null)
            {
                MessageBox.Show("请选择要删除节点的要素!", "提示",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            EditVertexClass.ShowAllVertex(pFeatLyr);

            ((IActiveViewEvents_Event)m_Map).AfterDraw += new IActiveViewEvents_AfterDrawEventHandler(map_AfterDraw);
        }
Ejemplo n.º 6
0
 private void DelVertexNode(IPoint pPnt)
 {
     try
     {
         IFeatureLayer pFeaturelayer = m_EngineEditLayers.TargetLayer;
         IActiveView   pActiveView   = m_activeView;
         IPoint        pPoint        = pPnt;
         if (pFeaturelayer.FeatureClass == null)
         {
             return;
         }
         //如果不是面状地物则退出
         if (pFeaturelayer.FeatureClass.ShapeType != esriGeometryType.esriGeometryEnvelope &&
             pFeaturelayer.FeatureClass.ShapeType != esriGeometryType.esriGeometryPolygon &&
             pFeaturelayer.FeatureClass.ShapeType != esriGeometryType.esriGeometryLine &&
             pFeaturelayer.FeatureClass.ShapeType != esriGeometryType.esriGeometryPolyline)
         {
             return;
         }
         IGeometry pGeo        = null;
         IFeature  pSelFeature = null;
         pSelFeature = EditVertexClass.GetSelectedFeature(pFeaturelayer);
         //是否有选中的几何体
         if (pSelFeature == null)
         {
             return;
         }
         pGeo = pSelFeature.ShapeCopy;
         double pSrchDis = 0;
         double pHitDis  = 0;
         pSrchDis = pActiveView.Extent.Width / 200;
         pPoint.Z = 0;
         int              pIndex       = 0;
         IElement         pElement     = null;
         IHitTest         pHtTest      = null;
         bool             pBoolHitTest = false;
         IPoint           pPtHit       = null;
         IPointCollection pPointCol    = null;
         IPolygon         pPolygon     = null;
         IPolyline        pPyline      = null;
         bool             bRightZSide  = true;
         int              pInt         = 0;
         m_EngineEditor.StartOperation();
         //删除面状要素的节点
         if (pFeaturelayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon ||
             pFeaturelayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryEnvelope)
         {
             pElement          = new PolygonElement();
             pElement.Geometry = pSelFeature.Shape;
             IPolygon pPoly = null;
             pPoly        = pElement.Geometry as IPolygon;
             pHtTest      = pPoly as IHitTest;
             pBoolHitTest = pHtTest.HitTest(pPoint, pSrchDis, esriGeometryHitPartType.esriGeometryPartVertex,
                                            pPtHit, ref pHitDis, ref pInt, ref pIndex, ref bRightZSide);
             if (pBoolHitTest == false)
             {
                 return;
             }
             EditVertexClass.pHitPnt = pPtHit;
             pPointCol = pSelFeature.ShapeCopy as IPointCollection;
             //如果多边形的节点只有3个则不能再删除了
             if (pPointCol.PointCount <= 4)
             {
                 MessageBox.Show("多边形的节点至少需要3个!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 return;
             }
             //顶点删除
             pPointCol.RemovePoints(pIndex, 1);
             pPolygon = pPointCol as IPolygon;
             pPolygon.Close();
             pSelFeature.Shape = pPolygon;
             pSelFeature.Store();
         }
         //删除线状要素的节点
         else if (pFeaturelayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolyline ||
                  pFeaturelayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryLine)
         {
             pElement          = new LineElement();
             pElement.Geometry = pSelFeature.Shape;
             IPolyline pPolyLine = default(IPolyline);
             pPolyLine    = pElement.Geometry as IPolyline;
             pHtTest      = pPolyLine as IHitTest;
             pBoolHitTest = pHtTest.HitTest(pPoint, pSrchDis, esriGeometryHitPartType.esriGeometryPartVertex,
                                            pPtHit, ref pHitDis, ref pInt, ref pIndex, ref bRightZSide);
             if (pBoolHitTest == false)
             {
                 return;
             }
             EditVertexClass.pHitPnt = pPtHit;
             pPointCol = pSelFeature.ShapeCopy as IPointCollection;
             //如果Polyline节点只有2个则不能再删除了
             if (pPointCol.PointCount <= 2)
             {
                 MessageBox.Show("线的节点至少需要2个!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 return;
             }
             //顶点删除
             pPointCol.RemovePoints(pIndex, 1);
             pPyline           = pPointCol as IPolyline;
             pSelFeature.Shape = pPyline;
             pSelFeature.Store();
         }
         //与选中点坐标相同的节点都删除
         for (int i = 0; i <= pPointCol.PointCount - 1; i++)
         {
             if (i > pPointCol.PointCount - 1)
             {
                 break;
             }
             if (pPointCol.get_Point(i).X == pPoint.X & pPointCol.get_Point(i).Y == pPoint.Y)
             {
                 pPointCol.RemovePoints(i, 1);
                 i = i - 1;
             }
         }
         //停止编辑
         m_EngineEditor.StopOperation("DelVertexTool");
         //显示顶点
         EditVertexClass.ShowAllVertex(pFeaturelayer);
         m_activeView.Refresh();
     }
     catch (Exception ex)
     {
         m_activeView.Refresh();
     }
 }
Ejemplo n.º 7
0
 private void AddVertexNode(IPoint pPnt)
 {
     try
     {
         IFeatureLayer pFeaturelayer = m_EngineEditLayers.TargetLayer;
         IActiveView   pActiveView   = m_activeView;
         IPoint        pPoint        = pPnt;
         if (pFeaturelayer.FeatureClass == null)
         {
             return;
         }
         //如果不是面状地物则退出
         if (pFeaturelayer.FeatureClass.ShapeType != esriGeometryType.esriGeometryEnvelope &&
             pFeaturelayer.FeatureClass.ShapeType != esriGeometryType.esriGeometryPolygon &&
             pFeaturelayer.FeatureClass.ShapeType != esriGeometryType.esriGeometryLine &&
             pFeaturelayer.FeatureClass.ShapeType != esriGeometryType.esriGeometryPolyline)
         {
             return;
         }
         IGeometry pGeo        = null;
         IFeature  pSelFeature = null;
         pSelFeature = EditVertexClass.GetSelectedFeature(pFeaturelayer);
         //是否有选中的几何体
         if (pSelFeature == null)
         {
             return;
         }
         //解决不带Z值的要素的编辑和Z值为空的要素的编辑问题
         IZAware pZAware = pPoint as IZAware;
         pZAware.ZAware = true;
         pPoint.Z       = 0;
         bool pInLine = false;
         ITopologicalOperator pTopoOpt      = default(ITopologicalOperator);
         IPolyline            pBoundaryLine = default(IPolyline);
         //最小的距离
         double             pMindis  = 0;
         IProximityOperator pProxOpt = default(IProximityOperator);
         //得到多边形的边界
         if (pFeaturelayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon ||
             pFeaturelayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryEnvelope)
         {
             //获取边界线
             pBoundaryLine = EditVertexClass.GetBoundary(pFeaturelayer);
         }
         else if (pFeaturelayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolyline ||
                  pFeaturelayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryLine)
         {
             pBoundaryLine = pSelFeature.ShapeCopy as IPolyline;
         }
         pTopoOpt = pPoint as ITopologicalOperator;
         IRelationalOperator pRelationalOperator = default(IRelationalOperator);
         pRelationalOperator = pPoint as IRelationalOperator;
         //判断点是否在边界上
         pInLine = pRelationalOperator.Within(pBoundaryLine);
         //如果不在边界上,判断是否小于容忍距离,如果大于容忍距离则退出程序
         if (pInLine == false)
         {
             pProxOpt = pPoint as IProximityOperator;
             pMindis  = pProxOpt.ReturnDistance(pBoundaryLine);
             if (pMindis > THE_POINT_TO_POINT_TOLERANCE)
             {
                 return;
             }
         }
         //判断是否增加的点刚好为节点
         IPointCollection pPolylinePointCol = pBoundaryLine as IPointCollection;
         IHitTest         pHitTest          = default(IHitTest);
         double           pHitDis           = 0;
         int    pSegIndex  = 0;
         int    pVerIndex  = 0;
         IPoint pHitPoint  = null;
         bool   bRightSide = true;
         pHitTest = pBoundaryLine as IHitTest;
         //增加的点为已有的节点则退出程序
         if (pHitTest.HitTest(pPoint, THE_POINT_TO_POINT_TOLERANCE * 10,
                              esriGeometryHitPartType.esriGeometryPartVertex, pHitPoint,
                              ref pHitDis, ref pSegIndex, ref pVerIndex, ref bRightSide) == true)
         {
             if (pHitDis < THE_POINT_TO_POINT_TOLERANCE)
             {
                 return;
             }
         }
         EditVertexClass.pHitPnt = pHitPoint;
         //为多边形增加节点
         ISegmentCollection pSegmentCollection = pBoundaryLine as ISegmentCollection;
         IPolyline          pSegPolyline       = null;
         int    pPointIndex = 0;
         ILine  pLine       = default(ILine);
         double pDis1       = 0;
         double pDis2       = 0;
         IPoint pVerTex     = default(IPoint);
         pMindis  = 100;
         pProxOpt = pPoint as IProximityOperator;
         for (int i = 0; i <= pSegmentCollection.SegmentCount - 1; i++)
         {
             //判断选中点是否在这个Segment上
             pLine = pSegmentCollection.get_Segment(i) as ILine;
             pDis1 = pProxOpt.ReturnDistance(pLine.FromPoint);
             pDis2 = pProxOpt.ReturnDistance(pLine.ToPoint);
             if (Math.Abs(pDis1 + pDis2 - pLine.Length) <= pMindis)
             {
                 pMindis = Math.Abs(pDis1 + pDis2 - pLine.Length);
                 pVerTex = pLine.ToPoint;
             }
         }
         //获取选中的几何特征
         pGeo = pSelFeature.Shape;
         //得到索引
         pPointIndex = EditVertexClass.GetVertexIndex(pVerTex, pGeo);
         //如果是首点,则设置为最后一个点
         if (pPointIndex == 0)
         {
             pPointIndex = pSegmentCollection.SegmentCount;
         }
         IPointCollection pPolygonPointCol = null;
         pPolygonPointCol = pSelFeature.ShapeCopy as IPointCollection;
         pPolygonPointCol.InsertPoints(pPointIndex, 1, ref pPoint);
         m_EngineEditor.StartOperation();
         //拓扑操作
         IPolygon  pPolygon = null;
         IPolyline pPlyline = null;
         if (pFeaturelayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon ||
             pFeaturelayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryEnvelope)
         {
             pPolygon = pPolygonPointCol as IPolygon;
             pPolygon.Close();
             pTopoOpt = pPolygon as ITopologicalOperator;
             pTopoOpt.Simplify();
             pSelFeature.Shape = pPolygon;
             pSelFeature.Store();
         }
         else if (pFeaturelayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolyline ||
                  pFeaturelayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryLine)
         {
             pPlyline = pPolygonPointCol as IPolyline;
             pTopoOpt = pPlyline as ITopologicalOperator;
             pTopoOpt.Simplify();
             pSelFeature.Shape = pPlyline;
             pSelFeature.Store();
         }
         //停止编辑
         m_EngineEditor.StopOperation("AddVertexTool");
         //显示顶点
         EditVertexClass.ShowAllVertex(pFeaturelayer);
     }
     catch (Exception ex)
     {
     }
 }
Ejemplo n.º 8
0
        private void EditMouseUp(IPoint pPnt)
        {
            IPolygon       pPolyResult;
            IPolyline      pPolylineResult;
            IFeatureCursor pFeatureCursor;
            IFeature       pFeature;
            IFeatureLayer  pFeatLyr = m_EngineEditLayers.TargetLayer;

            //检查编辑的地物
            if (m_editDispFeed != null)
            {
                switch (m_pHitElem.Geometry.GeometryType)
                {
                case esriGeometryType.esriGeometryLine:
                case esriGeometryType.esriGeometryPolyline:
                    pPolylineResult = m_polylineMvPtFeed.Stop();
                    //作有效性检查
                    if ((pPolylineResult != null))
                    {
                        //更新元素
                        m_pHitElem.Geometry = pPolylineResult;

                        //获取选中的地物
                        pFeatureCursor = MapManager.GetSelectedFeatures(pFeatLyr);
                        if (pFeatureCursor == null)
                        {
                            return;
                        }
                        pFeature = pFeatureCursor.NextFeature();
                        m_EngineEditor.StartOperation();
                        //更新要素形状
                        pFeature.Shape = pPolylineResult;
                        pFeature.Store();
                        //停止编辑
                        m_EngineEditor.StopOperation("MoveVertex");
                        EditVertexClass.ShowAllVertex(pFeatLyr);
                    }
                    break;

                case esriGeometryType.esriGeometryPolygon:
                case esriGeometryType.esriGeometryEnvelope:
                    //得到反馈的结果
                    pPolyResult = m_polyMvPtFeed.Stop();
                    //作有效性检查
                    if (pPolyResult != null)
                    {
                        //更新元素
                        m_pHitElem.Geometry = pPolyResult;
                        //获取选中的地物
                        pFeatureCursor = MapManager.GetSelectedFeatures(pFeatLyr);
                        if (pFeatureCursor == null)
                        {
                            return;
                        }
                        pFeature = pFeatureCursor.NextFeature();
                        m_EngineEditor.StartOperation();
                        //更新要素形状
                        pFeature.Shape = pPolyResult;
                        pFeature.Store();
                        //停止编辑
                        m_EngineEditor.StopOperation("MoveVertex");
                        if (pFeature.Shape.GeometryType == esriGeometryType.esriGeometryPolygon ||
                            pFeature.Shape.GeometryType == esriGeometryType.esriGeometryPolyline)
                        {
                            EditVertexClass.ShowAllVertex(pFeatLyr);
                        }
                    }
                    IFeature pTempParcel;
                    //定义存储多边形要素的局部变量
                    IPoint pDestPoint;
                    //定义节点移动的目标位置
                    pDestPoint = pPnt;
                    IZAware pZAware = pDestPoint as IZAware;
                    pZAware.ZAware = true;
                    pDestPoint.Z   = 0;
                    //所有包含该节点的多边形都进行操作
                    for (int i = 0; i <= EditVertexClass.m_featArray.Count - 1; i++)
                    {
                        pTempParcel = EditVertexClass.m_featArray.get_Element(i) as IFeature;
                        //记录节点序号
                        int pIndex = 0;
                        pIndex = EditVertexClass.GetVertexIndex(m_fromPoint, pTempParcel.Shape);
                        if (!(pIndex == -2))
                        {
                            ITopologicalOperator pTopoOpt         = default(ITopologicalOperator);
                            IPolygon             pPolygon         = default(IPolygon);
                            IPointCollection     pPolygonPointCol = default(IPointCollection);
                            pPolygonPointCol = pTempParcel.ShapeCopy as IPointCollection;
                            pPolygonPointCol.UpdatePoint(pIndex, pDestPoint);
                            pPolygon = pPolygonPointCol as IPolygon;
                            pPolygon.Close();
                            pTopoOpt = pPolygon as ITopologicalOperator;
                            pTopoOpt.Simplify();
                            pTempParcel.Shape = pPolygon;
                            pTempParcel.Store();
                        }
                    }
                    EditVertexClass.m_featArray.RemoveAll();
                    break;
                }

                //释放内存
                m_polyMvPtFeed     = null;
                m_polylineMvPtFeed = null;
                m_editDispFeed     = null;
                m_pHitElem         = null;
                //刷新地图
                m_activeView.Refresh();
            }
        }
Ejemplo n.º 9
0
        private void EditMouseDown(IPoint pPnt)
        {
            try
            {
                IPolygon  pGeompoly;
                IPolyline pGeomPolyline;
                IHitTest  pHtTest;
                IPoint    pPtHit;
                double    pDblHitDis   = 0;
                int       pLngPrtIdx   = 0;
                int       pLngSegIdx   = 0;
                Boolean   pBoolHitRt   = false;
                Boolean   pBoolHitTest = false;
                double    pDblSrchDis  = 0;
                pPnt.Z      = 0;
                pPtHit      = new PointClass();
                pDblSrchDis = m_activeView.Extent.Width / 200;
                //获取编辑目标图层
                IFeatureLayer pFeatLyr = m_EngineEditLayers.TargetLayer;
                if (pFeatLyr == null)
                {
                    return;
                }
                IFeatureCursor pFeatCur  = MapManager.GetSelectedFeatures(pFeatLyr);
                IFeature       pTFeature = pFeatCur.NextFeature();
                switch (pTFeature.Shape.GeometryType)
                {
                //当为单点、点集时直接返回
                case esriGeometryType.esriGeometryPoint:
                case esriGeometryType.esriGeometryMultipoint:
                    return;

                //线要素
                case esriGeometryType.esriGeometryLine:
                case esriGeometryType.esriGeometryPolyline:
                    m_pHitElem = new LineElementClass();
                    break;

                //面要素
                case esriGeometryType.esriGeometryPolygon:
                case esriGeometryType.esriGeometryEnvelope:
                    m_pHitElem = new PolygonElementClass();
                    break;
                }
                //获取选中要素的几何对象
                m_pHitElem.Geometry = pTFeature.Shape;
                if (m_pHitElem != null)
                {
                    switch (pTFeature.Shape.GeometryType)
                    {
                    case esriGeometryType.esriGeometryLine:
                    case esriGeometryType.esriGeometryPolyline:
                        pGeomPolyline = m_pHitElem.Geometry as IPolyline;
                        pHtTest       = pGeomPolyline as IHitTest;
                        pBoolHitTest  = pHtTest.HitTest(pPnt, pDblSrchDis,
                                                        esriGeometryHitPartType.esriGeometryPartVertex, pPtHit,
                                                        ref pDblHitDis, ref pLngPrtIdx, ref pLngSegIdx, ref pBoolHitRt);
                        if (pBoolHitTest)
                        {
                            EditVertexClass.pHitPnt = pPtHit;
                            m_editDispFeed          = new LineMovePointFeedbackClass();
                            m_editDispFeed.Display  = m_activeView.ScreenDisplay;
                            m_polylineMvPtFeed      = m_editDispFeed as ILineMovePointFeedback;
                            m_polylineMvPtFeed.Start(pGeomPolyline, pLngSegIdx, pPnt);
                        }

                        break;

                    case esriGeometryType.esriGeometryPolygon:
                    case esriGeometryType.esriGeometryEnvelope:
                        pGeompoly    = m_pHitElem.Geometry as IPolygon;
                        pHtTest      = pGeompoly as IHitTest;
                        pBoolHitTest = pHtTest.HitTest(pPnt, pDblSrchDis,
                                                       esriGeometryHitPartType.esriGeometryPartVertex,
                                                       pPtHit, ref pDblHitDis, ref pLngPrtIdx, ref pLngSegIdx, ref pBoolHitRt);
                        EditVertexClass.pHitPnt = pPtHit;
                        if (pBoolHitTest)
                        {
                            //定义获取到的与传入点的最近所选地物
                            IFeature pFeature;
                            //定义测量距离用于捕获离点最近的地物
                            double pTestDist = 0;
                            //用于求点与地物的距离
                            IProximityOperator pProximity;
                            IGeometry          pGeoM;
                            IFeature           pTestFeature;
                            //用于最短距离的比较
                            double               pTempDist = 0;
                            IFeatureCursor       pSelected;
                            ITopologicalOperator pTopoOpt;
                            //捕捉到的要移动的节点
                            IPoint pSnapVertex = default(IPoint);
                            //从所选地物中获得离点最近的那个地物
                            pFeature = null;
                            //用鼠标点进行运算
                            pTopoOpt = pPnt as ITopologicalOperator;
                            pTopoOpt.Simplify();
                            pProximity   = pPnt as IProximityOperator;
                            pSelected    = MapManager.GetSelectedFeatures(pFeatLyr);
                            pTestFeature = pSelected.NextFeature();
                            pGeoM        = pTestFeature.Shape;
                            pTestDist    = pProximity.ReturnDistance(pGeoM);
                            pFeature     = pTestFeature;
                            //从所选地物中获得离点最近的那个地物
                            while (pTestFeature != null)
                            {
                                pTestFeature = pSelected.NextFeature();
                                if (pTestFeature != null)
                                {
                                    pGeoM     = pTestFeature.Shape;
                                    pTempDist = pProximity.ReturnDistance(pGeoM);
                                    if (pTempDist < pTestDist)
                                    {
                                        pTestDist = pTempDist;
                                        pFeature  = pTestFeature;
                                    }
                                }
                            }

                            //检查pSnapPoint是否是所选地物中的某个图斑的一个节点
                            double pDblHDis      = 0;
                            int    pLngVertexIdx = 0;
                            int    pLngSIdx      = 0;
                            bool   pBoolHRt      = false;
                            bool   pBlnGet       = false;
                            double pDblDistMin   = 0;
                            pDblDistMin = pTempDist;
                            if (pDblDistMin == 0)
                            {
                                pDblDistMin = 3;
                            }
                            //两倍可以保证一般一次找的到
                            double   pDblSearchRadius = pDblDistMin * 2;
                            IHitTest pHT = default(IHitTest);
                            pHT = pFeature.Shape as IHitTest;
                            //如果pSnapPoint不是pTempParcel的节点
                            if (EditVertexClass.GetVertexIndex(pPnt, pFeature.Shape) == -2)
                            {
                                pSnapVertex = new Point();
                                while (!pBlnGet)
                                {
                                    pBlnGet = pHT.HitTest(pPnt, pDblSearchRadius,
                                                          esriGeometryHitPartType.esriGeometryPartVertex,
                                                          pSnapVertex, ref pDblHDis, ref pLngVertexIdx, ref pLngSIdx, ref pBoolHRt);
                                    pDblSearchRadius = pDblSearchRadius + pDblDistMin;
                                }
                                EditVertexClass.pHitPnt = pSnapVertex;
                                //如果pSnapVertex仍然不是pTempParcel的节点
                                if (EditVertexClass.GetVertexIndex(pSnapVertex, pFeature.Shape) == -2)
                                {
                                    MessageBox.Show("所想移动的起点不是所选面的节点", "提示",
                                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    return;
                                }
                                m_fromPoint = pSnapVertex;
                            }
                            else
                            {
                                pSnapVertex = pPnt;
                                m_fromPoint = pSnapVertex;
                            }
                            //找到包含所要移动的节点的图形,在该过程里面对m_FeatArray进行了赋值
                            EditVertexClass.SelectByShapeTop(pFeatLyr, pSnapVertex, esriSpatialRelEnum.esriSpatialRelTouches,
                                                             false, esriSelectionResultEnum.esriSelectionResultNew);
                            m_editDispFeed         = new PolygonMovePointFeedbackClass();
                            m_editDispFeed.Display = m_activeView.ScreenDisplay;
                            m_polyMvPtFeed         = m_editDispFeed as IPolygonMovePointFeedback;
                            m_polyMvPtFeed.Start(pGeompoly, pLngSegIdx, pPnt);
                        }
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }