zoukankan      html  css  js  c++  java
  • 在AE中通过指定中心点和半径画圆

    /// <summary>
    /// 通过指定的中心点、半径画圆
    /// </summary>
    /// <param name="pLayer">要画的圆所在的图层</param>
    /// <param name="pPoint">圆的中心点</param>
    /// <param name="circleRadius">半径圆的</param>
    /// <param name="pScreenDisplay">图形绘制对象</param>
    private void DrawCircleByCenterAndRadius(ILayer pLayer, IPoint pPoint, double circleRadius, IScreenDisplay pScreenDisplay)
    {
        
    if (pLayer != null)
        {
            ISegmentCollection pSegmentCollection 
    = null;
            
    if (pLayer is IFeatureLayer)
            {
                IFeatureLayer pFeatureLayer 
    = pLayer as IFeatureLayer;
                IFeatureClass pFeatureClass 
    = pFeatureLayer.FeatureClass;
                
    if (pFeatureClass != null)
                {
                    
    if (pFeatureClass.ShapeType == esriGeometryType.esriGeometryPolyline)
                    {
                        pSegmentCollection 
    = new PolylineClass();
                    }
                    
    else if (pFeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon)
                    {
                        pSegmentCollection 
    = new PolygonClass();
                    }
                    
    //开始画圆
                    pSegmentCollection.SetCircle(pPoint, circleRadius);
                    IFeature pCircleFeature 
    = pFeatureClass.CreateFeature();
                    pCircleFeature.Shape 
    = pSegmentCollection as IGeometry;
                    pCircleFeature.Store();
                    
    //局部刷新
                    IInvalidArea pInvalidArea = new InvalidAreaClass();
                    pInvalidArea.Add(pSegmentCollection);
                    pInvalidArea.Display 
    = pScreenDisplay;
                    pInvalidArea.Invalidate((
    short)esriScreenCache.esriAllScreenCaches);
                }
            }
        }
    }


    调用:

    DrawCircleByCenterAndRadius(axMapControl1.get_Layer(1), pPoint, 180, axMapControl1.ActiveView.ScreenDisplay);


    from: http://www.cnblogs.com/GISCafe/archive/2008/05/26/1207927.html

  • 相关阅读:
    ASP.NET MVC框架(第四部分): 处理表单编辑和提交场景 【转】
    ASP.NET MVC框架 (第二部分): URL路径选择 【转】
    ASP.NET MVC框架(第三部分): 把ViewData从控制器传到视图 【转】
    SNS介绍
    测试代码在实际类的内部写还是外部写的思考
    敏捷开发:软件与文档
    TDD是开发方法还是开发方法学?
    命名空间元素的封装性
    个人感觉
    呜呜....可惜...呜呜,也谈谈测试驱动开发
  • 原文地址:https://www.cnblogs.com/yuxuetaoxp/p/3258735.html
Copyright © 2011-2022 走看看