本文整理汇总了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));
}
}
示例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;
}
示例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;
}