Esempio n. 1
0
        /// <summary>
        /// Load from a VEF file.
        /// </summary>
        /// <param name="fileName"></param>
        public void Load( string fileName )
        {
            IEnumerator<string> lines = File.ReadLines( fileName ).GetEnumerator();

            lines.MoveNext();
            int numVertices = int.Parse( lines.Current );

            List<GoldenVector4D> vertices = new List<GoldenVector4D>();
            for( int i = 0; i < numVertices; i++ )
            {
                lines.MoveNext();
                GoldenVector4D v = new GoldenVector4D();
                v.ReadVector( lines.Current );
                vertices.Add( v );
            }

            lines.MoveNext();
            int numEdges = int.Parse( lines.Current );
            List<Edge> edges = new List<Edge>();
            for( int i = 0; i < numEdges; i++ )
            {
                lines.MoveNext();
                Edge e = new Edge();
                e.ReadEdge( lines.Current );
                edges.Add( e );
            }

            this.Vertices = vertices.ToArray();
            this.Edges = edges.ToArray();
        }
Esempio n. 2
0
        public override bool Equals(object obj)
        {
            GoldenVector4D v = (GoldenVector4D)obj;

            return(v == this);
        }