Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost.Views/3.3/GeometryExtensions.cs @ 13072

Last change on this file since 13072 was 13072, checked in by gkronber, 9 years ago

#2499: added code from HeuristicLab.BioBoost.Views (from private repository) nothing much has been changed

File size: 575 bytes
Line 
1using GeoAPI.Geometries;
2using System.Collections.Generic;
3
4namespace HeuristicLab.BioBoost.Views {
5  public static class GeometryExtensions {
6    public static IGeometry[] ToArray(this IGeometry geom) {
7      var results = new IGeometry[geom.NumGeometries];
8      for (int i=0; i<results.Length; i++)
9        results[i] = geom.GetGeometryN(i);
10      return results;
11    }
12    public static IEnumerable<IGeometry> GetGeometries(this IGeometry geom) {
13      for (int i = 0; i<geom.NumGeometries; i++)
14        yield return geom.GetGeometryN(i);
15    }
16  }
17}
Note: See TracBrowser for help on using the repository browser.