Example #1
0
        public void Parse(XmlNode node)
        {
            foreach (XmlAttribute a in node.Attributes)
            {
                if (a.Name.ToLower() == "type")
                {
                    type = a.Value;
                }
                else if (a.Name.ToLower() == "name")
                {
                    Name = a.Value;
                }
            }

            foreach (XmlNode child in node.ChildNodes)
            {
                string name = child.Name.ToLower();

                if (name == "shape")
                {
                    var shape = new TCNShape();
                    shape.Parse(child);
                    Shapes.Add(shape);
                }
            }
        }
Example #2
0
        public void Parse(XmlNode node)
        {
            foreach (XmlAttribute a in node.Attributes)
            {
                if (a.Name.ToLower() == "texture")
                {
                    texture = a.Value;
                }
            }

            foreach (XmlNode child in node.ChildNodes)
            {
                string name = child.Name.ToLower();

                if (name == "baseclass")
                {
                    BaseClass = child.InnerText;
                }
                else if (name == "geometry")
                {
                    TCNFolder rootFolder = new TCNFolder();

                    foreach (XmlNode folderChild in child.ChildNodes)
                    {
                        if (folderChild.Name.ToLower() == "folder")
                        {
                            var folder = new TCNFolder();
                            folder.Parse(folderChild);
                            Geometry.Add(folder);
                        }
                        else if (folderChild.Name.ToLower() == "shape")
                        {
                            var shape = new TCNShape();
                            shape.Parse(folderChild);
                            rootFolder.Shapes.Add(shape);
                        }
                    }

                    if (rootFolder.Shapes.Count != 0)
                    {
                        Geometry.Add(rootFolder);
                    }
                }
                else if (name == "glscale")
                {
                    GlScale = Mesh.StringToVertex3(child.InnerText);
                }
                else if (name == "name")
                {
                    Name = child.InnerText;
                }
                else if (name == "texturesize")
                {
                    TextureSize = Mesh.StringToVertex2(child.InnerText);
                }
            }
        }
Example #3
0
        public void Parse(XmlNode node)
        {
            foreach (XmlAttribute a in node.Attributes)
            {
                if (a.Name.ToLower() == "texture")
                    texture = a.Value;
            }

            foreach (XmlNode child in node.ChildNodes)
            {
                string name = child.Name.ToLower();

                if (name == "baseclass")
                    BaseClass = child.InnerText;
                else if (name == "geometry")
                {
                    TCNFolder rootFolder = new TCNFolder();

                    foreach (XmlNode folderChild in child.ChildNodes)
                    {
                        if (folderChild.Name.ToLower() == "folder")
                        {
                            var folder = new TCNFolder();
                            folder.Parse(folderChild);
                            Geometry.Add(folder);
                        }
                        else if (folderChild.Name.ToLower() == "shape")
                        {
                            var shape = new TCNShape();
                            shape.Parse(folderChild);
                            rootFolder.Shapes.Add(shape);
                        }
                    }

                    if (rootFolder.Shapes.Count != 0)
                        Geometry.Add(rootFolder);
                }
                else if (name == "glscale")
                    GlScale = Mesh.StringToVertex3(child.InnerText);
                else if (name == "name")
                    Name = child.InnerText;
                else if (name == "texturesize")
                    TextureSize = Mesh.StringToVertex2(child.InnerText);
            }
        }
Example #4
0
        public void Parse(XmlNode node)
        {
            foreach (XmlAttribute a in node.Attributes)
            {
                if (a.Name.ToLower() == "type")
                    type = a.Value;
                else if (a.Name.ToLower() == "name")
                    Name = a.Value;
            }

            foreach (XmlNode child in node.ChildNodes)
            {
                string name = child.Name.ToLower();

                if (name == "shape")
                {
                    var shape = new TCNShape();
                    shape.Parse(child);
                    Shapes.Add(shape);
                }
            }
        }