private static SoilLayer2D CreateSoilLayer2D(SoilLayer2DGeometry soilLayerGeometry, LayerProperties layerProperties, IEnumerable <SoilLayer2D> nestedLayers) { var soilLayer = new SoilLayer2D(soilLayerGeometry.OuterLoop, nestedLayers); SoilLayerHelper.SetSoilLayerBaseProperties(soilLayer, layerProperties); return(soilLayer); }
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)); }
private static bool IsNestedLayer(IEnumerable <SoilLayer2DLoop> innerLoops, SoilLayer2DGeometry soilLayerGeometry) { return(innerLoops.Any(il => il.Equals(soilLayerGeometry.OuterLoop))); }