private void loadAsheboroData()
        {
            if (AsheboroDataLoaded == false)
             {
            AsheboroDataLoaded = true;

            String fileToOpen = pathRM21SourceCode +
            //               @"\ptsDigitalTerrainModel\Testing\XYZinput\" +
               "RandolphSmallSample.xyz.txt";

            asheboroDTM = new ptsDTM();
            asheboroDTM.loadFromXYZtextFile(fileToOpen);
             }
        }
        public void setup()
        {
            var a = AppDomain.CurrentDomain.BaseDirectory;
             var dr = Directory.GetParent(a);

             while (!(dr.Name.Equals("RM21SourceCore")))
            dr = Directory.GetParent(dr.FullName);

             pathRM21SourceCode = dr.FullName + @"\NUnitTestingLibrary\TestingData\";
             stopwatch = new Stopwatch();
             stopwatch.Start();
             GardenParkwayDTM = new ptsDTM();
             var test = pathRM21SourceCode + "GPEtin.xml";
             try { GardenParkwayDTM.LoadTextFile(pathRM21SourceCode + "GPEtin.xml"); }
             catch (FileNotFoundException fnf) { GardenParkwayDTM = null; }
             stopwatch.Stop();
             timeToLoadGardenParkwayTinFromXML = stopwatch.Elapsed;
             System.Console.WriteLine("time to create Garden Parkway: " + timeToLoadGardenParkwayTinFromXML.ToString());
        }
        public void setupDTMtests()
        {
            pathRM21SourceCode = AppDomain.CurrentDomain.BaseDirectory + @"..\..\..\";
             NUnitTestingData = pathRM21SourceCode + @"NUnitTestingLibrary\TestingData\";
             vrmlTestFileName = "B4656_rm21_mesh_test.wrl";
             fullname = NUnitTestingData + vrmlTestFileName;

             // verify that the file exists

             aDTM = new ptsDTM();
             aDTM.LoadTextFile(NUnitTestingData + vrmlTestFileName);

             GardenParkwayDTM = new ptsDTM();
             var stopwatch = new Stopwatch();

             System.Console.WriteLine("Creating Garden Parkway. . .");
             stopwatch.Start();
             try { GardenParkwayDTM.LoadTextFile(NUnitTestingData + "GPEtin.xml"); }
             catch (FileNotFoundException fnf) { GardenParkwayDTM = null; }
             stopwatch.Stop();
             timeToLoadGardenParkwayTinFromXML = stopwatch.Elapsed;
             System.Console.WriteLine("time to create Garden Parkway: " + timeToLoadGardenParkwayTinFromXML.ToString());
             base.timerStart();
        }
Beispiel #4
0
        /// <summary>
        /// Creates a tin file
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public static ptsDTM CreateFromExistingFile(string fileName)
        {
            ptsDTM returnTin = new ptsDTM();

             if(!String.IsNullOrEmpty(fileName))
             {
            String ext = Path.GetExtension(fileName);
            if (ext.Equals(StandardExtension, StringComparison.OrdinalIgnoreCase))
            {
               returnTin = loadAsBinaryAsync(fileName);
            }
            else
               returnTin.LoadTextFile(fileName);
             }

             Debug.WriteLine("Returning from CreateFromExistingFile");
             return returnTin;
        }
Beispiel #5
0
        private static ptsDTM loadAsBinaryAsync(string fileName)
        {
            if (!File.Exists(fileName))
            throw new FileNotFoundException(fileName);

             ptsDTM returnDTM = new ptsDTM();
             returnDTM.allPoints = new Dictionary<ulong, ptsDTMpoint>();
             returnDTM.allTriangles = new List<ptsDTMtriangle>();
             try
             {
            returnDTM.TryDeleteTempFiles();
            GetTempFilesOutOfZip(fileName);
            loadPointsFromBinary(returnDTM.allPoints);
            loadTrianglesFromBinary(returnDTM.allTriangles, returnDTM.allPoints);

             }
             catch { }
             finally { returnDTM.TryDeleteTempFiles(); }

             Debug.WriteLine(String.Empty); Debug.WriteLine("=============");
             Debug.WriteLine("About to call ComputeBB from thread {0}", Thread.CurrentThread.ManagedThreadId);
             returnDTM.myBBtask = Task.Run(() => returnDTM.ComputeBB());
             Debug.WriteLine("Just called await ComputBB.");
             return returnDTM;
        }
Beispiel #6
0
 private static void DealWithSmallDTM(ptsDTM aTinFile)
 {
     aTinFile.saveAsBinary("TestSave.ptsTin", true);
 }