示例#1
0
        /// <summary>
        /// Parses the tokens of the chunk.
        /// </summary>
        /// <param name="tokens">The tokens.</param>
        internal override void ParseTokens(string[] tokens)
        {
            base.ParseTokens(tokens);

            var chunks = Tokenizer.SplitChunks(tokens);

            foreach (var chunk in chunks)
            {
                int index = 0;

                switch (chunk.Ident)
                {
                case "material":
                {
                    var material = new An8Material();
                    material.ParseTokens(chunk.Tokens);
                    this.Material = material;
                    break;
                }

                case "longlat":
                    this.Geodesic         = null;
                    this.LongLatDivisions = An8LongLat.ReadTokens(chunk.Tokens, ref index);
                    break;

                case "geodesic":
                    this.LongLatDivisions = null;
                    this.Geodesic         = Tokenizer.ReadInt(chunk.Tokens, ref index);
                    break;
                }
            }
        }
        /// <summary>
        /// Parses the tokens of the chunk.
        /// </summary>
        /// <param name="tokens">The tokens.</param>
        internal override void ParseTokens(string[] tokens)
        {
            base.ParseTokens(tokens);

            var chunks = Tokenizer.SplitChunks(tokens);

            foreach (var chunk in chunks)
            {
                int index = 0;

                switch (chunk.Ident)
                {
                case "material":
                {
                    var material = new An8Material();
                    material.ParseTokens(chunk.Tokens);
                    this.Material = material;
                    break;
                }

                case "length":
                    this.Length = Tokenizer.ReadFloat(chunk.Tokens, ref index);
                    break;

                case "diameter":
                    this.Diameter = Tokenizer.ReadFloat(chunk.Tokens, ref index);
                    break;

                case "topdiameter":
                    this.TopDiameter = Tokenizer.ReadFloat(chunk.Tokens, ref index);
                    break;

                case "longlat":
                    this.LongLatDivisions = An8LongLat.ReadTokens(chunk.Tokens, ref index);
                    break;

                case "capstart":
                    this.IsStartCapped = true;
                    break;

                case "capend":
                    this.IsEndCapped = true;
                    break;
                }
            }
        }