/// <summary> /// Overload constructor with parameters. /// </summary> public ProgressiveSummaryVolumesDataRequest( Guid?projectUid, FilterResult filter, Guid?baseDesignUid, double?baseDesignOffset, Guid?topDesignUid, double?topDesignOffset, VolumesType volumeCalcType, double?cutTolerance, double?fillTolerance, FilterResult additionalSpatialFilter, DateTime startDateUtc, DateTime endDateUtc, int intervalSeconds) { ProjectUid = projectUid; Filter = filter; BaseDesignUid = baseDesignUid; BaseDesignOffset = baseDesignOffset; TopDesignUid = topDesignUid; TopDesignOffset = topDesignOffset; VolumeCalcType = volumeCalcType; CutTolerance = cutTolerance; FillTolerance = fillTolerance; AdditionalSpatialFilter = additionalSpatialFilter; StartDateUtc = startDateUtc; EndDateUtc = endDateUtc; IntervalSeconds = intervalSeconds; }
/// <summary> /// Overload constructor with parameters. /// </summary> public TRexTileRequest( Guid projectUid, DisplayMode mode, List <ColorPalette> palettes, DesignDescriptor designDescriptor, FilterResult filter1, FilterResult filter2, BoundingBox2DLatLon boundingBoxLatLon, BoundingBox2DGrid boundingBoxGrid, ushort width, ushort height, OverridingTargets overrides, LiftSettings liftSettings, VolumesType volumeType) { ProjectUid = projectUid; Mode = mode; Palettes = palettes; DesignDescriptor = designDescriptor; Filter1 = filter1; Filter2 = filter2; BoundBoxLatLon = boundingBoxLatLon; BoundBoxGrid = boundingBoxGrid; Width = width; Height = height; Overrides = overrides; LiftSettings = liftSettings; VolumeType = volumeType; }
/// <summary> /// Ensures there is not a misconfigured topFilter or baseFilter for certain operations that involve design surfaces for volume computation operations /// </summary> public static (FilterResult baseFilter, FilterResult topFilter) ReconcileTopFilterAndVolumeComputationMode( FilterResult baseFilter, FilterResult topFilter, VolumesType computeVolType) { // Adjust filter to take into account volume type computations respect to designs. // If these requests involve a design through the appropriate volume computation modes, either the topFilter or the baseFilter // has no effect depending on the style of filter/design and design/filter chosen // and must be made safe so the underlying engines do not receive conflicting instructions between a specified design // and a filter used by these requests if (computeVolType == VolumesType.BetweenDesignAndFilter) { // Force topfilter to be a plain empty filter to remove any default // setting such as the LayerType to percolate through into the request. return(baseFilter : new FilterResult(), topFilter); } if (computeVolType == VolumesType.BetweenFilterAndDesign) { // Force basefilter to be a plain empty filter to remove any default // setting such as the LayerType to percolate through into the request. return(baseFilter, topFilter : new FilterResult()); } return(baseFilter, topFilter); }
/// <summary> /// Overload constructor with parameters. /// </summary> /// <param name="projectId"></param> /// <param name="callId"></param> /// <param name="mode"></param> /// <param name="palettes"></param> /// <param name="liftBuildSettings"></param> /// <param name="computeVolType"></param> /// <param name="computeVolNoChangeTolerance"></param> /// <param name="designDescriptor"></param> /// <param name="filter1"></param> /// <param name="filterId1"></param> /// <param name="filter2"></param> /// <param name="filterId2"></param> /// <param name="filterLayerMethod"></param> /// <param name="boundingBoxLatLon"></param> /// <param name="boundingBoxGrid"></param> /// <param name="width"></param> /// <param name="height"></param> /// <param name="representationalDisplayColor"></param> /// <param name="cmvDetailsColorNumber"></param> /// <param name="cmvPercentChangeColorNumber"></param> /// <param name="setSummaryDataLayersVisibility"></param> public TileRequest( long projectId, Guid?projectUid, Guid?callId, DisplayMode mode, List <ColorPalette> palettes, LiftBuildSettings liftBuildSettings, VolumesType computeVolType, double computeVolNoChangeTolerance, DesignDescriptor designDescriptor, FilterResult filter1, long filterId1, FilterResult filter2, long filterId2, FilterLayerMethod filterLayerMethod, BoundingBox2DLatLon boundingBoxLatLon, BoundingBox2DGrid boundingBoxGrid, ushort width, ushort height, uint representationalDisplayColor = 0, uint cmvDetailsColorNumber = 5, uint cmvPercentChangeColorNumber = 6, bool setSummaryDataLayersVisibility = true, bool explicitFilters = false) { ProjectId = projectId; ProjectUid = projectUid; CallId = callId; Mode = mode; Palettes = palettes; LiftBuildSettings = liftBuildSettings; ComputeVolumesType = computeVolType; ComputeVolNoChangeTolerance = computeVolNoChangeTolerance; DesignDescriptor = designDescriptor; Filter1 = filter1; FilterId1 = filterId1; Filter2 = filter2; FilterId2 = filterId2; FilterLayerMethod = filterLayerMethod; BoundBoxLatLon = boundingBoxLatLon; BoundBoxGrid = boundingBoxGrid; Width = width; Height = height; RepresentationalDisplayColor = representationalDisplayColor; p_cmvDetailsColorNumber = cmvDetailsColorNumber; p_cmvPercentChangeColorNumber = cmvPercentChangeColorNumber; SetSummaryDataLayersVisibility = setSummaryDataLayersVisibility; ExplicitFilters = explicitFilters; }
/// <summary> /// Overload constructor with parameters. /// </summary> public SummaryVolumesDataRequest( Guid?projectUid, FilterResult baseFilter, FilterResult topFilter, Guid?baseDesignUid, double?baseDesignOffset, Guid?topDesignUid, double?topDesignOffset, VolumesType volumeCalcType) { ProjectUid = projectUid; BaseFilter = baseFilter; TopFilter = topFilter; BaseDesignUid = baseDesignUid; BaseDesignOffset = baseDesignOffset; TopDesignUid = topDesignUid; TopDesignOffset = topDesignOffset; VolumeCalcType = volumeCalcType; }
/// <summary> /// Ensures there is not a misconfigured topFilter for certain operations that involve design surfaces for tile rendering operations /// </summary> public static FilterResult ReconcileTopFilterAndVolumeComputationMode( FilterResult topFilter, DisplayMode mode, VolumesType computeVolType) { // Adjust filter to take into account volume type computations that effect Cut/Fill, Volume and Thickness requests. // If these requests invovle a design through the appropriate volume computation modes, the topFilter has no effect // and must be made safe so the underlying engines do not receive conflicting instructions between a specified design // and a top filter indication one of the comparative surfaces used by these requests if ((mode == DisplayMode.CutFill || mode == DisplayMode.VolumeCoverage || mode == DisplayMode.TargetThicknessSummary) && (computeVolType == VolumesType.BetweenDesignAndFilter || computeVolType == VolumesType.BetweenFilterAndDesign)) { // Force topfilter (which is filter2) to be a plain empty filter to remove any default // setting such as the LayerType to percolate through into the request. return(new FilterResult()); } return(topFilter); }
/// <summary> /// Overload constructor with parameters. /// </summary> public SummaryVolumesProfileDataRequest( Guid projectUid, FilterResult baseFilter, FilterResult topFilter, Guid?referenceDesignUid, double?referenceDesignOffset, VolumesType volumeCalcType, bool positionsAreGrid, double startX, double startY, double endX, double endY, OverridingTargets overrides, LiftSettings liftSettings) : base(projectUid, referenceDesignUid, referenceDesignOffset, positionsAreGrid, startX, startY, endX, endY, overrides, liftSettings, baseFilter) { TopFilter = topFilter; VolumeCalcType = volumeCalcType; }
/// <summary> /// Converts values of the VolumesType to ones of the VolumeComputationType. /// </summary> public static VolumeComputationType ConvertVolumesType(VolumesType volumesType) { switch (volumesType) { case VolumesType.None: return(VolumeComputationType.None); case VolumesType.AboveLevel: return(VolumeComputationType.AboveLevel); case VolumesType.Between2Levels: return(VolumeComputationType.Between2Levels); case VolumesType.AboveFilter: return(VolumeComputationType.AboveFilter); case VolumesType.Between2Filters: return(VolumeComputationType.Between2Filters); case VolumesType.BetweenFilterAndDesign: return(VolumeComputationType.BetweenFilterAndDesign); case VolumesType.BetweenDesignAndFilter: return(VolumeComputationType.BetweenDesignAndFilter); default: throw new ArgumentException($"Unknown VolumesType {Convert.ToInt16(volumesType)}"); } }
public void ValidateVolumesFilters(VolumesType computeVolType, FilterResult filter1, long filterId1, FilterResult filter2, long filterId2) { switch (computeVolType) { case VolumesType.Between2Filters: if ((filter1 == null && filterId1 <= 0) || (filter2 == null && filterId2 <= 0)) { throw new TwoFiltersRequiredException(HttpStatusCode.BadRequest, new ContractExecutionResult(ContractExecutionStatesEnum.ValidationError, string.Format("Two filters required for filter to filter volumes display"))); } break; case VolumesType.BetweenDesignAndFilter: case VolumesType.BetweenFilterAndDesign: if (filter1 == null && filterId1 <= 0 && filter2 == null && filterId2 <= 0) { throw new SingleFilterRequiredException(HttpStatusCode.BadRequest, new ContractExecutionResult(ContractExecutionStatesEnum.ValidationError, string.Format("One filter required for design to filter or filter to design volumes display"))); } break; default: throw new ServiceException(HttpStatusCode.BadRequest, new ContractExecutionResult(ContractExecutionStatesEnum.ValidationError, string.Format("This type of volumes calculation is not supported"))); } if (filter1 != null) { filter1.Validate(); } if (filter2 != null) { filter2.Validate(); } }
/// <summary> /// Overload constructor with parameters. /// </summary> public PatchRequest( long?projectId, Guid?projectUid, Guid?callId, DisplayMode mode, List <ColorPalette> palettes, LiftBuildSettings liftBuildSettings, bool renderColorValues, VolumesType computeVolType, double computeVolNoChangeTolerance, DesignDescriptor designDescriptor, FilterResult filter1, FilterResult filter2, FilterLayerMethod filterLayerMethod, int patchNumber, int patchSize, bool includeTimeOffsets = false ) { ProjectId = projectId; ProjectUid = projectUid; CallId = callId; Mode = mode; Palettes = palettes; LiftBuildSettings = liftBuildSettings; RenderColorValues = renderColorValues; ComputeVolType = computeVolType; ComputeVolNoChangeTolerance = computeVolNoChangeTolerance; DesignDescriptor = designDescriptor; Filter1 = filter1; FilterId1 = filter1?.Id ?? 0; Filter2 = filter2; FilterId2 = filter2?.Id ?? 0; FilterLayerMethod = filterLayerMethod; PatchNumber = patchNumber; PatchSize = patchSize; IncludeTimeOffsets = includeTimeOffsets; }
public void ValidateDesign(DesignDescriptor designDescriptor, DisplayMode mode, VolumesType computeVolType) { bool noDesign = false; if (computeVolType == VolumesType.BetweenDesignAndFilter || computeVolType == VolumesType.BetweenFilterAndDesign) { noDesign = designDescriptor == null; } if (noDesign) { throw new MissingDesignDescriptorException(HttpStatusCode.BadRequest, new ContractExecutionResult(ContractExecutionStatesEnum.ValidationError, string.Format("Design descriptor required for cut/fill and design to filter or filter to design volumes display"))); } if (computeVolType != VolumesType.Between2Filters) { if (mode == DisplayMode.CutFill && designDescriptor == null) { throw new MissingDesignDescriptorException(HttpStatusCode.BadRequest, new ContractExecutionResult(ContractExecutionStatesEnum.ValidationError, string.Format( "Design descriptor required for cut/fill and design to filter or filter to design volumes display"))); } if (designDescriptor != null) { designDescriptor.Validate(); } } }
/// <summary> /// Creates a <see cref="ProgressiveSummaryVolumesRequest"/> object for use with the v2 API. /// </summary> /// <returns>New instance of <see cref="ProgressiveSummaryVolumesRequest"/>.</returns> public static ProgressiveSummaryVolumesRequest CreateAndValidate(long projectId, Guid?projectUid, FilterResult filter, DesignDescriptor baseDesignDescriptor, DesignDescriptor topDesignDescriptor, VolumesType volumeCalcType, double?cutTolerance, double?fillTolerance, FilterResult additionalSpatialFilter, DateTime startDateUtc, DateTime endDateUtc, int intervalSeconds) { var request = new ProgressiveSummaryVolumesRequest { ProjectId = projectId, ProjectUid = projectUid, Filter = filter, BaseDesignDescriptor = baseDesignDescriptor, TopDesignDescriptor = topDesignDescriptor, VolumeCalcType = volumeCalcType, BaseFilterId = -1, TopFilterId = -1, CutTolerance = cutTolerance, FillTolerance = fillTolerance, AdditionalSpatialFilter = additionalSpatialFilter, StartDateUtc = startDateUtc, EndDateUtc = endDateUtc, IntervalSeconds = intervalSeconds }; request.Validate(); return(request); }
/// <summary> /// Creates a <see cref="SummaryVolumesRequest"/> object for use with the v2 API. /// </summary> /// <returns>New instance of <see cref="SummaryVolumesRequest"/>.</returns> public static SummaryVolumesRequest CreateAndValidate(long projectId, Guid?projectUid, FilterResult baseFilter, FilterResult topFilter, DesignDescriptor baseDesignDescriptor, DesignDescriptor topDesignDescriptor, VolumesType volumeCalcType, bool explicitFilters = false) { var request = new SummaryVolumesRequest { ProjectId = projectId, ProjectUid = projectUid, BaseFilter = baseFilter, TopFilter = topFilter, BaseDesignDescriptor = baseDesignDescriptor, TopDesignDescriptor = topDesignDescriptor, VolumeCalcType = volumeCalcType, BaseFilterId = -1, TopFilterId = -1, ExplicitFilters = explicitFilters }; request.Validate(); return(request); }