base class of all edits. Has various features you may wanna overwrite. If you want to write your own edit overwrite the method calculateOneVoxel() or calculateVoxel(). For most flexibility override calculateVoxel(). Because base derives enableSharedFromThis you have to write a create method that creates a shared_ptr of the class.
More...
#include <base.hpp>
|
typedef configType | t_config |
|
typedef enableSharedFromThis
< base< t_config > > | t_base |
|
typedef sharedPointer< base
< t_config > > | pointer |
|
typedef
t_config::t_container::t_simple | t_voxelContainerSimple |
|
typedef
t_config::t_container::t_tile | t_voxelContainerTile |
|
typedef t_config::t_data | t_voxel |
|
typedef
std::enable_shared_from_this
< base< configType > > | t_base |
|
typedef blub::sharedPointer
< base< configType >const > | t_thisPtrConst |
|
typedef blub::sharedPointer
< base< configType > > | t_thisPtr |
|
|
enum | axis { x,
y,
z
} |
| The axis enum is used by createLine() for describing the direction.
|
|
|
t_voxelContainerSimple * | m_voxelContainer |
|
bool | m_cut |
|
template<class configType>
class blub::procedural::voxel::edit::base< configType >
base class of all edits. Has various features you may wanna overwrite. If you want to write your own edit overwrite the method calculateOneVoxel() or calculateVoxel(). For most flexibility override calculateVoxel(). Because base derives enableSharedFromThis you have to write a create method that creates a shared_ptr of the class.
- Examples:
- mesh.cpp.
template<class configType>
template<class configType>
template<class configType>
calculates all voxel in getAxisAlignedBoundingBox() and inserts them into voxelContainer. Method gets called once per tile from various threads. Voxel only will get set if the interpolation is higher than the inerpoaltion before calculation.
- Parameters
-
voxelContainer | The container where the voxel have to get set in. |
voxelContainerOffset | The absolut offset of the container |
trans | The transform of the edit. |
Reimplemented in blub::procedural::voxel::edit::box< voxelType >.
template<class configType>
createLine creates a voxel-line on one axis with a specific length
- Parameters
-
voxelContainer | Where to create the line in. Must not be nullptr |
posVoxel | The relative voxel position in 2d. The value definied by ax will be ignored. |
from | Start value from where to start the line. Not a an integer because of interpolation. |
len | length value added to start of the line. Not a an integer because of interpolation. Must be larger/equal zero |
ax | The axis on which the line should get generated |
planeA | first cutPlane. See blub::procedural::voxel::edit::box for usage. Used for interpolation. |
planeB | second cutPlane. See blub::procedural::voxel::edit::box for usage. Used for interpolation. |
template<class configType>
template<class configType>
Returns if cutting is enabled.
- Returns
- Returns the setted value by setCut() or default false.
template<class configType>
template<class configType>
Enable or disable cut. Don't change the value while active calculation.
- Parameters
-
cut | If true voxel will get removed instead in added. |
template<class configType>
Sets the voxelcontainer used by calculateVoxel().
- Parameters
-
toSet | Must not be nullptr. |
The documentation for this class was generated from the following files:
- /home/mlanner/Development/cpp/projects/voxelTerrain/voxelTerrain/modules/procedural/source/blub/procedural/predecl.hpp
- /home/mlanner/Development/cpp/projects/voxelTerrain/voxelTerrain/modules/procedural/source/blub/procedural/voxel/edit/base.hpp