Beispiel #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="startDate">The date at which to start calculating progressive sub grids</param>
 /// <param name="endDate">The date beyond which no further progressive sub grids will be calculated</param>
 /// <param name="interval">The time interval between successive calculations of progressive sub grids</param>
 public ComputeProgressiveVolumes_Coordinator(Guid siteModelId,
                                              ILiftParameters liftParams,
                                              VolumeComputationType volumeType,
                                              ICombinedFilter filter,
                                              DesignOffset baseDesign,
                                              DesignOffset topDesign,
                                              ICombinedFilter additionalSpatialFilter,
                                              double cutTolerance,
                                              double fillTolerance,
                                              DateTime startDate,
                                              DateTime endDate,
                                              TimeSpan interval)
 {
     SiteModelID             = siteModelId;
     VolumeType              = volumeType;
     Filter                  = filter;
     _baseDesign             = baseDesign;
     _topDesign              = topDesign;
     AdditionalSpatialFilter = additionalSpatialFilter;
     CutTolerance            = cutTolerance;
     FillTolerance           = fillTolerance;
     _liftParams             = liftParams;
     StartDate               = startDate;
     EndDate                 = endDate;
     Interval                = interval;
 }
Beispiel #2
0
        /// <summary>
        /// Calculates the a set of lift build setting flags from the required data type and other lift build settings
        /// </summary>
        public static void CalculateFlags(GridDataType ProfileTypeRequired,
                                          ILiftParameters liftParams,
                                          out bool compactionSummaryInLiftBuildSettings,
                                          out bool workInProgressSummaryInLiftBuildSettings,
                                          out bool thicknessInProgressInLiftBuildSettings)
        {
            if (ProfileTypeRequired == GridDataType.All || ProfileTypeRequired == GridDataType.CCV ||
                ProfileTypeRequired == GridDataType.CCVPercent)
            {
                compactionSummaryInLiftBuildSettings     = liftParams.CCVSummaryTypes != CCVSummaryTypes.None;
                workInProgressSummaryInLiftBuildSettings = compactionSummaryInLiftBuildSettings;
                thicknessInProgressInLiftBuildSettings   = compactionSummaryInLiftBuildSettings;
            }
            else if (ProfileTypeRequired == GridDataType.All || ProfileTypeRequired == GridDataType.MDP ||
                     ProfileTypeRequired == GridDataType.MDPPercent)
            {
                compactionSummaryInLiftBuildSettings     = liftParams.MDPSummaryTypes != MDPSummaryTypes.None;
                workInProgressSummaryInLiftBuildSettings = compactionSummaryInLiftBuildSettings;
                thicknessInProgressInLiftBuildSettings   = compactionSummaryInLiftBuildSettings;
            }

            if (ProfileTypeRequired == GridDataType.All || ProfileTypeRequired == GridDataType.CCA ||
                ProfileTypeRequired == GridDataType.CCAPercent)
            {
                compactionSummaryInLiftBuildSettings     = true;
                workInProgressSummaryInLiftBuildSettings = compactionSummaryInLiftBuildSettings;
                thicknessInProgressInLiftBuildSettings   = compactionSummaryInLiftBuildSettings;
            }
            else
            {
                compactionSummaryInLiftBuildSettings     = false;
                workInProgressSummaryInLiftBuildSettings = false;
                thicknessInProgressInLiftBuildSettings   = false;
            }
        }
Beispiel #3
0
 /// <summary>
 /// Constructor for the renderer
 /// </summary>
 public RenderOverlayTile(Guid dataModelId,
                          //AExternalDescriptor :TASNodeRequestDescriptor;
                          DisplayMode mode,
                          XYZ blPoint,
                          XYZ trPoint,
                          bool coordsAreGrid,
                          ushort nPixelsX,
                          ushort nPixelsY,
                          IFilterSet filters,
                          DesignOffset cutFillDesign,
                          IPlanViewPalette aColorPalettes,
                          Color representColor,
                          Guid requestingTRexNodeId,
                          ILiftParameters liftParams,
                          VolumeComputationType volumeType
                          )
 {
     DataModelID = dataModelId;
     // ExternalDescriptor = AExternalDescriptor
     Mode                 = mode;
     BLPoint              = blPoint;
     TRPoint              = trPoint;
     CoordsAreGrid        = coordsAreGrid;
     NPixelsX             = nPixelsX;
     NPixelsY             = nPixelsY;
     Filters              = filters;
     CutFillDesign        = cutFillDesign;
     ColorPalettes        = aColorPalettes;
     RepresentColor       = representColor;
     RequestingTRexNodeID = requestingTRexNodeId;
     LiftParams           = liftParams;
     VolumeType           = volumeType;
 }
Beispiel #4
0
        /// <summary>
        /// Constructs the context of a pipelined processor based on the project, filters and other common criteria
        /// of pipelined requests
        /// </summary>
        /// <param name="overrideSpatialCellRestriction">A restriction on the cells that are returned via the query that intersects with the spatial selection filtering and criteria</param>
        public IPipelineProcessor NewInstance <TSubGridsRequestArgument>(Guid requestDescriptor,
                                                                         Guid dataModelID,
                                                                         GridDataType gridDataType,
                                                                         ISubGridsPipelinedReponseBase response,
                                                                         IFilterSet filters,
                                                                         DesignOffset cutFillDesign,
                                                                         ITRexTask task,
                                                                         ISubGridPipelineBase pipeline,
                                                                         IRequestAnalyser requestAnalyser,
                                                                         bool requireSurveyedSurfaceInformation,
                                                                         bool requestRequiresAccessToDesignFileExistenceMap,
                                                                         BoundingIntegerExtent2D overrideSpatialCellRestriction,
                                                                         ILiftParameters liftParams)
        {
            var pipelineProcessor = NewInstanceNoBuild <TSubGridsRequestArgument>
                                        (requestDescriptor, dataModelID, gridDataType, response, filters, cutFillDesign,
                                        task, pipeline, requestAnalyser, requireSurveyedSurfaceInformation, requestRequiresAccessToDesignFileExistenceMap,
                                        overrideSpatialCellRestriction, liftParams);

            if (!pipelineProcessor.Build())
            {
                Log.LogError($"Failed to build pipeline processor for request to model {dataModelID}");
                pipelineProcessor = null;
            }

            return(pipelineProcessor as IPipelineProcessor);
        }
Beispiel #5
0
        /// <summary>
        /// Constructs the context of a pipelined processor based on the project, filters and other common criteria
        /// of pipelined requests
        /// </summary>
        /// <param name="requestDescriptor"></param>
        /// <param name="dataModelID"></param>
        /// <param name="gridDataType"></param>
        /// <param name="response"></param>
        /// <param name="filters"></param>
        /// <param name="cutFillDesign"></param>
        /// <param name="task"></param>
        /// <param name="pipeline"></param>
        /// <param name="requestAnalyser"></param>
        /// <param name="requireSurveyedSurfaceInformation"></param>
        /// <param name="requestRequiresAccessToDesignFileExistenceMap"></param>
        /// <param name="overrideSpatialCellRestriction">A restriction on the cells that are returned via the query that intersects with the spatial selection filtering and criteria</param>
        /// <param name="liftParams"></param>
        public PipelineProcessor(Guid requestDescriptor,
                                 Guid dataModelID,
                                 GridDataType gridDataType,
                                 ISubGridsPipelinedReponseBase response,
                                 IFilterSet filters,
                                 DesignOffset cutFillDesign,
                                 ITRexTask task,
                                 ISubGridPipelineBase pipeline,
                                 IRequestAnalyser requestAnalyser,
                                 bool requireSurveyedSurfaceInformation,
                                 bool requestRequiresAccessToDesignFileExistenceMap,
                                 BoundingIntegerExtent2D overrideSpatialCellRestriction,
                                 ILiftParameters liftParams)
        {
            RequestDescriptor = requestDescriptor;
            DataModelID       = dataModelID;
            GridDataType      = gridDataType;
            Response          = response;
            Filters           = filters;
            CutFillDesign     = cutFillDesign;
            Task = task;

            Pipeline = pipeline;

            RequestAnalyser = requestAnalyser;

            RequireSurveyedSurfaceInformation             = requireSurveyedSurfaceInformation;
            RequestRequiresAccessToDesignFileExistenceMap = requestRequiresAccessToDesignFileExistenceMap;

            OverrideSpatialCellRestriction = overrideSpatialCellRestriction;
            LiftParams = liftParams;
        }
Beispiel #6
0
        /// <summary>
        /// Constructor for the sub grid retriever helper
        /// </summary>
        /// <param name="siteModel">The project this sub gris is being retrieved from</param>
        /// <param name="gridDataType">The type of client grid data sub grids to be returned by this retriever</param>
        /// <param name="storageProxy">The Ignite storage proxy to be used when requesting data from the persistent store</param>
        /// <param name="filter">The TRex spatial and attribute filtering description for the request</param>
        /// <param name="filterAnnex">An annex of data related to cell by cell filtering where the attributes related to that cell may change from cell to cell</param>
        /// <param name="hasOverrideSpatialCellRestriction">The spatially selected cells are masked by a rectangular restriction boundary</param>
        /// <param name="overrideSpatialCellRestriction"></param>
        /// <param name="prepareGridForCacheStorageIfNoSieving">The cell coordinate bounding box restricting cells involved in the request</param>
        /// <param name="maxNumberOfPassesToReturn">The maximum number of passes in a cell in a sub grid that will be considered when processing the request</param>
        /// <param name="areaControlSet">The skip/step area control set for selection of cells with sub grids for processing. Cells not identified by the control set will return null values.</param>
        /// <param name="populationControl">The delegate responsible for populating events depended on for processing the request.</param>
        /// <param name="pDExistenceMap">The production data existence map for the project the request relates to</param>
        /// <param name="overrides">The set of overriding machine event values to use</param>
        /// <param name="liftParams">The set of layer/lift analysis parameters to use</param>
        public ProgressiveVolumesSubGridRetriever(ISiteModel siteModel,
                                                  GridDataType gridDataType,
                                                  IStorageProxy storageProxy,
                                                  ICombinedFilter filter,
                                                  ICellPassAttributeFilterProcessingAnnex filterAnnex,
                                                  bool hasOverrideSpatialCellRestriction,
                                                  BoundingIntegerExtent2D overrideSpatialCellRestriction,
                                                  bool prepareGridForCacheStorageIfNoSieving,
                                                  int maxNumberOfPassesToReturn,
                                                  AreaControlSet areaControlSet,
                                                  IFilteredValuePopulationControl populationControl,
                                                  ISubGridTreeBitMask pDExistenceMap,
                                                  IOverrideParameters overrides,
                                                  ILiftParameters liftParams)
            : base(siteModel, gridDataType, filter, filterAnnex,
                   hasOverrideSpatialCellRestriction, overrideSpatialCellRestriction, prepareGridForCacheStorageIfNoSieving, maxNumberOfPassesToReturn,
                   storageProxy, areaControlSet, populationControl, pDExistenceMap, overrides, liftParams)
        {
            // Clear any time element from the supplied filter. Time constraints ar derived from the startDate and endDate parameters
            filter.AttributeFilter.HasTimeFilter = false;

            // Clear any instruction in the filter to extract the earliest value - this has no meaning in progressive calculations
            filter.AttributeFilter.ReturnEarliestFilteredCellPass = false;

            // Remove any first/last/highest/lowest aspect from the filter - this has no meaning in progressive calculations
            filter.AttributeFilter.HasElevationTypeFilter = false;

            // Remove any machine filtering - the intent here is to examine volume progression over time, machine breakdowns don't make sense at this point
            filter.AttributeFilter.HasMachineFilter = false;
        }
Beispiel #7
0
        /// <summary>
        /// Constructs a cell profile analyzer that analyzes cells in a cell profile vector
        /// </summary>
        /// <param name="siteModel"></param>
        /// <param name="pDExistenceMap"></param>
        /// <param name="filterSet"></param>
        /// <param name="cellLiftBuilder"></param>
        /// <param name="overrides"></param>
        public CellProfileAnalyzer(ISiteModel siteModel,
                                   ISubGridTreeBitMask pDExistenceMap,
                                   IFilterSet filterSet,
                                   ICellLiftBuilder cellLiftBuilder,
                                   IOverrideParameters overrides,
                                   ILiftParameters liftParams)
            : base(siteModel, pDExistenceMap, filterSet, overrides, liftParams)
        {
            CellLiftBuilder = cellLiftBuilder;

            PassFilter = filterSet.Filters[0].AttributeFilter;
            if (PassFilter.HasElevationRangeFilter && PassFilter.ElevationRangeDesign.DesignID != Guid.Empty)
            {
                var design = siteModel.Designs.Locate(PassFilter.ElevationRangeDesign.DesignID);
                if (design == null)
                {
                    Log.LogError($"ElevationRangeDesign {PassFilter.ElevationRangeDesign.DesignID} is unknown in project {siteModel.ID}");
                }
                else
                {
                    PassFilterElevationRangeDesign = new DesignWrapper(PassFilter.ElevationRangeDesign, design);
                }
            }
            PassFilterAnnex = new CellPassAttributeFilterProcessingAnnex();
            CellFilter      = filterSet.Filters[0].SpatialFilter;
        }
Beispiel #8
0
 /// <summary>
 /// Constructs a profile lift builder that analyzes cells in a cell profile vector
 /// </summary>
 public SummaryVolumesCellProfileAnalyzer(ISiteModel siteModel,
                                          ISubGridTreeBitMask pDExistenceMap,
                                          IFilterSet filterSet,
                                          IDesignWrapper referenceDesignWrapper,
                                          ICellLiftBuilder cellLiftBuilder,
                                          VolumeComputationType volumeType,
                                          IOverrideParameters overrides,
                                          ILiftParameters liftParams)
     : base(siteModel, pDExistenceMap, filterSet, overrides, liftParams)
 {
     svDesignWrapper = referenceDesignWrapper;
     VolumeType      = volumeType;
 }
Beispiel #9
0
 /// <summary>
 /// Constructor for the renderer accepting all parameters necessary for its operation
 /// </summary>
 public TINSurfaceExportExecutor(
     Guid dataModelId,
     IFilterSet filters,
     double tolerance,
     Guid requestingTRexNodeId,
     ILiftParameters liftParams
     )
 {
     _dataModelId         = dataModelId;
     _filters             = filters;
     _tolerance           = tolerance;
     RequestingTRexNodeID = requestingTRexNodeId;
     _liftParams          = liftParams;
 }
Beispiel #10
0
        /// <summary>
        /// Constructs a profile lift builder that analyzes cells in a cell profile vector
        /// </summary>
        public CellProfileAnalyzerBase(ISiteModel siteModel,
                                       ISubGridTreeBitMask pDExistenceMap,
                                       IFilterSet filterSet,
                                       IOverrideParameters overrides,
                                       ILiftParameters liftParams)
        {
            SiteModel      = siteModel;
            PDExistenceMap = pDExistenceMap;
            FilterSet      = filterSet;
            Overrides      = overrides;
            LiftParams     = liftParams;

            Initialise();
        }
Beispiel #11
0
 /// <summary>
 /// Constructs the profile analysis executor
 /// </summary>
 public ComputeProfileExecutor_ClusterCompute(ProfileStyle profileStyle, Guid projectID, GridDataType profileTypeRequired, XYZ[] nEECoords, IFilterSet filters,
                                              // externalRequestDescriptor: TASNodeRequestDescriptor;
                                              DesignOffset design, bool returnAllPassesAndLayers, VolumeComputationType volumeType, IOverrideParameters overrides, ILiftParameters liftParams)
 {
     ProfileStyle        = profileStyle;
     ProjectID           = projectID;
     ProfileTypeRequired = profileTypeRequired;
     NEECoords           = nEECoords;
     Filters             = filters;
     Design     = design;
     VolumeType = volumeType;
     Overrides  = overrides;
     LiftParams = liftParams;
 }
Beispiel #12
0
        /// <summary>
        /// Prepares the set of event population control flags depending on the requested data type and filter
        /// </summary>
        /// <param name="profileTypeRequired"></param>
        /// <param name="passFilter"></param>
        public void PreparePopulationControl(GridDataType profileTypeRequired,
                                             ILiftParameters liftParams,
                                             ICellPassAttributeFilter passFilter)
        {
            CalculateFlags(profileTypeRequired, liftParams,
                           out bool compactionSummaryInLiftBuildSettings, out bool workInProgressSummaryInLiftBuildSettings,
                           out bool thicknessInProgressInLiftBuildSettings);

            Clear();

            WantsTargetPassCountValues = profileTypeRequired == GridDataType.All;

            WantsTempWarningLevelMinValues = profileTypeRequired == GridDataType.All;
            WantsTempWarningLevelMaxValues = profileTypeRequired == GridDataType.All;

            WantsEventMachineGearValues = passFilter.HasMachineDirectionFilter;
            WantsEventMapResetValues    = liftParams.LiftDetectionType == LiftDetectionType.MapReset ||
                                          liftParams.LiftDetectionType == LiftDetectionType.AutoMapReset;
            WantsEventDesignNameValues = passFilter.HasDesignFilter || WantsEventMapResetValues;

            WantsTargetCCVValues = compactionSummaryInLiftBuildSettings || workInProgressSummaryInLiftBuildSettings;
            WantsTargetMDPValues = compactionSummaryInLiftBuildSettings || workInProgressSummaryInLiftBuildSettings;
            WantsTargetCCAValues = compactionSummaryInLiftBuildSettings || workInProgressSummaryInLiftBuildSettings;

            WantsTargetLiftThicknessValues = workInProgressSummaryInLiftBuildSettings ||
                                             thicknessInProgressInLiftBuildSettings ||
                                             liftParams.LiftDetectionType == LiftDetectionType.Automatic ||
                                             liftParams.LiftDetectionType == LiftDetectionType.AutoMapReset;

            WantsEventVibrationStateValues = passFilter.HasVibeStateFilter ||
                                             (profileTypeRequired == GridDataType.All ||
                                              profileTypeRequired == GridDataType.CCV ||
                                              profileTypeRequired == GridDataType.CCVPercent ||
                                              profileTypeRequired == GridDataType.RMV ||
                                              profileTypeRequired == GridDataType.Frequency ||
                                              profileTypeRequired == GridDataType.Amplitude);

            WantsEventElevationMappingModeValues = passFilter.HasElevationMappingModeFilter;
            WantsEventInAvoidZoneStateValues     = false; // todo passFilter.HasAvoidZoneStateFilter;
            WantsEventGPSAccuracyValues          = passFilter.HasGPSAccuracyFilter || passFilter.HasGPSToleranceFilter;
            WantsEventPositioningTechValues      = passFilter.HasPositioningTechFilter;
            WantsEventMachineAutomaticsValues    = passFilter.HasGCSGuidanceModeFilter;
            WantsLayerIDValues = profileTypeRequired == GridDataType.CellProfile ||
                                 profileTypeRequired == GridDataType.CellPasses ||
                                 passFilter.HasLayerIDFilter ||
                                 liftParams.LiftDetectionType == LiftDetectionType.Tagfile ||
                                 liftParams.LiftDetectionType == LiftDetectionType.MapReset ||
                                 liftParams.LiftDetectionType == LiftDetectionType.AutoMapReset;
        }
Beispiel #13
0
 /// <summary>
 /// Constructs the context of a pipelined processor based on the project, filters and other common criteria
 /// of pipelined requests, but does not perform the build action on the pipeline processor
 /// </summary>
 /// <param name="overrideSpatialCellRestriction">A restriction on the cells that are returned via the query that intersects with the spatial selection filtering and criteria</param>
 public IPipelineProcessor NewInstanceNoBuild <TSubGridsRequestArgument>(Guid requestDescriptor,
                                                                         Guid dataModelID,
                                                                         GridDataType gridDataType,
                                                                         ISubGridsPipelinedReponseBase response,
                                                                         IFilterSet filters,
                                                                         DesignOffset cutFillDesign,
                                                                         ITRexTask task,
                                                                         ISubGridPipelineBase pipeline,
                                                                         IRequestAnalyser requestAnalyser,
                                                                         bool requireSurveyedSurfaceInformation,
                                                                         bool requestRequiresAccessToDesignFileExistenceMap,
                                                                         BoundingIntegerExtent2D overrideSpatialCellRestriction,
                                                                         ILiftParameters liftParams)
 {
     return(new PipelineProcessor <TSubGridsRequestArgument>
                (requestDescriptor, dataModelID, gridDataType, response, filters, cutFillDesign,
                task, pipeline, requestAnalyser, requireSurveyedSurfaceInformation, requestRequiresAccessToDesignFileExistenceMap,
                overrideSpatialCellRestriction, liftParams) as IPipelineProcessor);
 }
Beispiel #14
0
 /// <summary>
 /// Constructor for the sub grid retriever helper
 /// </summary>
 /// <param name="siteModel">The project this sub gris is being retrieved from</param>
 /// <param name="gridDataType">The type of client grid data sub grids to be returned by this retriever</param>
 /// <param name="storageProxy">The Ignite storage proxy to be used when requesting data from the persistent store</param>
 /// <param name="filter">The TRex spatial and attribute filtering description for the request</param>
 /// <param name="filterAnnex">An annex of data related to cell by cell filtering where the attributes related to that cell may change from cell to cell</param>
 /// <param name="hasOverrideSpatialCellRestriction">The spatially selected cells are masked by a rectangular restriction boundary</param>
 /// <param name="overrideSpatialCellRestriction"></param>
 /// <param name="prepareGridForCacheStorageIfNoSieving">The cell coordinate bounding box restricting cells involved in the request</param>
 /// <param name="maxNumberOfPassesToReturn">The maximum number of passes in a cell in a sub grid that will be considered when processing the request</param>
 /// <param name="areaControlSet">The skip/step area control set for selection of cells with sub grids for processing. Cells not identified by the control set will return null values.</param>
 /// <param name="populationControl">The delegate responsible for populating events depended on for processing the request.</param>
 /// <param name="pDExistenceMap">The production data existence map for the project the request relates to</param>
 /// <param name="overrides">The set of overriding machine event values to use</param>
 /// <param name="liftParams">The set of layer/lift analysis parameters to use</param>
 public SubGridRetriever(ISiteModel siteModel,
                         GridDataType gridDataType,
                         IStorageProxy storageProxy,
                         ICombinedFilter filter,
                         ICellPassAttributeFilterProcessingAnnex filterAnnex,
                         bool hasOverrideSpatialCellRestriction,
                         BoundingIntegerExtent2D overrideSpatialCellRestriction,
                         bool prepareGridForCacheStorageIfNoSieving,
                         int maxNumberOfPassesToReturn,
                         AreaControlSet areaControlSet,
                         IFilteredValuePopulationControl populationControl,
                         ISubGridTreeBitMask pDExistenceMap,
                         IOverrideParameters overrides,
                         ILiftParameters liftParams)
     : base(siteModel, gridDataType, filter, filterAnnex,
            hasOverrideSpatialCellRestriction, overrideSpatialCellRestriction, prepareGridForCacheStorageIfNoSieving, maxNumberOfPassesToReturn,
            storageProxy, areaControlSet, populationControl, pDExistenceMap, overrides, liftParams)
 {
 }
Beispiel #15
0
        protected SubGridRetrieverBase(ISiteModel siteModel,
                                       GridDataType gridDataType,
                                       ICombinedFilter filter,
                                       ICellPassAttributeFilterProcessingAnnex filterAnnex,
                                       bool hasOverrideSpatialCellRestriction,
                                       BoundingIntegerExtent2D overrideSpatialCellRestriction,
                                       bool prepareGridForCacheStorageIfNoSieving,
                                       int maxNumberOfPassesToReturn,
                                       IStorageProxy storageProxy,
                                       AreaControlSet areaControlSet,
                                       IFilteredValuePopulationControl populationControl,
                                       ISubGridTreeBitMask pDExistenceMap,
                                       IOverrideParameters overrides,
                                       ILiftParameters liftParams)
        {
            _segmentIterator  = null;
            _cellPassIterator = null;

            _siteModel    = siteModel;
            _gridDataType = gridDataType;
            _filter       = filter;
            _filterAnnex  = filterAnnex;
            _hasOverrideSpatialCellRestriction     = hasOverrideSpatialCellRestriction;
            _overrideSpatialCellRestriction        = overrideSpatialCellRestriction;
            _prepareGridForCacheStorageIfNoSieving = prepareGridForCacheStorageIfNoSieving;
            _maxNumberOfPassesToReturn             = maxNumberOfPassesToReturn;
            _storageProxy      = storageProxy;
            _populationControl = populationControl;
            _areaControlSet    = areaControlSet;
            _pdExistenceMap    = pDExistenceMap;
            _overrides         = overrides;
            _liftParams        = liftParams;

            // Create and configure the assignment context which is used to contain a filtered pass and
            // its attendant machine events and target values prior to assignment to the client sub grid.
            _assignmentContext = new FilteredValueAssignmentContext {
                Overrides = overrides, LiftParams = liftParams
            };

            _filter.AttributeFilter.SiteModel = siteModel;

            _canUseGlobalLatestCells = _filter.AttributeFilter.LastRecordedCellPassSatisfiesFilter;
        }
Beispiel #16
0
        /// <summary>
        /// Configures a new profile builder that provides the three core builders used in profiling: construction of cell vector from profile line,
        /// profile analysis orchestration and per cell layer/statistics calculation
        /// </summary>
        public void Configure(ProfileStyle profileStyle,
                              ISiteModel siteModel,
                              ISubGridTreeBitMask productionDataExistenceMap,
                              GridDataType gridDataType,
                              IFilterSet filterSet,
                              IDesignWrapper referenceDesignWrapper,
                              IFilteredValuePopulationControl PopulationControl,
                              ICellPassFastEventLookerUpper CellPassFastEventLookerUpper,
                              VolumeComputationType volumeType,
                              IOverrideParameters overrides,
                              ILiftParameters liftParams,
                              bool slicerToolUsed = true)
        {
            CellLiftBuilder = factory.NewCellLiftBuilder(siteModel, gridDataType, PopulationControl, filterSet, CellPassFastEventLookerUpper);

            CellProfileBuilder = factory.NewCellProfileBuilder(siteModel, filterSet, referenceDesignWrapper, slicerToolUsed);

            CellProfileAnalyzer = factory.NewCellProfileAnalyzer(
                profileStyle, siteModel, productionDataExistenceMap, filterSet,
                referenceDesignWrapper, CellLiftBuilder, volumeType, overrides, liftParams);
        }
Beispiel #17
0
 public CellDatumRequestArgument_ClusterCompute(
     Guid siteModelID,
     DisplayMode mode,
     XYZ neeCoords,
     int otgCellX,
     int otgCellY,
     IFilterSet filters,
     DesignOffset referenceDesign,
     IOverrideParameters overrides,
     ILiftParameters liftParams)
 {
     ProjectID       = siteModelID;
     Mode            = mode;
     NEECoords       = neeCoords;
     OTGCellX        = otgCellX;
     OTGCellY        = otgCellY;
     Filters         = filters;
     ReferenceDesign = referenceDesign;
     Overrides       = overrides;
     LiftParams      = liftParams;
 }
Beispiel #18
0
 /// <summary>
 /// Constructor
 /// </summary>
 public ComputeSimpleVolumes_Coordinator(Guid siteModelID,
                                         ILiftParameters liftParams,
                                         VolumeComputationType volumeType,
                                         ICombinedFilter baseFilter,
                                         ICombinedFilter topFilter,
                                         DesignOffset baseDesign,
                                         DesignOffset topDesign,
                                         ICombinedFilter additionalSpatialFilter,
                                         double cutTolerance,
                                         double fillTolerance)
 {
     SiteModelID             = siteModelID;
     VolumeType              = volumeType;
     BaseFilter              = baseFilter;
     TopFilter               = topFilter;
     BaseDesign              = baseDesign;
     TopDesign               = topDesign;
     AdditionalSpatialFilter = additionalSpatialFilter;
     CutTolerance            = cutTolerance;
     FillTolerance           = fillTolerance;
     LiftParams              = liftParams;
 }
Beispiel #19
0
 /// <summary>
 /// Constructor for the renderer accepting all parameters necessary for its operation
 /// </summary>
 public PatchExecutor(
     Guid dataModelID,
     //AExternalDescriptor :TASNodeRequestDescriptor;
     DisplayMode mode,
     IFilterSet filters,
     DesignOffset cutFillDesign,
     Guid requestingTRexNodeId,
     int dataPatchPageNumber,
     int dataPatchPageSize,
     ILiftParameters liftParams
     )
 {
     DataModelID = dataModelID;
     // ExternalDescriptor = AExternalDescriptor
     Mode                 = mode;
     Filters              = filters;
     CutFillDesign        = cutFillDesign;
     RequestingTRexNodeID = requestingTRexNodeId;
     DataPatchPageNumber  = dataPatchPageNumber;
     DataPatchPageSize    = dataPatchPageSize;
     LiftParams           = liftParams;
 }
Beispiel #20
0
        /// <summary>
        /// Creates a new builder responsible for analyzing profile information for a cell or cells identified along a profile line
        /// </summary>
        public ICellProfileAnalyzer <T> NewCellProfileAnalyzer(ProfileStyle profileStyle,
                                                               ISiteModel siteModel,
                                                               ISubGridTreeBitMask pDExistenceMap,
                                                               IFilterSet filterSet,
                                                               IDesignWrapper referenceDesignWrapper,
                                                               ICellLiftBuilder cellLiftBuilder,
                                                               VolumeComputationType volumeComputationType,
                                                               IOverrideParameters overrides,
                                                               ILiftParameters liftParams)
        {
            switch (profileStyle)
            {
            case ProfileStyle.CellPasses:
                return(DIContext.Obtain <Func <ISiteModel, ISubGridTreeBitMask, IFilterSet, ICellLiftBuilder, IOverrideParameters, ILiftParameters, ICellProfileAnalyzer <T> > >()
                           (siteModel, pDExistenceMap, filterSet, cellLiftBuilder, overrides, liftParams));

            case ProfileStyle.SummaryVolume:
                return(DIContext.Obtain <Func <ISiteModel, ISubGridTreeBitMask, IFilterSet, IDesignWrapper, ICellLiftBuilder, VolumeComputationType, IOverrideParameters, ILiftParameters, ICellProfileAnalyzer <T> > >()
                           (siteModel, pDExistenceMap, filterSet, referenceDesignWrapper, cellLiftBuilder, volumeComputationType, overrides, liftParams));

            default:
                throw new ArgumentOutOfRangeException(nameof(profileStyle), profileStyle, null);
            }
        }
Beispiel #21
0
        public override void InternalFromBinary(IBinaryRawReader reader)
        {
            base.InternalFromBinary(reader);

            var version = VersionSerializationHelper.CheckVersionByte(reader, VERSION_NUMBER);

            if (version == 1)
            {
                TRexNodeID = reader.ReadGuid() ?? Guid.Empty;
                ProjectID  = reader.ReadGuid() ?? Guid.Empty;

                if (reader.ReadBoolean())
                {
                    ReferenceDesign = new DesignOffset();
                    ReferenceDesign.FromBinary(reader);
                }

                if (reader.ReadBoolean())
                {
                    Filters = DI.DIContext.ObtainRequired <IFilterSet>();
                    Filters.FromBinary(reader);
                }

                if (reader.ReadBoolean())
                {
                    Overrides = new OverrideParameters();
                    Overrides.FromBinary(reader);
                }

                if (reader.ReadBoolean())
                {
                    LiftParams = new LiftParameters();
                    LiftParams.FromBinary(reader);
                }
            }
        }
Beispiel #22
0
        /// <summary>
        /// Perform rendering activities to produce a bitmap tile
        /// </summary>
        public RequestErrorStatus PerformRender(DisplayMode mode, IPipelineProcessor processor, IPlanViewPalette colourPalette, IFilterSet filters, ILiftParameters liftParams)
        {
            // Obtain the display responsible for rendering the thematic information for this mode
            Displayer = PVMDisplayerFactory.GetDisplayer(mode /*, FICOptions*/);

            if (Displayer == null)
            {
                processor.Response.ResultStatus = RequestErrorStatus.UnsupportedDisplayType;
                return(processor.Response.ResultStatus);
            }

            // Create and assign the colour palette logic for this mode to the displayer
            if (colourPalette == null)
            {
                if (mode == DisplayMode.CCA || mode == DisplayMode.CCASummary)
                {
                    Displayer.SetPalette(Utilities.ComputeCCAPalette(processor.SiteModel, filters.Filters[0].AttributeFilter, mode));

                    if (Displayer.GetPalette() == null)
                    {
                        processor.Response.ResultStatus = RequestErrorStatus.FailedToGetCCAMinimumPassesValue;
                        return(processor.Response.ResultStatus);
                    }
                }
                else
                {
                    Displayer.SetPalette(PVMPaletteFactory.GetPalette(processor.SiteModel, mode, processor.SpatialExtents));
                }
            }
            else
            {
                Displayer.SetPalette(colourPalette);
            }

            // Create the world coordinate display surface the displayer will render onto
            Displayer.MapView = new MapSurface
            {
                SquareAspect = IsWhollyInTermsOfGridProjection
            };

            var view = Displayer.MapView;

            // Set the world coordinate bounds of the display surface to be rendered on
            view.SetBounds(NPixelsX, NPixelsY);

            if (IsWhollyInTermsOfGridProjection)
            {
                view.FitAndSetWorldBounds(OriginX, OriginY, OriginX + Width, OriginY + Height, 0);
            }
            else
            {
                view.SetWorldBounds(OriginX, OriginY, OriginX + Width, OriginY + Height, 0);
            }

            // Provide data smoothing support to the displayer for the rendering operation being performed
            ((IProductionPVMConsistentDisplayer)Displayer).DataSmoother = DIContext.Obtain <Func <DisplayMode, IDataSmoother> >()(mode);

            // Set the rotation of the displayer rendering surface to match the tile rotation due to the project calibration rotation
            view.SetRotation(TileRotation);

            ConstructPVMTaskAccumulator(processor);

            // Displayer.ICOptions  = ICOptions;

            // Set the skip-step area control cell selection parameters for this tile render. Note that the floating point
            // skip step algorithm is requested, and a user origin is configured that offsets the sampling grid by half a pixel
            // size to matching the skip-stepping the PVM accumulator will use when transcribing cell data from sub grids into
            // the accumulator. Note that the area control set is not configured with a rotation - this is taken into account
            // through the mapview rotation configured above
            processor.Pipeline.AreaControlSet = new AreaControlSet(false,
                                                                   view.XPixelSize, view.YPixelSize,
                                                                   view.XPixelSize / 2.0, view.YPixelSize / 2.0,
                                                                   0.0);

            processor.Pipeline.LiftParams = liftParams;
            // todo PipeLine.NoChangeVolumeTolerance  = FICOptions.NoChangeVolumeTolerance;

            // Perform the sub grid query and processing to render the tile
            var pipelineProcessorStopWatch = Stopwatch.StartNew();

            processor.Process();
            _log.LogInformation($"Pipeline processor completed in {pipelineProcessorStopWatch.Elapsed}");

            if (processor.Response.ResultStatus == RequestErrorStatus.OK)
            {
                // Render the collection of data in the aggregator
                var consistentRenderStopWatch = Stopwatch.StartNew();
                (Displayer as IProductionPVMConsistentDisplayer)?.PerformConsistentRender();
                _log.LogInformation($"Consistent render complated in {consistentRenderStopWatch.Elapsed}");

                PerformAnyRequiredDebugLevelDisplay();

                if (DebugDrawDiagonalCrossOnRenderedTilesDefault)
                {
                    // Draw diagonal cross and top left corner indicators
                    view.DrawLine(view.OriginX, view.OriginY, view.LimitX, view.LimitY, Color.Red);
                    view.DrawLine(view.OriginX, view.LimitY, view.LimitX, view.OriginY, Color.Red);

                    // Draw the horizontal line a little below the world coordinate 'top' of the tile to encourage the line
                    // drawing algorithm not to clip it
                    view.DrawLine(view.OriginX, view.LimitY, view.OriginX, view.CenterY, Color.Red);
                    view.DrawLine(view.OriginX, view.LimitY - 0.01, view.CenterX, view.LimitY - 0.01, Color.Red);
                }
            }

            return(processor.Response.ResultStatus);
        }
Beispiel #23
0
        public ISubGridRetriever Instance(ISubGridsRequestArgument subGridsRequestArgument,
                                          ISiteModel siteModel,
                                          GridDataType gridDataType,
                                          IStorageProxy storageProxy,
                                          ICombinedFilter filter,
                                          ICellPassAttributeFilterProcessingAnnex filterAnnex,
                                          bool hasOverrideSpatialCellRestriction,
                                          BoundingIntegerExtent2D overrideSpatialCellRestriction,
                                          int maxNumberOfPassesToReturn,
                                          AreaControlSet areaControlSet,
                                          IFilteredValuePopulationControl populationControl,
                                          ISubGridTreeBitMask pdExistenceMap,
                                          ITRexSpatialMemoryCacheContext[] subGridCacheContexts,
                                          IOverrideParameters overrides,
                                          ILiftParameters liftParams)
        {
            if (gridDataType == GridDataType.ProgressiveVolumes)
            {
                var retriever = new ProgressiveVolumesSubGridRetriever(siteModel,
                                                                       gridDataType,
                                                                       storageProxy,
                                                                       filter,
                                                                       filterAnnex,
                                                                       hasOverrideSpatialCellRestriction,
                                                                       overrideSpatialCellRestriction,
                                                                       subGridCacheContexts != null,
                                                                       maxNumberOfPassesToReturn,
                                                                       areaControlSet,
                                                                       populationControl,
                                                                       pdExistenceMap,
                                                                       overrides,
                                                                       liftParams);

                if (subGridsRequestArgument is IProgressiveVolumesSubGridsRequestArgument argument)
                {
                    retriever.StartDate = argument.StartDate;
                    retriever.EndDate   = argument.EndDate;
                    retriever.Interval  = argument.Interval;
                }
                else
                {
                    throw new ArgumentException($"Argument passed to sub grid retriever factory for progressive volumes retriever construction is not an expected type: {subGridsRequestArgument.GetType()}");
                }

                return(retriever);
            }
            else
            {
                var retriever = new SubGridRetriever(siteModel,
                                                     gridDataType,
                                                     storageProxy,
                                                     filter,
                                                     filterAnnex,
                                                     hasOverrideSpatialCellRestriction,
                                                     overrideSpatialCellRestriction,
                                                     subGridCacheContexts != null,
                                                     maxNumberOfPassesToReturn,
                                                     areaControlSet,
                                                     populationControl,
                                                     pdExistenceMap,
                                                     overrides,
                                                     liftParams);

                return(retriever);
            }
        }
Beispiel #24
0
        /// <summary>
        /// Constructor that accepts the common parameters around a set of sub grids the requester will be asked to process
        /// and initializes the requester state ready to start processing individual sub grid requests.
        /// </summary>
        public void Initialize(ISubGridsRequestArgument subGridsRequestArgument,
                               ISiteModel siteModel,
                               GridDataType gridDataType,
                               IStorageProxy storageProxy,
                               ICombinedFilter filter,
                               bool hasOverrideSpatialCellRestriction,
                               BoundingIntegerExtent2D overrideSpatialCellRestriction,
                               int maxNumberOfPassesToReturn,
                               AreaControlSet areaControlSet,
                               IFilteredValuePopulationControl populationControl,
                               ISubGridTreeBitMask pdExistenceMap,
                               ITRexSpatialMemoryCache subGridCache,
                               ITRexSpatialMemoryCacheContext[] subGridCacheContexts,
                               ISurveyedSurfaces filteredSurveyedSurfaces,
                               ISurfaceElevationPatchRequest surfaceElevationPatchRequest,
                               IOverrideParameters overrides,
                               ILiftParameters liftParams)
        {
            _siteModel    = siteModel;
            _gridDataType = gridDataType;
            _filter       = filter;

            _hasOverrideSpatialCellRestriction = hasOverrideSpatialCellRestriction;
            _overrideSpatialCellRestriction    = overrideSpatialCellRestriction;

            _retriever = DIContext.Obtain <ISubGridRetrieverFactory>().Instance(subGridsRequestArgument,
                                                                                siteModel,
                                                                                gridDataType,
                                                                                storageProxy,
                                                                                filter,
                                                                                _filterAnnex,
                                                                                hasOverrideSpatialCellRestriction,
                                                                                overrideSpatialCellRestriction,
                                                                                maxNumberOfPassesToReturn,
                                                                                areaControlSet,
                                                                                populationControl,
                                                                                pdExistenceMap,
                                                                                subGridCacheContexts,
                                                                                overrides,
                                                                                liftParams);

            _returnEarliestFilteredCellPass = _filter.AttributeFilter.ReturnEarliestFilteredCellPass;
            _processingMap = new SubGridTreeBitmapSubGridBits(SubGridBitsCreationOptions.Unfilled);

            _surfaceElevationPatchRequest = surfaceElevationPatchRequest;

            _subGridCache         = subGridCache;
            _subGridCacheContexts = subGridCacheContexts;

            _surveyedSurfacePatchType = _filter.AttributeFilter.ReturnEarliestFilteredCellPass ? SurveyedSurfacePatchType.EarliestSingleElevation : SurveyedSurfacePatchType.LatestSingleElevation;

            _filteredSurveyedSurfaces = filteredSurveyedSurfaces;
            _filteredSurveyedSurfaces?.SortChronologically(_surveyedSurfacePatchType == SurveyedSurfacePatchType.LatestSingleElevation);
            _filteredSurveyedSurfacesAsGuidArray = _filteredSurveyedSurfaces?.Select(x => x.ID).ToArray() ?? new Guid[0];

            var elevRangeDesignFilter = _filter.AttributeFilter.ElevationRangeDesign;

            if (elevRangeDesignFilter.DesignID != Guid.Empty)
            {
                var design = _siteModel.Designs.Locate(elevRangeDesignFilter.DesignID);
                if (design == null)
                {
                    _log.LogError($"ElevationRangeDesign {elevRangeDesignFilter.DesignID} is unknown in project {siteModel.ID}");
                }
                else
                {
                    _elevationRangeDesign = new DesignWrapper(elevRangeDesignFilter, design);
                }
            }

            if (_filter.SpatialFilter.IsDesignMask)
            {
                _surfaceDesignMaskDesign = _siteModel.Designs.Locate(_filter.SpatialFilter.SurfaceDesignMaskDesignUid);
            }

            _filter.AttributeFilter.SiteModel = _siteModel;
        }