SOFA API  ca665544
Open source framework for multi-physics simuation
sofa::helper::MarchingCubeUtility Class Reference

#include <MarchingCubeUtility.h>

Public Member Functions

 SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER (Vec3i, sofa::type::Vec3i)
 
 SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER (Vec6i, sofa::type::Vec6i)
 
 SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER (Vector3, sofa::type::Vec3)
 
 SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER (Real, SReal)
 
 MarchingCubeUtility ()
 
 ~MarchingCubeUtility ()
 
void setDataResolution (const type::Vec3i &resolution)
 
void setDataVoxelSize (const type::Vec3 &voxelSize)
 
void setStep (const unsigned int step)
 
void setConvolutionSize (const unsigned int convolutionSize)
 
void setBoundingBoxFromRealCoords (const type::Vec3 &min, const type::Vec3 &max)
 Set the bounding box from real coords to apply mCube locally. More...
 
void setROI (const type::Vec3i &min, const type::Vec3i &max)
 Set the bounding box (in the data space) to apply mCube locally. More...
 
void setBoundingBox (const type::Vec6i &roi)
 Set the bounding box (in the data space) to apply mCube locally. More...
 
void setBoundingBox (const type::Vec3i &min, const type::Vec3i &max)
 Set the bounding box (in the data space) to apply mCube locally. More...
 
void run (unsigned char *data, const float isolevel, sofa::type::vector< PointID > &triangles, sofa::type::vector< type::Vec3 > &vertices, type::vector< type::vector< unsigned int > > *triangleIndexInRegularGrid=nullptr) const
 
void run (unsigned char *_data, const sofa::type::vector< type::Vec3i > &seeds, const float isolevel, sofa::type::vector< PointID > &mesh, sofa::type::vector< type::Vec3 > &vertices, std::map< type::Vec3, PointID > &map_vertices, type::vector< type::vector< unsigned int > > *triangleIndexInRegularGrid, bool propagate) const
 
void run (unsigned char *data, const vector< type::Vec3i > &seeds, const float isolevel, sofa::type::vector< PointID > &triangles, sofa::type::vector< type::Vec3 > &vertices, type::vector< type::vector< unsigned int > > *triangleIndexInRegularGrid=nullptr, bool propagate=true) const
 
void run (unsigned char *data, const float isolevel, sofa::helper::io::Mesh &m) const
 
void findSeeds (vector< type::Vec3i > &seeds, const float isoValue, unsigned char *_data)
 given a set of data, find seeds to run quickly. More...
 
void findSeedsFromRealCoords (vector< type::Vec3i > &mCubeCoords, const vector< type::Vec3 > &realCoords) const
 Given coords in the scene, find seeds coords. More...
 
void setVerticesIndexOffset (unsigned int verticesIndexOffset)
 Set the offset to add to each new vertex index in the triangles array. More...
 
void setVerticesTranslation (type::Vec3 verticesTranslation)
 Set the translation to add to each new vertex in the triangles array. More...
 

Constructor details

◆ MarchingCubeUtility()

sofa::helper::MarchingCubeUtility::MarchingCubeUtility ( )

◆ ~MarchingCubeUtility()

sofa::helper::MarchingCubeUtility::~MarchingCubeUtility ( )
inline

Function details

◆ findSeeds()

void sofa::helper::MarchingCubeUtility::findSeeds ( vector< type::Vec3i > &  seeds,
const float  isoValue,
unsigned char _data 
)

given a set of data, find seeds to run quickly.

◆ findSeedsFromRealCoords()

void sofa::helper::MarchingCubeUtility::findSeedsFromRealCoords ( vector< type::Vec3i > &  mCubeCoords,
const vector< type::Vec3 > &  realCoords 
) const

Given coords in the scene, find seeds coords.

◆ run() [1/4]

void sofa::helper::MarchingCubeUtility::run ( unsigned char _data,
const sofa::type::vector< type::Vec3i > &  seeds,
const float  isolevel,
sofa::type::vector< PointID > &  mesh,
sofa::type::vector< type::Vec3 > &  vertices,
std::map< type::Vec3, PointID > &  map_vertices,
type::vector< type::vector< unsigned int > > *  triangleIndexInRegularGrid,
bool  propagate 
) const

Same as the previous function but the surfaces are constructed by propagating from seeds. Faster than previous but it need the precomputation of the seeds.

◆ run() [2/4]

void sofa::helper::MarchingCubeUtility::run ( unsigned char data,
const float  isolevel,
sofa::helper::io::Mesh m 
) const

given a set of data (size of the data and size of the marching cube beeing defined previously), we construct a Sofa mesh.

◆ run() [3/4]

void sofa::helper::MarchingCubeUtility::run ( unsigned char data,
const float  isolevel,
sofa::type::vector< PointID > &  triangles,
sofa::type::vector< type::Vec3 > &  vertices,
type::vector< type::vector< unsigned int > > *  triangleIndexInRegularGrid = nullptr 
) const

given a set of data (size of the data and size of the marching cube beeing defined previously), we construct the surface. mesh is a vector containing the triangles defined as a sequence of three indices map_indices gives the correspondence between an indice and a 3d position in space

◆ run() [4/4]

void sofa::helper::MarchingCubeUtility::run ( unsigned char data,
const vector< type::Vec3i > &  seeds,
const float  isolevel,
sofa::type::vector< PointID > &  triangles,
sofa::type::vector< type::Vec3 > &  vertices,
type::vector< type::vector< unsigned int > > *  triangleIndexInRegularGrid = nullptr,
bool  propagate = true 
) const

Same as the previous function but the surfaces are constructed by propagating from seeds. Faster than previous but it need the precomputation of the seeds.

◆ setBoundingBox() [1/2]

void sofa::helper::MarchingCubeUtility::setBoundingBox ( const type::Vec3i min,
const type::Vec3i max 
)
inline

Set the bounding box (in the data space) to apply mCube locally.

◆ setBoundingBox() [2/2]

void sofa::helper::MarchingCubeUtility::setBoundingBox ( const type::Vec6i roi)
inline

Set the bounding box (in the data space) to apply mCube locally.

◆ setBoundingBoxFromRealCoords()

void sofa::helper::MarchingCubeUtility::setBoundingBoxFromRealCoords ( const type::Vec3 min,
const type::Vec3 max 
)
inline

Set the bounding box from real coords to apply mCube locally.

◆ setConvolutionSize()

void sofa::helper::MarchingCubeUtility::setConvolutionSize ( const unsigned int  convolutionSize)
inline

◆ setDataResolution()

void sofa::helper::MarchingCubeUtility::setDataResolution ( const type::Vec3i resolution)
inline

◆ setDataVoxelSize()

void sofa::helper::MarchingCubeUtility::setDataVoxelSize ( const type::Vec3 voxelSize)
inline

◆ setROI()

void sofa::helper::MarchingCubeUtility::setROI ( const type::Vec3i min,
const type::Vec3i max 
)
inline

Set the bounding box (in the data space) to apply mCube locally.

◆ setStep()

void sofa::helper::MarchingCubeUtility::setStep ( const unsigned int  step)
inline

◆ setVerticesIndexOffset()

void sofa::helper::MarchingCubeUtility::setVerticesIndexOffset ( unsigned int  verticesIndexOffset)

Set the offset to add to each new vertex index in the triangles array.

◆ setVerticesTranslation()

void sofa::helper::MarchingCubeUtility::setVerticesTranslation ( type::Vec3  verticesTranslation)

Set the translation to add to each new vertex in the triangles array.

◆ SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER() [1/4]

sofa::helper::MarchingCubeUtility::SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER ( Real  ,
SReal   
)

◆ SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER() [2/4]

sofa::helper::MarchingCubeUtility::SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER ( Vec3i  ,
sofa::type::Vec3i   
)

◆ SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER() [3/4]

sofa::helper::MarchingCubeUtility::SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER ( Vec6i  ,
sofa::type::Vec6i   
)

◆ SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER() [4/4]

sofa::helper::MarchingCubeUtility::SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER ( Vector3  ,
sofa::type::Vec3   
)