コード例 #1
0
        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());
        }
コード例 #2
0
        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();
        }
コード例 #3
0
ファイル: ptsDTM.cs プロジェクト: PaulSchrum/RM21SourceCore
        /// <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;
        }