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); } } }
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); } } }
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); } }
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); } } }