Beispiel #1
0
 /// <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;
 }
Beispiel #2
0
        public void ValidateBoundingBox2DGridFailTest()
        {
            //not bl and tr
            BoundingBox2DGrid bbox = new BoundingBox2DGrid(380712.19834, 812634.205106, 380646.982394, 812788.92875);

            Assert.ThrowsException <ServiceException>(() => bbox.Validate());
        }
Beispiel #3
0
        public void CanCreateBoundingBox2DGridTest()
        {
            var validator          = new DataAnnotationsValidator();
            BoundingBox2DGrid bbox = new BoundingBox2DGrid(380646.982394, 812634.205106, 380712.19834, 812788.92875);
            ICollection <ValidationResult> results;

            Assert.IsTrue(validator.TryValidate(bbox, out results));
        }
Beispiel #4
0
        public void ValidateFailTwoBoundingBoxesTest()
        {
            var boundingBox2dGrid = new BoundingBox2DGrid(380646.982394, 812634.205106, 380712.19834, 812788.92875);

            //Two bounding boxes
            TileRequest request = new TileRequest(projectId, null, callId, DisplayMode.Height, null, liftSettings, VolumesType.None, 0.0, null, null, 0, null, 0, FilterLayerMethod.None, boundingBox2DLatLon, boundingBox2dGrid, 256, 256);

            Assert.ThrowsException <ServiceException>(() => request.Validate());
        }
Beispiel #5
0
 public PatchesRequest(string ecSerial,
                       double machineLatitude, double machineLongitude,
                       BoundingBox2DGrid boundingBox)
 {
     ECSerial         = ecSerial;
     MachineLatitude  = machineLatitude;
     MachineLongitude = machineLongitude;
     BoundingBox      = boundingBox;
 }
Beispiel #6
0
        public void MapBoundingBox2DGridToBoundingWorldExtent3D()
        {
            var box   = new BoundingBox2DGrid(10, 12, 35, 27);
            var box3d = AutoMapperUtility.Automapper.Map <BoundingWorldExtent3D>(box);

            Assert.Equal(box.BottomLeftX, box3d.MinX);
            Assert.Equal(box.BottomleftY, box3d.MinY);
            Assert.Equal(box.TopRightX, box3d.MaxX);
            Assert.Equal(box.TopRightY, box3d.MaxY);
        }
Beispiel #7
0
        protected FilterResult SetupCompactionFilter(Guid projectUid, BoundingBox2DGrid boundingBox)
        {
            var filterResult = new FilterResult();

            filterResult.SetBoundary(new List <Point>
            {
                new Point(boundingBox.BottomleftY, boundingBox.BottomLeftX),
                new Point(boundingBox.BottomleftY, boundingBox.TopRightX),
                new Point(boundingBox.TopRightY, boundingBox.TopRightX),
                new Point(boundingBox.TopRightY, boundingBox.BottomLeftX)
            });
            return(filterResult);
        }
Beispiel #8
0
        public async Task PatchRequest_Invalid_TRex_NoResult()
        {
            var projectId       = 999;
            var projectUid      = Guid.NewGuid();
            var bBox            = new BoundingBox2DGrid(1, 200, 10, 210);
            var mockConfigStore = new Mock <IConfigurationStore>();

            var filterResult = new FilterResult();

            filterResult.SetBoundary(new List <Point>()
            {
                new Point(bBox.BottomleftY, bBox.BottomLeftX),
                new Point(bBox.BottomleftY, bBox.TopRightX),
                new Point(bBox.TopRightY, bBox.TopRightX),
                new Point(bBox.TopRightY, bBox.BottomLeftX)
            });
            var patchRequest = new PatchRequest(
                projectId,
                projectUid,
                new Guid(),
                DisplayMode.Height,
                null,
                new LiftBuildSettings(),
                false,
                VolumesType.None,
                VelociraptorConstants.VOLUME_CHANGE_TOLERANCE,
                null, filterResult, null, FilterLayerMethod.AutoMapReset,
                0, 1000, true);

            patchRequest.Validate();

            var exception = new ServiceException(HttpStatusCode.InternalServerError,
                                                 new ContractExecutionResult(ContractExecutionStatesEnum.InternalProcessingError,
                                                                             $"Patch request failed somehow. ProjectUid: {projectUid}"));

            var tRexProxy = new Mock <ITRexCompactionDataProxy>();

            tRexProxy.Setup(x => x.SendDataPostRequestWithStreamResponse(It.IsAny <PatchDataRequest>(), "/patches", It.IsAny <IHeaderDictionary>()))
            .Throws(exception);

            var executor = RequestExecutorContainerFactory
                           .Build <PatchExecutor>(_logger, mockConfigStore.Object,
                                                  trexCompactionDataProxy: tRexProxy.Object);
            var result = await Assert.ThrowsExceptionAsync <ServiceException>(async() => await executor.ProcessAsync(patchRequest));

            result.Code.Should().Be(HttpStatusCode.InternalServerError);
            result.GetResult.Code.Should().Be(ContractExecutionStatesEnum.InternalProcessingError);
            result.GetResult.Message.Should().Be(exception.GetResult.Message);
        }
Beispiel #9
0
 /// <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;
 }
Beispiel #10
0
        public void ValidateBoundingBox2DGridSuccessTest()
        {
            BoundingBox2DGrid bbox = new BoundingBox2DGrid(380646.982394, 812634.205106, 380712.19834, 812788.92875);

            bbox.Validate();
        }