VoxelFarm::CBufferBlockData Class Reference

An implementation of IBlockData for merging a buffer into another IBlockData. More...

#include <BlockData.h>

Inheritance diagram for VoxelFarm::CBufferBlockData:
VoxelFarm::IBlockData

Public Member Functions

 CBufferBlockData (IBlockData *blockData)
 
void merge (TSet< CellId > *changedCells)
 Merge the data in blockCache with the data in blockData and returns the affected cells in changedCells.
 
virtual void setBlock (CellId &cell, int &x, int &y, int &z, int material, double dx, double dy, double dz, TSet< CellId > *changedCells)
 Sets a value for a voxel. More...
 
virtual void getBlock (CellId cell, int x, int y, int z, int &material, double &dx, double &dy, double &dz)
 Gets the value of a voxel. More...
 
virtual void beginChanges ()
 Sets a marker for a change set that can be undone.
 
virtual void trackCellChanges (CellId cell, const BlockVoxelData *blockData)
 Requests changes made to a cell to be remembered so they can be undone.
 
virtual void endChanges ()
 Closes the marker for a change set that can be undone.
 
virtual BlockVoxelDatafetchData (CellId cell, bool create)
 Returns the voxel data buffer for the specified cell. This is a synchronous call. More...
 
virtual BlockVoxelDatafetchCacheData (CellId cell, bool create)
 Returns a cache voxel data buffer for the specified cell. More...
 

Detailed Description

An implementation of IBlockData for merging a buffer into another IBlockData.

Definition at line 111 of file BlockData.h.

Member Function Documentation

virtual BlockVoxelData* VoxelFarm::CBufferBlockData::fetchCacheData ( CellId  cell,
bool  create 
)
virtual

Returns a cache voxel data buffer for the specified cell.

Parameters
cellCell ID for the cell to be retrieved
createIf set to true will create an empty cell buffer if no buffer is found for the cell

Implements VoxelFarm::IBlockData.

virtual BlockVoxelData* VoxelFarm::CBufferBlockData::fetchData ( CellId  cell,
bool  create 
)
virtual

Returns the voxel data buffer for the specified cell. This is a synchronous call.

Parameters
cellCell ID for the cell to be retrieved
createIf set to TRUE will create an empty cell buffer if no buffer is found for the cell

Implements VoxelFarm::IBlockData.

virtual void VoxelFarm::CBufferBlockData::getBlock ( CellId  cell,
int  x,
int  y,
int  z,
int &  material,
double &  dx,
double &  dy,
double &  dz 
)
virtual

Gets the value of a voxel.

Parameters
cellID for the cell containing the voxel to be read
xX coordinates for a voxel relative to the origin of the Cell
yY coordinates for a voxel relative to the origin of the Cell
zZ coordinates for a voxel relative to the origin of the Cell
materialWill contain the material ID for the voxel when the call returns
dxWill contain X coordinates of the inner-voxel point, relative to the origin of the voxel, when the call returns
dyWill contain Y coordinates of the inner-voxel point, relative to the origin of the voxel, when the call returns
dzWill contain Z coordinates of the inner-voxel point, relative to the origin of the voxel, when the call returns
virtual void VoxelFarm::CBufferBlockData::setBlock ( CellId cell,
int &  x,
int &  y,
int &  z,
int  material,
double  dx,
double  dy,
double  dz,
TSet< CellId > *  changedCells 
)
virtual

Sets a value for a voxel.

Parameters
cellID for the cell containing the voxel to be set
xX coordinates for a voxel relative to the origin of the Cell
yY coordinates for a voxel relative to the origin of the Cell
zZ coordinates for a voxel relative to the origin of the Cell
materialID for material being set.
dxX coordinates of the inner-voxel point, relative to the origin of the voxel
dyY coordinates of the inner-voxel point, relative to the origin of the voxel
dzZ coordinates of the inner-voxel point, relative to the origin of the voxel

Implements VoxelFarm::IBlockData.


The documentation for this class was generated from the following file: