Exemplo n.º 1
0
        private static VRMLInfo LoadInternal(string[] lines)
        {
            Vector3D[] points = null;
            VRMLInfo   result = new VRMLInfo();
            Vector3D   dx = new Vector3D(), dy = new Vector3D(), dz = new Vector3D();

            string pointStart = vrml_point + vrml_arrayStart;
            string polyStart  = vrml_coordIndex + vrml_arrayStart;

            int current = 0;

            while (current < lines.Length && result.Polygons == null)
            {
                string cleaned = CleanupLine(lines[current]);

                if (cleaned.StartsWith(vrml_field))
                {
                    LoadField(cleaned, ref dx, ref dy, ref dz);
                }

                if (cleaned.EndsWith(pointStart))
                {
                    points = LoadPoints(lines, ref current);
                }

                if (cleaned.EndsWith(polyStart))
                {
                    // Once we load this, we're done.
                    result.Polygons = LoadPolygons(points, lines, ref current);
                    break;
                }

                current++;
            }

            result.DX = dx;
            result.DY = dy;
            result.DZ = dz;
            return(result);
        }
Exemplo n.º 2
0
        private static VRMLInfo LoadInternal( string[] lines )
        {
            Vector3D[] points = null;
            VRMLInfo result = new VRMLInfo();
            Vector3D dx = new Vector3D(), dy = new Vector3D(), dz = new Vector3D();

            string pointStart = vrml_point + vrml_arrayStart;
            string polyStart = vrml_coordIndex + vrml_arrayStart;

            int current = 0;
            while( current < lines.Length && result.Polygons == null )
            {
                string cleaned = CleanupLine( lines[current] );

                if( cleaned.StartsWith( vrml_field ) )
                    LoadField( cleaned, ref dx, ref dy, ref dz );

                if( cleaned.EndsWith( pointStart ) )
                    points = LoadPoints( lines, ref current );

                if( cleaned.EndsWith( polyStart ) )
                {
                    // Once we load this, we're done.
                    result.Polygons = LoadPolygons( points, lines, ref current );
                    break;
                }

                current++;
            }

            result.DX = dx;
            result.DY = dy;
            result.DZ = dz;
            return result;
        }