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

convertes a mesh to voxel. Fills a boost::geometry::index::rtree with the polygons. Initialization O(numTriangles). Voxel-generation O(numVoxel) More...

#include <mesh.hpp>

Inheritance diagram for blub::procedural::voxel::edit::mesh< voxelType >:
blub::procedural::voxel::edit::base< voxelType > blub::enableSharedFromThis< base< voxelType > > blub::noncopyable

Public Types

typedef sharedPointer< mesh
< voxelType > > 
pointer
 
typedef base< voxelType > t_base
 
typedef tile::container
< voxelType > 
t_tileContainer
 
typedef
boost::geometry::model::point
< real,
3, boost::geometry::cs::cartesian > 
t_point
 
typedef
boost::geometry::model::box
< t_point > 
t_box
 
typedef
boost::geometry::model::segment
< t_point > 
t_segment
 
typedef std::pair< t_box,
triangleVector3
t_value
 
typedef
boost::geometry::index::rtree
< t_value,
boost::geometry::index::quadratic< 16 > > 
t_tree
 
- Public Types inherited from blub::procedural::voxel::edit::base< voxelType >
typedef voxelType 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< voxelType > >
typedef
std::enable_shared_from_this
< base< voxelType > > 
t_base
 
typedef blub::sharedPointer
< base< voxelType >const > 
t_thisPtrConst
 
typedef blub::sharedPointer
< base< voxelType > > 
t_thisPtr
 

Public Member Functions

virtual ~mesh ()
 ~mesh destructor
 
- Public Member Functions inherited from blub::procedural::voxel::edit::base< voxelType >
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< voxelType > >
t_thisPtrConst getSharedThisPtr () const
 
t_thisPtr getSharedThisPtr ()
 

Static Public Member Functions

static pointer create ()
 creates an instance of the class. More...
 

Protected Types

typedef vector< t_tree * > t_trees
 
- Protected Types inherited from blub::procedural::voxel::edit::base< voxelType >
enum  axis
 The axis enum is used by createLine() for describing the direction.
 

Protected Member Functions

 mesh ()
 mesh contructor
 
blub::axisAlignedBox getAxisAlignedBoundingBox (const transform &trans) const override
 getAxisAlignedBoundingBox returns the transformed bounding box that includes the mesh. More...
 
void calculateVoxel (t_tileContainer *voxelContainer, const vector3int32 &voxelContainerOffset, const transform &) const
 calculateVoxel The tree, which got generated in load() gets intersected for every voxel line. More...
 
- Protected Member Functions inherited from blub::procedural::voxel::edit::base< voxelType >
virtual bool calculateOneVoxel (const vector3 &pos, t_voxel *resultVoxel) const
 Implement this method for your own edit. More...
 
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...
 

Protected Attributes

t_trees m_trees
 
blub::axisAlignedBox m_aabb
 
- Protected Attributes inherited from blub::procedural::voxel::edit::base< voxelType >
t_voxelContainerSimple * m_voxelContainer
 
bool m_cut
 

Detailed Description

template<class voxelType>
class blub::procedural::voxel::edit::mesh< voxelType >

convertes a mesh to voxel. Fills a boost::geometry::index::rtree with the polygons. Initialization O(numTriangles). Voxel-generation O(numVoxel)

Examples:
mesh.cpp.

Member Function Documentation

template<class voxelType>
void blub::procedural::voxel::edit::mesh< voxelType >::calculateVoxel ( t_tileContainer voxelContainer,
const vector3int32 voxelContainerOffset,
const transform  
) const
inlineprotected

calculateVoxel The tree, which got generated in load() gets intersected for every voxel line.

Parameters
voxelContainerContainer where to set the voxel in.
voxelContainerOffsetAbsolut position of the voxelContainer.
transTransform
template<class voxelType>
static pointer blub::procedural::voxel::edit::mesh< voxelType >::create ( )
inlinestatic

creates an instance of the class.

Returns
a shared_ptr of an instance
template<class voxelType>
blub::axisAlignedBox blub::procedural::voxel::edit::mesh< voxelType >::getAxisAlignedBoundingBox ( const transform trans) const
inlineoverrideprotectedvirtual

getAxisAlignedBoundingBox returns the transformed bounding box that includes the mesh.

Parameters
transTransform of edit
Returns

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


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