#include <MarchingCubeUtility.h>

Data Structures | |
| struct | GridCell |
Public Types | |
| typedef unsigned int | PointID |
| typedef Vec< 3, int > | Vec3i |
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 | run (const unsigned char *data, const float isolevel, sofa::helper::vector< PointID > &triangles, sofa::helper::vector< Vector3 > &vertices) const |
| given a set of data (size of the data and size of the marching cube beeing defined previously), we construct the surface. | |
| void | run (const 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. | |
Private Member Functions | |
| void | vertexInterp (const float isolevel, const Vector3 &p1, const Vector3 &p2, const float valp1, const float valp2, Vector3 &p) const |
| bool | testGrid (const float v, const float isolevel) const |
| int | polygonise (const GridCell &grid, const float isolevel, sofa::helper::vector< PointID > &triangles, std::map< Vector3, PointID > &map_vertices, std::map< PointID, Vector3 > &map_indices, unsigned int &ID) const |
| bool | getVoxel (unsigned int index, const unsigned char *dataVoxels) const |
| void | createConvolutionKernel (vector< float > &convolutionKernel) const |
| void | applyConvolution (unsigned int x, unsigned int y, unsigned int z, const float *original_data, float *data, const vector< float > &convolutionKernel) const |
| void | smoothData (float *data) const |
Private Attributes | |
| unsigned int | cubeStep |
| unsigned int | convolutionSize |
| Vec3i | dataResolution |
| Vector3 | dataVoxelSize |
Definition at line 45 of file MarchingCubeUtility.h.
| typedef unsigned int sofa::helper::MarchingCubeUtility::PointID |
Definition at line 48 of file MarchingCubeUtility.h.
| typedef Vec<3, int> sofa::helper::MarchingCubeUtility::Vec3i |
Definition at line 49 of file MarchingCubeUtility.h.
| sofa::helper::MarchingCubeUtility::MarchingCubeUtility | ( | ) |
Definition at line 339 of file MarchingCubeUtility.cpp.
| sofa::helper::MarchingCubeUtility::~MarchingCubeUtility | ( | ) | [inline] |
Definition at line 54 of file MarchingCubeUtility.h.
| void sofa::helper::MarchingCubeUtility::applyConvolution | ( | unsigned int | x, | |
| unsigned int | y, | |||
| unsigned int | z, | |||
| const float * | original_data, | |||
| float * | data, | |||
| const vector< float > & | convolutionKernel | |||
| ) | const [private] |
Definition at line 604 of file MarchingCubeUtility.cpp.
References convolutionSize, and dataResolution.
Referenced by smoothData().
| void sofa::helper::MarchingCubeUtility::createConvolutionKernel | ( | vector< float > & | convolutionKernel | ) | const [private] |
Definition at line 629 of file MarchingCubeUtility.cpp.
References convolutionSize.
Referenced by smoothData().
| int sofa::helper::MarchingCubeUtility::polygonise | ( | const GridCell & | grid, | |
| const float | isolevel, | |||
| sofa::helper::vector< PointID > & | triangles, | |||
| std::map< Vector3, PointID > & | map_vertices, | |||
| std::map< PointID, Vector3 > & | map_indices, | |||
| unsigned int & | ID | |||
| ) | const [private] |
Definition at line 375 of file MarchingCubeUtility.cpp.
References sofa::helper::MarchingCubeEdgeTable, sofa::helper::MarchingCubeTriTable, sofa::helper::MarchingCubeUtility::GridCell::pos, testGrid(), sofa::helper::MarchingCubeUtility::GridCell::val, and vertexInterp().
Referenced by run().
| void sofa::helper::MarchingCubeUtility::run | ( | const 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.
Definition at line 552 of file MarchingCubeUtility.cpp.
References sofa::helper::io::Mesh::getFacets(), sofa::helper::io::Mesh::getVertices(), and run().
| void sofa::helper::MarchingCubeUtility::run | ( | const unsigned char * | data, | |
| const float | isolevel, | |||
| sofa::helper::vector< PointID > & | triangles, | |||
| sofa::helper::vector< Vector3 > & | vertices | |||
| ) | 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
Definition at line 463 of file MarchingCubeUtility.cpp.
References convolutionSize, cubeStep, dataResolution, getVoxel(), sofa::defaulttype::Vec< N, real >::linearProduct(), polygonise(), sofa::helper::MarchingCubeUtility::GridCell::pos, smoothData(), and sofa::helper::MarchingCubeUtility::GridCell::val.
Referenced by sofa::component::topology::SparseGridTopology::constructCollisionModels(), sofa::component::topology::SparseGridTopology::getMesh(), and run().
| void sofa::helper::MarchingCubeUtility::setConvolutionSize | ( | const unsigned int | convolutionSize | ) | [inline] |
Definition at line 71 of file MarchingCubeUtility.h.
Referenced by sofa::component::topology::SparseGridTopology::updateMesh().
| void sofa::helper::MarchingCubeUtility::setDataResolution | ( | const Vec3i & | resolution | ) | [inline] |
Definition at line 56 of file MarchingCubeUtility.h.
References dataResolution.
Referenced by sofa::component::topology::SparseGridTopology::updateMesh().
| void sofa::helper::MarchingCubeUtility::setDataVoxelSize | ( | const Vector3 & | voxelSize | ) | [inline] |
Definition at line 61 of file MarchingCubeUtility.h.
References dataVoxelSize.
Referenced by sofa::component::topology::SparseGridTopology::updateMesh().
| void sofa::helper::MarchingCubeUtility::setStep | ( | const unsigned int | step | ) | [inline] |
Definition at line 66 of file MarchingCubeUtility.h.
References cubeStep.
Referenced by sofa::component::topology::SparseGridTopology::updateMesh().
| void sofa::helper::MarchingCubeUtility::smoothData | ( | float * | data | ) | const [private] |
Definition at line 580 of file MarchingCubeUtility.cpp.
References applyConvolution(), convolutionSize, createConvolutionKernel(), and dataResolution.
Referenced by run().
| bool sofa::helper::MarchingCubeUtility::testGrid | ( | const float | v, | |
| const float | isolevel | |||
| ) | const [inline, private] |
| void sofa::helper::MarchingCubeUtility::vertexInterp | ( | const float | isolevel, | |
| const Vector3 & | p1, | |||
| const Vector3 & | p2, | |||
| const float | valp1, | |||
| const float | valp2, | |||
| Vector3 & | p | |||
| ) | const [inline, private] |
Definition at line 348 of file MarchingCubeUtility.cpp.
References dataResolution, dataVoxelSize, and PRECISION.
Referenced by polygonise().
unsigned int sofa::helper::MarchingCubeUtility::convolutionSize [private] |
Definition at line 123 of file MarchingCubeUtility.h.
Referenced by applyConvolution(), createConvolutionKernel(), run(), and smoothData().
unsigned int sofa::helper::MarchingCubeUtility::cubeStep [private] |
Definition at line 124 of file MarchingCubeUtility.h.
Referenced by applyConvolution(), run(), setDataResolution(), smoothData(), and vertexInterp().
Vector3 sofa::helper::MarchingCubeUtility::dataVoxelSize [private] |
Definition at line 125 of file MarchingCubeUtility.h.
Referenced by setDataVoxelSize(), and vertexInterp().
1.5.7.1