Example #1
0
 public static void WriteVoxel(BinaryWriter writer, Voxel voxel)
 {
     Point.WritePoint(writer, voxel.coord);
     //write the number of cells in here
     writer.Write(voxel.cells.Count);
     //followed by each cell
     foreach (int cellnum in voxel.cells)
     {
         writer.Write(cellnum);
     }
 }
Example #2
0
        /// <summary>
        /// Requires filepath WITHOUT the extension. Weird, and not
        /// constant across the program I know, but thats only because
        /// </summary>
        /// <param name="filePath"></param>
        public void WriteIntermediateToFile(string filePath)
        {
            if (verts.Count <= 0)
            {
                DebugLog.logConsole(filePath + " vertices do not exists");
                return;
            }
            //weld the verts before writing
            makeUnique();
            FileStream   stream = File.Create(filePath);
            BinaryWriter writer = new BinaryWriter(stream);

            writer.Write(verts.Count);
            for (int i = 0; i < verts.Count; i++)
            {
                Point.WritePoint(writer, verts[i]);
            }
            writer.Write(tris.Count);
            for (int i = 0; i < tris.Count; i++)
            {
                writer.Write(tris[i]);
            }
        }
Example #3
0
 public static void WriteCell(BinaryWriter writer, AttCoordCell cell)
 {
     FieldCell.WriteCell(writer, cell.fieldCell);
     Point.WritePoint(writer, cell.coords);
 }
Example #4
0
 /// <summary>
 /// Given a binary writer and a cell, writes the cell to a
 /// file using the writer
 /// </summary>
 /// <param name="writer"></param>
 /// <param name="cell"></param>
 public static void WriteCell(BinaryWriter writer, NumCoordCell cell)
 {
     writer.Write(cell.cellNumber);
     Point.WritePoint(writer, cell.coords);
 }