protected override async Task <ContractExecutionResult> ProcessAsyncEx <T>(T item) { var request = item as CompactionSurfaceExportRequest; if (request == null) { ThrowRequestTypeCastException <CompactionExportRequest>(); } var siteModel = GetSiteModel(request?.ProjectUid); var filter = ConvertFilter(request?.Filter, siteModel); var tinRequest = new TINSurfaceRequest(); var response = await tinRequest.ExecuteAsync(new TINSurfaceRequestArgument { ProjectID = siteModel.ID, Filters = new FilterSet(filter), Tolerance = request?.Tolerance ?? 0.0, Overrides = AutoMapperUtility.Automapper.Map <OverrideParameters>(request.Overrides), LiftParams = ConvertLift(request.LiftSettings, request.Filter?.LayerType) }); return(TINSurfaceExportResult.CreateTINResult(response.data)); }
public async Task Request_EmptyModel_ZeroTolerance() { AddGridRouting(); var siteModel = DITAGFileAndSubGridRequestsWithIgniteFixture.NewEmptyModel(); var request = new TINSurfaceRequest(); var result = await request.ExecuteAsync(new TINSurfaceRequestArgument { ProjectID = siteModel.ID, Filters = new FilterSet(new CombinedFilter()), Tolerance = 0 }); result.Should().NotBeNull(); result.data.Should().BeNull(); }
public async Task Request_SingleTAGFile_Smooth() { AddGridRouting(); var tagFiles = new[] { Path.Combine(TestHelper.CommonTestDataPath, "TestTAGFile.tag") }; var siteModel = DITAGFileAndSubGridRequestsFixture.BuildModel(tagFiles, out _); var request = new TINSurfaceRequest(); var result = await request.ExecuteAsync(new TINSurfaceRequestArgument { ProjectID = siteModel.ID, Filters = new FilterSet(new CombinedFilter()), Tolerance = 0 }); result.Should().NotBeNull(); result.data.Should().NotBeNull(); var model = new TRex.Designs.TTM.TrimbleTINModel(); model.Read(new BinaryReader(new MemoryStream(result.data))); model.Vertices.Count.Should().Be(2768); model.Triangles.Count.Should().Be(5011); }
public async Task Request_SingleTriangle_ZeroTolerance() { AddGridRouting(); var siteModel = DITAGFileAndSubGridRequestsWithIgniteFixture.NewEmptyModel(); // Create three cells in a triangle at (0, 0), (0, 1) & (1, 0) var cellPasses = new List <CellPass> { new CellPass { Time = DateTime.UtcNow, Height = 1.0f } }; DITAGFileAndSubGridRequestsFixture.AddSingleCellWithPasses (siteModel, SubGridTreeConsts.DefaultIndexOriginOffset, SubGridTreeConsts.DefaultIndexOriginOffset, cellPasses); DITAGFileAndSubGridRequestsFixture.AddSingleCellWithPasses (siteModel, SubGridTreeConsts.DefaultIndexOriginOffset, SubGridTreeConsts.DefaultIndexOriginOffset + 1, cellPasses); DITAGFileAndSubGridRequestsFixture.AddSingleCellWithPasses (siteModel, SubGridTreeConsts.DefaultIndexOriginOffset + 1, SubGridTreeConsts.DefaultIndexOriginOffset, cellPasses); DITAGFileAndSubGridRequestsFixture.AddSingleCellWithPasses (siteModel, SubGridTreeConsts.DefaultIndexOriginOffset + 1, SubGridTreeConsts.DefaultIndexOriginOffset + 1, cellPasses); DITAGFileAndSubGridRequestsFixture.ConvertSiteModelToImmutable(siteModel); var request = new TINSurfaceRequest(); var result = await request.ExecuteAsync(new TINSurfaceRequestArgument { ProjectID = siteModel.ID, Filters = new FilterSet(new CombinedFilter()), Tolerance = 0 }); result.Should().NotBeNull(); result.data.Should().NotBeNull(); var model = new VSS.TRex.Designs.TTM.TrimbleTINModel(); model.Read(new BinaryReader(new MemoryStream(result.data))); model.Vertices.Count.Should().Be(4); model.Triangles.Count.Should().Be(2); }