当前位置: 首页>>代码示例>>C#>>正文


C# IGeometryCollection.get_Geometry方法代码示例

本文整理汇总了C#中IGeometryCollection.get_Geometry方法的典型用法代码示例。如果您正苦于以下问题:C# IGeometryCollection.get_Geometry方法的具体用法?C# IGeometryCollection.get_Geometry怎么用?C# IGeometryCollection.get_Geometry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IGeometryCollection的用法示例。


在下文中一共展示了IGeometryCollection.get_Geometry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddOutlineToGraphicsLayer3D

        public static void AddOutlineToGraphicsLayer3D(IGraphicsContainer3D graphicsContainer3D, IGeometryCollection geometryCollection, IColor color, esriSimple3DLineStyle style, double width)
        {
            for (int i = 0; i < geometryCollection.GeometryCount; i++)
            {
                IGeometry geometry = geometryCollection.get_Geometry(i);

                graphicsContainer3D.AddElement(ElementUtilities.ConstructPolylineElement(geometry, color, style, width));
            }
        }
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:9,代码来源:GraphicsLayer3DUtilities.cs

示例2: BuildMultiPartPolyline

        // creates a multipart polyline with all polylines in the geometry collection
        private IGeometry BuildMultiPartPolyline(IGeometryCollection pGeomCollection)
        {
            IGeometry retVal = null;
            try
            {
                object missing = System.Reflection.Missing.Value;

                IPolyline pPolylineNew = new PolylineClass();
                IGeometryCollection pGeomCollectionNew = (IGeometryCollection)pPolylineNew;

                for(int x = 0; x < pGeomCollection.GeometryCount; x++)
                {
                    IPolyline pPolyline = (IPolyline)pGeomCollection.get_Geometry(x);

                    IGeometryCollection pPathColl;
                    pPathColl = (IGeometryCollection)pPolyline;

                    for(int y = 0; y < pPathColl.GeometryCount; y++)
                    {
                        IPath pPath = (IPath)pPathColl.get_Geometry(y);
                        pGeomCollectionNew.AddGeometry(pPath,ref missing,ref missing);
                    }
                }

                retVal = (IGeometry)pGeomCollectionNew;

            }
            catch(Exception ex)
            {
                Debug.WriteLine(ex.Message + "\n" + ex.StackTrace);
                util.Logger.Write(" Descrip  : Building a multipart polyline (if required)." +
                    "\n Message  : " + ex.Message +
                    "\n StackTrc : " + ex.StackTrace,util.Logger.LogLevel.Debug);
            }
            return retVal;
        }
开发者ID:EAWCS1,项目名称:SUITT,代码行数:37,代码来源:CreateBusinessFeaturesForm.cs

示例3: BuildMultiPartPolygon

        // creates a multipart polygon with all polygons in the geometry collection
        private IGeometry BuildMultiPartPolygon(IGeometryCollection pGeomCollection)
        {
            IGeometry retVal = null;

            try
            {
                object missing = System.Reflection.Missing.Value;
                IPolygon pPolygonNew = new PolygonClass();
                IGeometryCollection pGeomCollectionNew = (IGeometryCollection)pPolygonNew;

                //IArea pArea = null;

                for(int x = 0; x < pGeomCollection.GeometryCount; x++)
                {

                    IPolygon pPolygon = (IPolygon)pGeomCollection.get_Geometry(x);

                    //pArea = (IArea)pPolygon;
                    //Debug.WriteLine("area = " + pArea.Area);

                    IGeometryCollection pRingColl;
                    pRingColl = (IGeometryCollection)pPolygon;

                    for(int y = 0; y < pRingColl.GeometryCount; y++)
                    {
                        IRing pRing = (IRing)pRingColl.get_Geometry(y);
                        //Debug.WriteLine("length = " + pRing.Length);
                        pGeomCollectionNew.AddGeometry(pRing,ref missing,ref missing);
                    }
                }

                //pArea = (IArea)pGeomCollectionNew;
                //Debug.WriteLine("Total area = " + pArea.Area);

                retVal = (IGeometry)pGeomCollectionNew;

            }
            catch(Exception ex)
            {
                Debug.WriteLine(ex.Message + "\n" + ex.StackTrace);
                util.Logger.Write(" Descrip  : Building a multipart polygon (if required)." +
                    "\n Message  : " + ex.Message +
                    "\n StackTrc : " + ex.StackTrace,util.Logger.LogLevel.Debug);

            }

            return retVal;
        }
开发者ID:EAWCS1,项目名称:SUITT,代码行数:49,代码来源:CreateBusinessFeaturesForm.cs


注:本文中的IGeometryCollection.get_Geometry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。