voxelTerrain
 All Classes Functions Variables Typedefs Enumerations Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
blub::procedural::voxel::edit::axisAlignedBox< configType > Class Template Reference

insertes/removes voxels that are included in an blub::axisAlignedBox. Always axis-aligned - use box if you want to rotate. More...

#include <axisAlignedBox.hpp>

Inheritance diagram for blub::procedural::voxel::edit::axisAlignedBox< configType >:
blub::procedural::voxel::edit::base< configType > blub::enableSharedFromThis< base< configType > > blub::noncopyable

Public Types

typedef configType t_config
 
typedef base< configType > t_base
 
typedef sharedPointer
< axisAlignedBox
pointer
 
typedef t_config::t_data t_voxel
 
- Public Types inherited from blub::procedural::voxel::edit::base< configType >
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
 
- Public Types inherited from blub::enableSharedFromThis< base< configType > >
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
 

Public Member Functions

virtual ~axisAlignedBox ()
 Destructor.
 
void setAxisAlignedBox (const ::blub::axisAlignedBox &desc)
 Changes the voxel-describing bounding-box. DON'T change it while class is generating voxel. Else incorrect and incosinstent voxel will get created. More...
 
const ::blub::axisAlignedBoxgetAxisAlignedBox () const
 Returns the describing blub::axisAlignedBox set by constructor or by setAxisAlignedBox(). More...
 
- Public Member Functions inherited from blub::procedural::voxel::edit::base< configType >
virtual ~base ()
 destructor
 
void calculateVoxel (const transform &trans) const
 calculates voxel in the container u have to set by setVoxelContainer() before. If setVoxelContainer() didn't get called before, method will assert. More...
 
virtual void calculateVoxel (t_voxelContainerTile *voxelContainer, const vector3int32 &voxelContainerOffset, const transform &trans) const
 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. More...
 
void setCut (const bool &cut)
 Enable or disable cut. Don't change the value while active calculation. More...
 
const bool & getCut () const
 Returns if cutting is enabled. More...
 
void setVoxelContainer (t_voxelContainerSimple *toSet)
 Sets the voxelcontainer used by calculateVoxel(). More...
 
t_voxelContainerSimple * getVoxelContainer () const
 
- Public Member Functions inherited from blub::enableSharedFromThis< base< configType > >
t_thisPtrConst getSharedThisPtr () const
 
t_thisPtr getSharedThisPtr ()
 

Static Public Member Functions

static pointer create (const ::blub::axisAlignedBox &desc)
 Allocates an instance and initialises the class. More...
 

Protected Member Functions

blub::axisAlignedBox getAxisAlignedBoundingBox (const transform &trans) const override
 returns the bounding box describing the voxel to be recalculated More...
 
bool calculateOneVoxel (const vector3 &pos, t_voxel *resultVoxel) const override
 checks if voxel is inside aab More...
 
- Protected Member Functions inherited from blub::procedural::voxel::edit::base< configType >
virtual void createLine (t_voxelContainerTile *voxelContainer, const vector3int32 &posVoxel, const real &from, const real &len, const axis &ax, const blub::plane &planeA, const blub::plane &planeB) const
 createLine creates a voxel-line on one axis with a specific length More...
 

Additional Inherited Members

- Protected Types inherited from blub::procedural::voxel::edit::base< configType >
enum  axis { x, y, z }
 The axis enum is used by createLine() for describing the direction.
 
- Protected Attributes inherited from blub::procedural::voxel::edit::base< configType >
t_voxelContainerSimple * m_voxelContainer
 
bool m_cut
 

Detailed Description

template<class configType>
class blub::procedural::voxel::edit::axisAlignedBox< configType >

insertes/removes voxels that are included in an blub::axisAlignedBox. Always axis-aligned - use box if you want to rotate.

Examples:
customVertexInformation.cpp, and primitives.cpp.

Member Function Documentation

template<class configType >
bool blub::procedural::voxel::edit::axisAlignedBox< configType >::calculateOneVoxel ( const vector3 pos,
t_voxel resultVoxel 
) const
inlineoverrideprotectedvirtual

checks if voxel is inside aab

Parameters
posdescribes the voxel-position
resultVoxelif pos is inside, resultVoxel interpolation gets set to maximum. Must not be nullptr
Returns
true if pos is inside.

Reimplemented from blub::procedural::voxel::edit::base< configType >.

template<class configType >
static pointer blub::procedural::voxel::edit::axisAlignedBox< configType >::create ( const ::blub::axisAlignedBox< configType > &  desc)
inlinestatic

Allocates an instance and initialises the class.

Parameters
descThe axis-aligend-box that describes the to create voxel. desc must be a valid blub::axisAlignedBox.
Returns
Returns an initialised instance
Examples:
customVertexInformation.cpp, and primitives.cpp.
template<class configType >
blub::axisAlignedBox blub::procedural::voxel::edit::axisAlignedBox< configType >::getAxisAlignedBoundingBox ( const transform trans) const
inlineoverrideprotectedvirtual

returns the bounding box describing the voxel to be recalculated

Parameters
transdescribes the tranformation the edit uses

Implements blub::procedural::voxel::edit::base< configType >.

template<class configType >
const ::blub::axisAlignedBox& blub::procedural::voxel::edit::axisAlignedBox< configType >::getAxisAlignedBox ( ) const
inline

Returns the describing blub::axisAlignedBox set by constructor or by setAxisAlignedBox().

Returns
Returns the describing blub::axisAlignedBox
template<class configType >
void blub::procedural::voxel::edit::axisAlignedBox< configType >::setAxisAlignedBox ( const ::blub::axisAlignedBox< configType > &  desc)
inline

Changes the voxel-describing bounding-box. DON'T change it while class is generating voxel. Else incorrect and incosinstent voxel will get created.

Parameters
descThe Voxel descriptor.

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