/// <summary> /// Serializes content from the writer /// </summary> public override void InternalFromBinary(IBinaryRawReader reader) { base.InternalFromBinary(reader); var version = VersionSerializationHelper.CheckVersionByte(reader, VERSION_NUMBER); if (version == 1) { ProfileTypeRequired = (GridDataType)reader.ReadInt(); ProfileStyle = (ProfileStyle)reader.ReadInt(); StartPoint = new WGS84Point(); if (reader.ReadBoolean()) { StartPoint.FromBinary(reader); } EndPoint = new WGS84Point(); if (reader.ReadBoolean()) { EndPoint.FromBinary(reader); } PositionsAreGrid = reader.ReadBoolean(); ReturnAllPassesAndLayers = reader.ReadBoolean(); VolumeType = (VolumeComputationType)reader.ReadInt(); } }
/// <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; }
/// <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; }
/// <summary> /// Selects appropriate data sources for information based on filter or surface involvement in the 'from' and 'to' /// contexts in the volume computation. /// </summary> /// <param name="volumeType"></param> /// <param name="fromSelectionType"></param> /// <param name="toSelectionType"></param> public static void SetProdReportSelectionType(VolumeComputationType volumeType, out ProdReportSelectionType fromSelectionType, out ProdReportSelectionType toSelectionType) { // Set up the volumes calc parameters switch (volumeType) { case VolumeComputationType.Between2Filters: fromSelectionType = ProdReportSelectionType.Filter; toSelectionType = ProdReportSelectionType.Filter; break; case VolumeComputationType.BetweenFilterAndDesign: fromSelectionType = ProdReportSelectionType.Filter; toSelectionType = ProdReportSelectionType.Surface; break; case VolumeComputationType.BetweenDesignAndFilter: fromSelectionType = ProdReportSelectionType.Surface; toSelectionType = ProdReportSelectionType.Filter; break; default: fromSelectionType = ProdReportSelectionType.None; toSelectionType = ProdReportSelectionType.None; break; } }
/// <summary> /// Serializes content from the writer /// </summary> public override void InternalFromBinary(IBinaryRawReader reader) { base.InternalFromBinary(reader); var version = VersionSerializationHelper.CheckVersionByte(reader, VERSION_NUMBER); if (version == 1) { ProjectID = reader.ReadGuid() ?? Guid.Empty; VolumeType = (VolumeComputationType)reader.ReadInt(); BaseFilter = ReadFilter(reader); TopFilter = ReadFilter(reader); if (reader.ReadBoolean()) { BaseDesign = new DesignOffset(); BaseDesign.FromBinary(reader); } if (reader.ReadBoolean()) { TopDesign = new DesignOffset(); TopDesign.FromBinary(reader); } AdditionalSpatialFilter = ReadFilter(reader); CutTolerance = reader.ReadDouble(); FillTolerance = reader.ReadDouble(); } }
/// <summary> /// Serializes content from the writer /// </summary> public override void InternalFromBinary(IBinaryRawReader reader) { base.InternalFromBinary(reader); var messageVersion = VersionSerializationHelper.CheckVersionsByte(reader, VERSION_NUMBERS); if (messageVersion >= 1) { Mode = (DisplayMode)reader.ReadInt(); if (reader.ReadBoolean()) { Palette = TileRenderRequestArgumentPaletteFactory.GetPalette(Mode); Palette.FromBinary(reader); } if (reader.ReadBoolean()) { Extents = new BoundingWorldExtent3D(); Extents.FromBinary(reader); } CoordsAreGrid = reader.ReadBoolean(); PixelsX = (ushort)reader.ReadInt(); PixelsY = (ushort)reader.ReadInt(); } if (messageVersion >= 2) { VolumeType = (VolumeComputationType)reader.ReadByte(); } }
public void TestProdReportSelectionType(VolumeComputationType volumeType, ProdReportSelectionType expectedFromSelectionType, ProdReportSelectionType expectedToSelectionType) { VolumesUtilities.SetProdReportSelectionType(volumeType, out var fromSelectionType, out var toSelectionType); fromSelectionType.Should().Be(expectedFromSelectionType); toSelectionType.Should().Be(expectedToSelectionType); }
/// <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; }
/// <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; }
/// <summary> /// Constructs the set of filters that will be used to derive the set of production data sub grids. /// </summary> public static IFilterSet ConstructFilters(IFilterSet filterSet, VolumeComputationType volumeType) { if (volumeType == VolumeComputationType.None) { return(filterSet); } // If the volume calculation is between two filters then handle appropriately... if (volumeType == VolumeComputationType.Between2Filters) { var baseFilter = filterSet.Filters[0]; var topFilter = filterSet.Filters[1]; // Determine if intermediary filter/surface behaviour is required to support summary volumes var intermediaryFilterRequired = volumeType == VolumeComputationType.Between2Filters && baseFilter.AttributeFilter.HasTimeFilter && baseFilter.AttributeFilter.StartTime == Consts.MIN_DATETIME_AS_UTC && // 'From' has As-At Time filter !baseFilter.AttributeFilter.ReturnEarliestFilteredCellPass && // Want latest cell pass in 'from' topFilter.AttributeFilter.HasTimeFilter && topFilter.AttributeFilter.StartTime != Consts.MIN_DATETIME_AS_UTC && // 'To' has time-range filter with latest !topFilter.AttributeFilter.ReturnEarliestFilteredCellPass; // Want latest cell pass in 'to' if (intermediaryFilterRequired) { // Create and use the intermediary filter. The intermediary filter // is created from the Top filter, with the return earliest flag set to true var intermediaryFilter = new CombinedFilter(); intermediaryFilter.AttributeFilter.Assign(topFilter.AttributeFilter); intermediaryFilter.AttributeFilter.ReturnEarliestFilteredCellPass = true; intermediaryFilter.SpatialFilter.Assign(topFilter.SpatialFilter); return(new FilterSet(new[] { baseFilter, intermediaryFilter, topFilter })); } } else if (volumeType == VolumeComputationType.BetweenDesignAndFilter) { return(new FilterSet(filterSet.Filters[1])); } else if (volumeType == VolumeComputationType.BetweenFilterAndDesign) { return(new FilterSet(filterSet.Filters[0])); } return(filterSet); }
public async Task FailWithNoDefinedBaseOrTopSurfaceDesign(VolumeComputationType volumeType) { AddApplicationGridRouting(); AddClusterComputeGridRouting(); var tagFiles = new[] { Path.Combine(TestHelper.CommonTestDataPath, "TestTAGFile.tag"), }; var siteModel = DITAGFileAndSubGridRequestsFixture.BuildModel(tagFiles, out _); var request = new ProgressiveVolumesRequest_ApplicationService(); var response = await request.ExecuteAsync(DefaultRequestArgFromModel(siteModel, volumeType)); response.Should().NotBeNull(); response.Volumes.Should().BeNull(); response.ResultStatus.Should().NotBe(RequestErrorStatus.OK); }
/// <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); }
public TileRenderRequestArgument(Guid siteModelId, DisplayMode mode, IPlanViewPalette palette, BoundingWorldExtent3D extents, bool coordsAreGrid, ushort pixelsX, ushort pixelsY, IFilterSet filters, DesignOffset referenceDesign, VolumeComputationType volumeType) { ProjectID = siteModelId; Mode = mode; Palette = palette; Extents = extents; CoordsAreGrid = coordsAreGrid; PixelsX = pixelsX; PixelsY = pixelsY; Filters = filters; ReferenceDesign = referenceDesign; VolumeType = volumeType; }
/// <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; }
/// <summary> /// Serializes content from the writer /// </summary> public override void InternalFromBinary(IBinaryRawReader reader) { base.InternalFromBinary(reader); var version = VersionSerializationHelper.CheckVersionByte(reader, VERSION_NUMBER); if (version == 1) { ProfileStyle = (ProfileStyle)reader.ReadByte(); ProfileTypeRequired = (GridDataType)reader.ReadByte(); var count = reader.ReadInt(); NEECoords = new XYZ[count]; for (int i = 0; i < count; i++) { NEECoords[i] = NEECoords[i].FromBinary(reader); } ReturnAllPassesAndLayers = reader.ReadBoolean(); VolumeType = (VolumeComputationType)reader.ReadInt(); } }
/// <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); } }
protected TileRenderRequestArgument SimpleTileRequestArgument(ISiteModel siteModel, DisplayMode displayMode, IPlanViewPalette palette = null, CellPassAttributeFilter attributeFilter = null, VolumeComputationType volumeType = VolumeComputationType.None) { var filter = displayMode == DisplayMode.CutFill ? new FilterSet(new CombinedFilter(), new CombinedFilter()) : new FilterSet(new CombinedFilter()); if (attributeFilter != null) { filter.Filters[0].AttributeFilter = attributeFilter; } return(new TileRenderRequestArgument(siteModel.ID, displayMode, palette, siteModel.SiteModelExtent, true, 256, 256, filter, new DesignOffset(), volumeType)); }
public async Task SummaryVolumeProfileCell_SingleCell_FlatDesignAtOrigin_FilterToDesignOrDesignToFilter(VolumeComputationType volumeComputationType, float designElevation, float lastPassElevation1, float lastPassElevation2, int checkCellIndex) { AddRoutings(); var sm = BuildModelForSingleCell(); var design = DITAGFileAndSubGridRequestsWithIgniteFixture.ConstructSingleFlatTriangleDesignAboutOrigin(ref sm, designElevation); var arg = new ProfileRequestArgument_ApplicationService { ProjectID = sm.ID, ProfileTypeRequired = GridDataType.Height, ProfileStyle = ProfileStyle.SummaryVolume, PositionsAreGrid = true, Filters = new FilterSet( new CombinedFilter { AttributeFilter = new CellPassAttributeFilter { ReturnEarliestFilteredCellPass = true } }, new CombinedFilter()), ReferenceDesign = new DesignOffset(design, 0), StartPoint = new WGS84Point(-1.0, sm.Grid.CellSize / 2), EndPoint = new WGS84Point(1.0, sm.Grid.CellSize / 2), ReturnAllPassesAndLayers = false, VolumeType = volumeComputationType }; // Compute a profile from the bottom left of the screen extents to the top right var svRequest = new ProfileRequest_ApplicationService_SummaryVolumeProfileCell(); var response = await svRequest.ExecuteAsync(arg); response.Should().NotBeNull(); response.ResultStatus.Should().Be(RequestErrorStatus.OK); response.ProfileCells.Count.Should().Be(6); response.ProfileCells[checkCellIndex].DesignElev.Should().Be(designElevation); response.ProfileCells[checkCellIndex].LastCellPassElevation1.Should().Be(lastPassElevation1); response.ProfileCells[checkCellIndex].LastCellPassElevation2.Should().Be(lastPassElevation2); response.ProfileCells[checkCellIndex].InterceptLength.Should().BeApproximately(sm.Grid.CellSize, 0.001); response.ProfileCells[checkCellIndex].OTGCellX.Should().Be(SubGridTreeConsts.DefaultIndexOriginOffset); response.ProfileCells[checkCellIndex].OTGCellY.Should().Be(SubGridTreeConsts.DefaultIndexOriginOffset); }
private ProgressiveVolumesRequestArgument DefaultRequestArgFromModel(ISiteModel siteModel, VolumeComputationType volumeType) { var arg = DefaultRequestArg(siteModel.ID); var(startUtc, endUtc) = siteModel.GetDateRange(); arg.VolumeType = volumeType; arg.StartDate = startUtc; arg.EndDate = endUtc; arg.Interval = new TimeSpan((arg.EndDate.Ticks - arg.StartDate.Ticks) / 10); return(arg); }