AoMEngineLibrary.Graphics.Grn.Nodes.GrnMeshTrianglesNode.CreateFolderFile C# (CSharp) Method

CreateFolderFile() public method

public CreateFolderFile ( string folder ) : void
folder string
return void
        public override void CreateFolderFile(string folder)
        {
            XDocument doc = new XDocument();
            XElement root = new XElement("meshTriangles", new XAttribute("count", this.Faces.Count));
            doc.Add(root);

            for (int i = 0; i < this.Faces.Count; ++i)
            {
                XElement face = new XElement("face", new XAttribute("index", i));
                root.Add(face);
                for (int j = 0; j < this.Faces[i].Indices.Count; ++j)
                {
                    face.Add(new XElement("index", this.Faces[i].Indices[j]));
                }
                for (int j = 0; j < this.Faces[i].NormalIndices.Count; ++j)
                {
                    face.Add(new XElement("normalIndex", this.Faces[i].NormalIndices[j]));
                }
            }

            string fileName = System.IO.Path.Combine(folder, "meshTriangles.xml");
            using (FileStream stream = System.IO.File.Create(fileName))
            {
                doc.Save(stream);
            }
        }