Example #1
0
        static void Main(string[] args)
        {
            Path path = new Path();

            path.AddPoints(new Points3d(1, 2, 3));
            path.AddPoints(new Points3d(4, 5, 6));
            path.AddPoints(new Points3d(7, 8, 9));
            PathStorage.Save("../../Paths.txt", path);

            Path loadedPath = PathStorage.Load("../../Paths.txt");
        }
Example #2
0
        public static Path Load(string filePath)
        {
            Path path = new Path();

            using (StreamReader reader = new StreamReader(filePath))
            {
                while (!reader.EndOfStream)
                {
                    int[] coords = reader.ReadLine()
                                   .Split(' ')
                                   .Select(int.Parse)
                                   .ToArray();

                    path.AddPoints(new Points3d(coords[0], coords[1], coords[2]));

                    reader.ReadLine();
                }
            }
            return(path);
        }