MultiProcessing3D<OriginalGenerator,MutableGenerator>::MultiProcessing3D (
        OriginalGenerator& generator_,
        std::vector<MultiBlock3D*> multiBlocks_ )
    : generator(generator_),
      multiBlocks(multiBlocks_)
{
    PLB_PRECONDITION( multiBlocks.size()>=1 );
    firstMultiBlock = multiBlocks[0];

    // Subdivide the original generator into smaller generators which act
    //   on the intersection of all implied blocks. At this stage, all coordinates
    //   are global, thus relative to the multi-block, not to the individual
    //   atomic-blocks.
    subdivideGenerator();

    // Then, convert coordinates from a global representation to a local one,
    //   relative to the atomoic-blocks of the first multi-block.
    adjustCoordinates();
}
void TextRender::printChar(Point *p, TextOrientation orientation, unsigned char depth, const char c) {
    Voxel v;
    unsigned char w, h, d, column, width, height, *x, *y, *z, glyphBuffer[font->getGlyphLength()];
    x = y = z = 0;
    width = font->getCharacterWidth();
    height = font->getCharacterHeight();
    font->readGlyphData(glyphBuffer, c);
    adjustCoordinates(p, orientation, &x, &y, &z);
    for (w = 0; w < width; w++) {
        column = glyphBuffer[w];
        for (h = 0; h < height; h++) {
            if ((column & (0x01 << h)) != 0) {
                v.state = ON;
            } else {
                v.state = OFF;
            }
            for (d = 0; d < depth; d++) {
                cube->writeVoxel(*x + w, *y + h, *z + d, v.state);
            }
        }
    }
}