//Draw stairs to grid public void ScalePut(GridContext bgc, string filename, int x1, int y1, int z1, int x2, int y2, int z2) { if (bgc == null) { return; } MinMax(ref x1, ref x2); MinMax(ref y1, ref y2); MinMax(ref z1, ref z2); string stringCode = ReadGlyc(@"C:\Github\Glyphics2\Glyph Cores\" + filename + ".glyc"); Code code = new Code(stringCode); int width = x2 - x1 + 1; int height = y2 - y1 + 1; int depth = z2 - z1 + 1; Code newCode = CodeConverter.CodeToRescaledCode(code, width, height, depth); Grid newGrid = CodeConverter.CodeToGrid(newCode.codeString); //DrawHollowRect(bgc, x1, y1, z1, x2, y2, z2); CopyInto(bgc, x1, y1, z1, newGrid); }
//Code-To public static Grid CodeToGrid(Code rasterCode) { if (rasterCode == null) { return(null); } return(CodeConverter.CodeToGrid(rasterCode.codeString)); }
//Draw stairs to grid public void PutGroup(GridContext bgc, string filename, int x1, int y1, int z1, byte groupId) { if (bgc == null) { return; } string stringCode = ReadGlyc(filename + ".glyc"); Grid newGrid = CodeConverter.CodeToGrid(stringCode); //DrawHollowRect(bgc, x1, y1, z1, x2, y2, z2); CopyInto(bgc, x1, y1, z1, newGrid, groupId); }
//Draw stairs to grid public void Put(GridContext bgc, string filename, int x1, int y1, int z1) { if (bgc == null) { return; } //@"C:\Github\Glyphics2\Glyph Cores\" + string stringCode = ReadGlyc(filename + ".glyc"); Grid newGrid = CodeConverter.CodeToGrid(stringCode); //DrawHollowRect(bgc, x1, y1, z1, x2, y2, z2); CopyInto(bgc, x1, y1, z1, newGrid); }
//Generates a set of thumbnails of the codeString, down to 1 pixels size public static GridList CodeToThumbnailed(Code code) { GridList gridList = new GridList(); Grid grid = CodeConverter.CodeToGrid(code.codeString); int toX = grid.SizeX; int toY = grid.SizeY; int toZ = grid.SizeZ; while ((toX > 0) && (toY > 0) && (toZ > 0)) { Code newCode = CodeConverter.CodeToRescaledCode(code, toX, toY, toZ); Grid newGrid = CodeConverter.CodeToGrid(newCode.codeString); gridList.AddGrid(newGrid); toX /= 2; toY /= 2; toZ /= 2; } return(gridList); }