igor::iVoxelData Class Reference

#include <iVoxelData.h>

Public Member Functions

 iVoxelData ()=default
 
 ~iVoxelData ()
 
void initData (int64 width, int64 height, int64 depth)
 
void getCopy (iVoxelData &dst)
 
void clear ()
 
int64 getWidth () const
 
int64 getDepth () const
 
int64 getHeight () const
 
void setVoxelDensity (iaVector3I pos, uint8 density)
 
uint8 getVoxelDensity (iaVector3I pos)
 
void setVoxelMaterial (iaVector3I pos, uint8 material)
 
uint8 getVoxelMaterial (iaVector3I pos)
 
iaRLE< uint8, uint8 > & getDensityPole (int64 xDir, int64 zDir)
 
iaRLE< uint8, uint8 > & getMaterialPole (int64 xDir, int64 zDir)
 
void setVoxelLine (iaVector3I pos1, iaVector3I pos2, uint8 density)
 
void getVoxelLine (iaVector3I pos1, iaVector3I pos2, std::vector< uint8 > &dst)
 
void setVoxelPole (iaVector3I pos, int64 height, uint8 density)
 
bool getIntersection (iaVector3I pos, iaVector3I dir, iaVector3I &returnPos, uint8 &returnValue)
 
void setClearValue (uint8 clearValue)
 
uint8 getClearValue () const
 
bool hasData () const
 

Detailed Description

Density is an 8 bit value where 0 means outside of the body and every value >0 lieas within the body. But a value of 1 actually means a density of zero too only that it will generate a body with zero volume. This way we can generate slopes down to a volume of zero or walls with a thickness of zero.

Constructor & Destructor Documentation

◆ iVoxelData()

igor::iVoxelData::iVoxelData ( )
default

does nothing

◆ ~iVoxelData()

igor::iVoxelData::~iVoxelData ( )

release memory

Member Function Documentation

◆ clear()

void igor::iVoxelData::clear ( )

does same as initData but keeps the preset width height and depht

◆ getClearValue()

uint8 igor::iVoxelData::getClearValue ( ) const

◆ getCopy()

void igor::iVoxelData::getCopy ( iVoxelData dst)

◆ getDensityPole()

iaRLE< uint8, uint8 > & igor::iVoxelData::getDensityPole ( int64  xDir,
int64  zDir 
)

◆ getDepth()

int64 igor::iVoxelData::getDepth ( ) const
Returns
depth of voxel data

◆ getHeight()

int64 igor::iVoxelData::getHeight ( ) const
Returns
height of voxel data

◆ getIntersection()

bool igor::iVoxelData::getIntersection ( iaVector3I  pos,
iaVector3I  dir,
iaVector3I returnPos,
uint8 returnValue 
)

◆ getMaterialPole()

iaRLE< uint8, uint8 > & igor::iVoxelData::getMaterialPole ( int64  xDir,
int64  zDir 
)

◆ getVoxelDensity()

uint8 igor::iVoxelData::getVoxelDensity ( iaVector3I  pos)
Returns
density of specified voxel
Parameters
posthe voxel to get the density from

◆ getVoxelLine()

void igor::iVoxelData::getVoxelLine ( iaVector3I  pos1,
iaVector3I  pos2,
std::vector< uint8 > &  dst 
)

reads a line of densities from the voxels

Parameters
pos1the from position of the line
pos2the to position of the line
[out]dstthe destination vector

◆ getVoxelMaterial()

uint8 igor::iVoxelData::getVoxelMaterial ( iaVector3I  pos)

◆ getWidth()

int64 igor::iVoxelData::getWidth ( ) const
Returns
width of voxel data

◆ hasData()

bool igor::iVoxelData::hasData ( ) const

◆ initData()

void igor::iVoxelData::initData ( int64  width,
int64  height,
int64  depth 
)

specifies size of voxel data and allocates memory

Parameters
widthwidth of voxel grid in voxels in x direction
heightheight of voxel grid in voxels in y direction
depthdepth of voxel grid in voxels in z direction

!!! ATTENTION this method must be called before any other method is called

◆ setClearValue()

void igor::iVoxelData::setClearValue ( uint8  clearValue)

◆ setVoxelDensity()

void igor::iVoxelData::setVoxelDensity ( iaVector3I  pos,
uint8  density 
)

sets density of specified voxel

Parameters
posthe voxel to change the density
densitythe new density (see explanation above)

◆ setVoxelLine()

void igor::iVoxelData::setVoxelLine ( iaVector3I  pos1,
iaVector3I  pos2,
uint8  density 
)

sets a line of voxels to a target density

Parameters
pos1the from pos
pos2the to pos
densitythe density to set

◆ setVoxelMaterial()

void igor::iVoxelData::setVoxelMaterial ( iaVector3I  pos,
uint8  material 
)

◆ setVoxelPole()

void igor::iVoxelData::setVoxelPole ( iaVector3I  pos,
int64  height,
uint8  density 
)

sets density of specified vertical voxel pole

Parameters
posstart pos of the pole in voxel coordinates
heightheight of the pole
densitythe new density (see explanation above)

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