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

#include <MarchingCubeUtility.h>

Public Member Functions

 MarchingCubeUtility ()
 
 ~MarchingCubeUtility ()
 
void setDataResolution (const Vec3i &resolution)
 
void setDataVoxelSize (const Vector3 &voxelSize)
 
void setStep (const unsigned int step)
 
void setConvolutionSize (const unsigned int convolutionSize)
 
void setBoundingBoxFromRealCoords (const Vector3 &min, const Vector3 &max)
 Set the bounding box from real coords to apply mCube localy. More...
 
void setROI (const Vec3i &min, const Vec3i &max)
 Set the bounding box (in the data space) to apply mCube localy. More...
 
void setBoundingBox (const Vec6i &roi)
 Set the bounding box (in the data space) to apply mCube localy. More...
 
void setBoundingBox (const Vec3i &min, const Vec3i &max)
 Set the bounding box (in the data space) to apply mCube localy. More...
 
void run (unsigned char *data, const float isolevel, sofa::helper::vector< PointID > &triangles, sofa::helper::vector< Vector3 > &vertices, helper::vector< helper::vector< unsigned int > > *triangleIndexInRegularGrid=nullptr) const
 
void run (unsigned char *_data, const sofa::helper::vector< Vec3i > &seeds, const float isolevel, sofa::helper::vector< PointID > &mesh, sofa::helper::vector< Vector3 > &vertices, std::map< Vector3, PointID > &map_vertices, helper::vector< helper::vector< unsigned int > > *triangleIndexInRegularGrid, bool propagate) const
 
void run (unsigned char *data, const vector< Vec3i > &seeds, const float isolevel, sofa::helper::vector< PointID > &triangles, sofa::helper::vector< Vector3 > &vertices, helper::vector< helper::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< Vec3i > &seeds, const float isoValue, unsigned char *_data)
 given a set of data, find seeds to run quickly. More...
 
void findSeedsFromRealCoords (vector< Vec3i > &mCubeCoords, const vector< Vector3 > &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 (Vector3 verticesTranslation)
 Set the translation to add to each new vertex in the triangles array. More...
 

Constructor details

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

Function details

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

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

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

Given coords in the scene, find seeds coords.

void sofa::helper::MarchingCubeUtility::run ( unsigned char *  data,
const float  isolevel,
sofa::helper::vector< PointID > &  triangles,
sofa::helper::vector< Vector3 > &  vertices,
helper::vector< helper::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 correspondance between an indice and a 3d position in space

void sofa::helper::MarchingCubeUtility::run ( unsigned char *  _data,
const sofa::helper::vector< Vec3i > &  seeds,
const float  isolevel,
sofa::helper::vector< PointID > &  mesh,
sofa::helper::vector< Vector3 > &  vertices,
std::map< Vector3, PointID > &  map_vertices,
helper::vector< helper::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.

void sofa::helper::MarchingCubeUtility::run ( unsigned char *  data,
const vector< Vec3i > &  seeds,
const float  isolevel,
sofa::helper::vector< PointID > &  triangles,
sofa::helper::vector< Vector3 > &  vertices,
helper::vector< helper::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.

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.

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

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

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

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

void sofa::helper::MarchingCubeUtility::setBoundingBoxFromRealCoords ( const Vector3 &  min,
const Vector3 &  max 
)
inline

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

void sofa::helper::MarchingCubeUtility::setConvolutionSize ( const unsigned int  convolutionSize)
inline
void sofa::helper::MarchingCubeUtility::setDataResolution ( const Vec3i resolution)
inline
void sofa::helper::MarchingCubeUtility::setDataVoxelSize ( const Vector3 &  voxelSize)
inline
void sofa::helper::MarchingCubeUtility::setROI ( const Vec3i min,
const Vec3i max 
)
inline

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

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

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

void sofa::helper::MarchingCubeUtility::setVerticesTranslation ( Vector3  verticesTranslation)

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