For this use case, we recommend the "VoxelFarm::cursorPaint()" function found in VoxelSmooth.h.
This is the function's declaration:
void cursorPaint(VoxelFarm::CGenerator* generator,
/// A reference to the block layer
/// Specifies the target cell for the operation. Depending on the kernel's size the operation may bleed to neighboring cells
/// Specifies the target location along the X axis, in voxels relative to the origin of the cell
/// Specifies the target location along the Y axis, in voxels relative to the origin of the cell
/// Specifies the target location along the Z axis, in voxels relative to the origin of the cell
/// Kernel dimensions along the X axis
/// Kernel dimensions along the Y axis
/// Kernel dimensions along the Z axis
/// If false the paint cursor will be spherical, if true it will be a cube
/// Material to paint with
/// It translates a given material depending of the position in the world
/// Returns a list of all affected cells during the process
/// returns a list of the volumes of all affected cells during the process
TMap<CellId, CCellData::CInstanceEditionVolume>& volumes
Calling the function will modify the block data, but changes will not have any visual consequences until you ask your ClipmapView instance to actually process the cells that were modified. You can achieve this by calling the clipmapview's "processModifiedCells()" method:
clipmapView.processModifiedCells(changedCells, false, &volumes);
Here "changedCells" and "volumes" are the same as in the "cursorPaint()" function call.
In theory, you could perform many calls to "cursorPaint" and just one call to "processModifiedCells" to make all changes visible. In this case, you must make sure the "changedCells" and "volumes" containers will include the items from all calls to "paintCursor". The "paintCursor" function will accumulate these normally, as long as you do not clear these containers before calling "processModifiedCells" this will have the desired effect.