Ejemplo n.º 1
0
 /// <summary>
 /// Creates a new defaulted profile layer with the given ProfileCell as owner
 /// </summary>
 public ProfileLayer(ProfileCell owner)
 {
     Owner = owner;
     Clear();
 }
Ejemplo n.º 2
0
        InitialiseFilterContext(ISiteModel siteModel, ICellPassAttributeFilter passFilter,
                                ICellPassAttributeFilterProcessingAnnex passFilterAnnex, ProfileCell profileCell, IDesignWrapper passFilterElevRangeDesign)
        {
            (bool executionResult, DesignProfilerRequestResult filterDesignErrorCode)result = (false, DesignProfilerRequestResult.UnknownError);

            // If the elevation range filter uses a design then the design elevations
            // for the sub grid need to be calculated and supplied to the filter

            if (passFilter.HasElevationRangeFilter && passFilterElevRangeDesign != null)
            {
                var getDesignHeightsResult = passFilterElevRangeDesign.Design.GetDesignHeightsViaLocalCompute(siteModel, passFilterElevRangeDesign.Offset, new SubGridCellAddress(profileCell.OTGCellX, profileCell.OTGCellY), siteModel.CellSize);

                result.filterDesignErrorCode = getDesignHeightsResult.errorCode;

                if (result.filterDesignErrorCode != DesignProfilerRequestResult.OK || getDesignHeightsResult.designHeights == null)
                {
                    if (result.filterDesignErrorCode == DesignProfilerRequestResult.NoElevationsInRequestedPatch)
                    {
                        _log.LogInformation(
                            "Lift filter by design. Call to RequestDesignElevationPatch failed due to no elevations in requested patch.");
                    }
                    else
                    {
                        _log.LogWarning(
                            $"Lift filter by design. Call to RequestDesignElevationPatch failed due to no TDesignProfilerRequestResult return code {result.filterDesignErrorCode}.");
                    }
                    return(result);
                }

                passFilterAnnex.InitializeElevationRangeFilter(passFilter, getDesignHeightsResult.designHeights.Cells);
            }

            result.executionResult = true;
            return(result);
        }