Esempio n. 1
0
 public static void TestPath()
 {
     Path3D path = new Path3D(generateRandomPoints(50));
     Console.WriteLine();
     Storage.Save("C:\\Temp\\output.txt", path);
     Path3D secondPath = Storage.Load("C:\\Temp\\output.txt");
     Storage.Save("C:\\Temp\\Output2.txt", secondPath);
     Console.WriteLine("Great Sucess! Check C:/Temp/!");
     Console.ReadKey();
 }
Esempio n. 2
0
 public static Path3D Load(string file)
 {
     string[] readContents = File.ReadAllLines(file);
     Path3D path = new Path3D();
     foreach (string line in readContents)
     {
         string[] numbers = line.Split(',');
         path.AddPoint(new Point3D(float.Parse(numbers[0]), float.Parse(numbers[1]), float.Parse(numbers[2])));
     }
     return path;
 }
Esempio n. 3
0
 public static void Save(string file, Path3D path)
 {
     FileStream fs = File.Create(file);
     StreamWriter sw = new StreamWriter(fs);
     foreach (Point3D point in path.points)
     {
         sw.WriteLine(point.ToString());
     }
     sw.Close();
     fs.Close();
 }
Esempio n. 4
0
        public static Path3D Load(string file)
        {
            string[] readContents = File.ReadAllLines(file);
            Path3D   path         = new Path3D();

            foreach (string line in readContents)
            {
                string[] numbers = line.Split(',');
                path.AddPoint(new Point3D(float.Parse(numbers[0]), float.Parse(numbers[1]), float.Parse(numbers[2])));
            }
            return(path);
        }
Esempio n. 5
0
        public static void Save(string file, Path3D path)
        {
            FileStream   fs = File.Create(file);
            StreamWriter sw = new StreamWriter(fs);

            foreach (Point3D point in path.points)
            {
                sw.WriteLine(point.ToString());
            }
            sw.Close();
            fs.Close();
        }
Esempio n. 6
0
        public static void TestPath()
        {
            Path3D path = new Path3D(generateRandomPoints(50));

            Console.WriteLine();
            Storage.Save("C:\\Temp\\output.txt", path);
            Path3D secondPath = Storage.Load("C:\\Temp\\output.txt");

            Storage.Save("C:\\Temp\\Output2.txt", secondPath);
            Console.WriteLine("Great Sucess! Check C:/Temp/!");
            Console.ReadKey();
        }