示例#1
0
        private static SoilLayer2D CreateSoilLayer2D(SoilLayer2DGeometry soilLayerGeometry, LayerProperties layerProperties, IEnumerable <SoilLayer2D> nestedLayers)
        {
            var soilLayer = new SoilLayer2D(soilLayerGeometry.OuterLoop, nestedLayers);

            SoilLayerHelper.SetSoilLayerBaseProperties(soilLayer, layerProperties);

            return(soilLayer);
        }
示例#2
0
        private static IEnumerable <SoilLayer2D> CreateNestedSoilLayersRecursively(Dictionary <SoilLayer2DGeometry, Layer2DProperties> soilLayerGeometryLookup, SoilLayer2DGeometry soilLayerGeometry)
        {
            var nestedLayers = new List <SoilLayer2D>();

            SoilLayer2DGeometry[] soilLayerGeometries = soilLayerGeometryLookup.Keys.ToArray();

            foreach (SoilLayer2DLoop innerLoop in soilLayerGeometry.InnerLoops)
            {
                SoilLayer2DGeometry nestedSoilLayerGeometry = soilLayerGeometries.First(slg => slg.OuterLoop.Equals(innerLoop));
                SoilLayer2D         nestedSoilLayer         = CreateSoilLayer2D(nestedSoilLayerGeometry,
                                                                                soilLayerGeometryLookup[nestedSoilLayerGeometry],
                                                                                CreateNestedSoilLayersRecursively(soilLayerGeometryLookup, nestedSoilLayerGeometry));

                nestedLayers.Add(nestedSoilLayer);
            }

            return(StripDuplicateNestedLayers(nestedLayers));
        }
示例#3
0
 private static bool IsNestedLayer(IEnumerable <SoilLayer2DLoop> innerLoops, SoilLayer2DGeometry soilLayerGeometry)
 {
     return(innerLoops.Any(il => il.Equals(soilLayerGeometry.OuterLoop)));
 }