/// <summary> /// Construct multi patch outline /// </summary> /// <param name="multiPatchGeometry">multi patch geometry</param> /// <returns>object implements IGeometryCollection</returns> public static IGeometryCollection ConstructMultiPatchOutline(IGeometry multiPatchGeometry) { IGeometryCollection outlineGeometryCollection = new GeometryBagClass(); IGeometryCollection multiPatchGeometryCollection = multiPatchGeometry as IGeometryCollection; for (int i = 0; i < multiPatchGeometryCollection.GeometryCount; i++) { IGeometry geometry = multiPatchGeometryCollection.get_Geometry(i); switch (geometry.GeometryType) { case esriGeometryType.esriGeometryTriangleStrip: outlineGeometryCollection.AddGeometryCollection(ConstructTriangleStripOutline(geometry)); break; case esriGeometryType.esriGeometryTriangleFan: outlineGeometryCollection.AddGeometryCollection(ConstructTriangleFanOutline(geometry)); break; case esriGeometryType.esriGeometryTriangles: outlineGeometryCollection.AddGeometryCollection(ConstructTrianglesOutline(geometry)); break; case esriGeometryType.esriGeometryRing: outlineGeometryCollection.AddGeometry(ConstructRingOutline(geometry), ref missing, ref missing); break; default: throw new Exception("Unhandled Geometry Type. " + geometry.GeometryType); } } return(outlineGeometryCollection); }
public static IGeometryCollection ConstructMultiPatchOutline(IGeometry multiPatchGeometry) { IGeometryCollection outlineGeometryCollection = new GeometryBagClass(); IGeometryCollection multiPatchGeometryCollection = multiPatchGeometry as IGeometryCollection; for (int i = 0; i < multiPatchGeometryCollection.GeometryCount; i++) { IGeometry geometry = multiPatchGeometryCollection.get_Geometry(i); switch(geometry.GeometryType) { case (esriGeometryType.esriGeometryTriangleStrip): outlineGeometryCollection.AddGeometryCollection(ConstructTriangleStripOutline(geometry)); break; case (esriGeometryType.esriGeometryTriangleFan): outlineGeometryCollection.AddGeometryCollection(ConstructTriangleFanOutline(geometry)); break; case (esriGeometryType.esriGeometryTriangles): outlineGeometryCollection.AddGeometryCollection(ConstructTrianglesOutline(geometry)); break; case (esriGeometryType.esriGeometryRing): outlineGeometryCollection.AddGeometry(ConstructRingOutline(geometry), ref _missing, ref _missing); break; default: throw new Exception("Unhandled Geometry Type. " + geometry.GeometryType); } } return outlineGeometryCollection; }