Exemple #1
0
        public void LoadFromFileTest()
        {
            LoadTheDesign();

            design.SubGridOverlayIndex().Should().NotBeNull();

            design.Data.Triangles.Items.Length.Should().Be(67251);
            design.Data.Vertices.Items.Length.Should().Be(34405);
            design.Data.StartPoints.Items.Length.Should().Be(16);
            design.Data.Edges.Items.Length.Should().Be(1525);

            design.SubGridOverlayIndex().SizeOf().Should().Be(12724);

            design.SizeInCache().Should().Be(2285888);
        }
Exemple #2
0
        private void AddTheSurveyedSurfaceToSiteModel(Guid siteModelUid, Guid designUid, string localPath, string localFileName, DateTime surveyedUtc)
        {
            // Invoke the service to add the surveyed surface
            try
            {
                // Load the file and extract its extents
                var TTM = new TTMDesign(SubGridTreeConsts.DefaultCellSize);
                TTM.LoadFromFile(Path.Combine(new[] { localPath, localFileName }));

                var extents = new BoundingWorldExtent3D();
                TTM.GetExtents(out extents.MinX, out extents.MinY, out extents.MaxX, out extents.MaxY);
                TTM.GetHeightRange(out extents.MinZ, out extents.MaxZ);

                // TODO: Convert to requet per designs
                // Create the new design for the site model (note that SS and design types are different)
                var design = DIContext.Obtain <ISurveyedSurfaceManager>()
                             .Add(siteModelUid, new DesignDescriptor(designUid, string.Empty, localFileName), surveyedUtc, extents, TTM.SubGridOverlayIndex());
            }
            catch (Exception e)
            {
                throw new TRexException($"Exception writing surveyed surface to siteModel:", e);
            }
        }