コード例 #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;
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Reads tokens.
        /// </summary>
        /// <param name="tokens">The tokens.</param>
        /// <param name="index">The index.</param>
        /// <returns>The <see cref="An8LongLat"/> value.</returns>
        internal static An8LongLat ReadTokens(string[] tokens, ref int index)
        {
            var longlat = new An8LongLat();

            longlat.VerticalDivisions   = Tokenizer.ReadInt(tokens, ref index);
            longlat.HorizontalDivisions = Tokenizer.ReadInt(tokens, ref index);

            return(longlat);
        }
コード例 #3
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 "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;
                }
            }
        }