Marching Cubes - CMC33 algorithm.
More...
|
void | process_cube () |
|
bool | test_face (schar face) |
|
bool | test_interior (schar s) |
|
bool | modified_test_interior (schar s) |
|
int | interior_ambiguity (int amb_face, int s) |
|
int | interior_ambiguity_verification (int edge) |
|
bool | interior_test_case13 () |
|
bool | interior_test_case13_2 (float isovalue) |
|
const real | get_data (const int i, const int j, const int k) const |
|
void | compute_intersection_points (real iso) |
|
void | add_triangle (const char *trig, char n, int v12=-1) |
|
void | test_vertex_addition () |
|
int | add_x_vertex () |
|
int | add_y_vertex () |
|
int | add_z_vertex () |
|
int | add_c_vertex () |
|
real | get_x_grad (const int i, const int j, const int k) const |
|
real | get_y_grad (const int i, const int j, const int k) const |
|
real | get_z_grad (const int i, const int j, const int k) const |
|
int | get_x_vert (const int i, const int j, const int k) const |
|
int | get_y_vert (const int i, const int j, const int k) const |
|
int | get_z_vert (const int i, const int j, const int k) const |
|
void | set_x_vert (const int val, const int i, const int j, const int k) |
|
void | set_y_vert (const int val, const int i, const int j, const int k) |
|
void | set_z_vert (const int val, const int i, const int j, const int k) |
|
void | print_cube () |
|
void | resizeAndAllocateConnectivity (int index) |
|
Marching Cubes - CMC33 algorithm.
Marching Cubes algorithm wrapper
niftk::CMC33::CMC33 |
( |
const int |
size_x = -1 , |
|
|
const int |
size_y = -1 , |
|
|
const int |
size_z = -1 |
|
) |
| |
constructor
Main and default constructor
- Parameters
-
size_x | width of the grid |
size_y | depth of the grid |
size_z | height of the grid |
int niftk::CMC33::add_c_vertex |
( |
| ) |
|
|
protected |
adds a vertex inside the current cube
void niftk::CMC33::add_triangle |
( |
const char * |
trig, |
|
|
char |
n, |
|
|
int |
v12 = -1 |
|
) |
| |
|
protected |
routine to add a triangle to the mesh
- Parameters
-
trig | the code for the triangle as a sequence of edges index |
n | the number of triangles to produce |
v12 | the index of the interior vertex to use, if necessary |
int niftk::CMC33::add_x_vertex |
( |
| ) |
|
|
protected |
adds a vertex on the current horizontal edge
int niftk::CMC33::add_y_vertex |
( |
| ) |
|
|
protected |
adds a vertex on the current longitudinal edge
int niftk::CMC33::add_z_vertex |
( |
| ) |
|
|
protected |
adds a vertex on the current vertical edge
void niftk::CMC33::clean_all |
( |
| ) |
|
clears all structures : the temporary structures and the mesh buffers
void niftk::CMC33::clean_temps |
( |
| ) |
|
clears temporary structures : the grid and the main
void niftk::CMC33::compute_intersection_points |
( |
real |
iso | ) |
|
|
protected |
computes almost all the vertices of the mesh by interpolation along the cubes edges
- Parameters
-
void niftk::CMC33::enable_normal_computing |
( |
bool |
value | ) |
|
|
inline |
turns normal computing on / off
const real niftk::CMC33::get_data |
( |
const int |
i, |
|
|
const int |
j, |
|
|
const int |
k |
|
) |
| const |
|
inlineprotected |
accesses a specific cube of the grid
- Parameters
-
i | abscisse of the cube |
j | ordinate of the cube |
k | height of the cube |
real niftk::CMC33::get_x_grad |
( |
const int |
i, |
|
|
const int |
j, |
|
|
const int |
k |
|
) |
| const |
|
protected |
interpolates the horizontal gradient of the implicit function at the lower vertex of the specified cube
- Parameters
-
i | abscisse of the cube |
j | ordinate of the cube |
k | height of the cube |
int niftk::CMC33::get_x_vert |
( |
const int |
i, |
|
|
const int |
j, |
|
|
const int |
k |
|
) |
| const |
|
inlineprotected |
accesses the pre-computed vertex index on the lower horizontal edge of a specific cube
- Parameters
-
i | abscisse of the cube |
j | ordinate of the cube |
k | height of the cube |
real niftk::CMC33::get_y_grad |
( |
const int |
i, |
|
|
const int |
j, |
|
|
const int |
k |
|
) |
| const |
|
protected |
interpolates the longitudinal gradient of the implicit function at the lower vertex of the specified cube
- Parameters
-
i | abscisse of the cube |
j | ordinate of the cube |
k | height of the cube |
int niftk::CMC33::get_y_vert |
( |
const int |
i, |
|
|
const int |
j, |
|
|
const int |
k |
|
) |
| const |
|
inlineprotected |
accesses the pre-computed vertex index on the lower longitudinal edge of a specific cube
- Parameters
-
i | abscisse of the cube |
j | ordinate of the cube |
k | height of the cube |
real niftk::CMC33::get_z_grad |
( |
const int |
i, |
|
|
const int |
j, |
|
|
const int |
k |
|
) |
| const |
|
protected |
interpolates the vertical gradient of the implicit function at the lower vertex of the specified cube
- Parameters
-
i | abscisse of the cube |
j | ordinate of the cube |
k | height of the cube |
int niftk::CMC33::get_z_vert |
( |
const int |
i, |
|
|
const int |
j, |
|
|
const int |
k |
|
) |
| const |
|
inlineprotected |
accesses the pre-computed vertex index on the lower vertical edge of a specific cube
- Parameters
-
i | abscisse of the cube |
j | ordinate of the cube |
k | height of the cube |
void niftk::CMC33::init_all |
( |
| ) |
|
inits all structures (must set sizes before call) : the temporary structures and the mesh buffers
void niftk::CMC33::init_temps |
( |
| ) |
|
inits temporary structures (must set sizes before call) : the grid and the vertex index per cube
int niftk::CMC33::interior_ambiguity |
( |
int |
amb_face, |
|
|
int |
s |
|
) |
| |
|
protected |
int niftk::CMC33::interior_ambiguity_verification |
( |
int |
edge | ) |
|
|
protected |
verify that the ambigous cases were treated right
bool niftk::CMC33::interior_test_case13 |
( |
| ) |
|
|
protected |
bool niftk::CMC33::interior_test_case13_2 |
( |
float |
isovalue | ) |
|
|
protected |
bool niftk::CMC33::modified_test_interior |
( |
schar |
s | ) |
|
|
protected |
IMPROVED - tests if the components of the tesselation of the cube should be connected through the interior of the cube
const int niftk::CMC33::ntrigs |
( |
| ) |
const |
|
inline |
accesses the number of triangles of the generated mesh
const int niftk::CMC33::nverts |
( |
| ) |
const |
|
inline |
accesses the number of vertices of the generated mesh
void niftk::CMC33::print_cube |
( |
| ) |
|
|
protected |
void niftk::CMC33::process_cube |
( |
| ) |
|
|
protected |
void niftk::CMC33::resizeAndAllocateConnectivity |
( |
int |
index | ) |
|
|
protected |
checks the size of the connectivity vectors and allocates more space if required
void niftk::CMC33::restart |
( |
| ) |
|
restart with a new mesh: erases all vertices and faces
Main algorithm : must be called after init_all
- Parameters
-
void niftk::CMC33::set_input_data |
( |
real * |
data | ) |
|
|
inline |
selects to use data from another class
- Parameters
-
data | is the pointer to the external data, allocated as a size_x*size_y*size_z vector running in x first |
void niftk::CMC33::set_method |
( |
const bool |
originalMC = false | ) |
|
|
inline |
changes the size of the grid
- Parameters
-
size_x | width of the grid |
size_y | depth of the grid |
size_z | height of the grid selects wether the algorithm will use the enhanced topologically controlled lookup table or the original MarchingCubes |
originalMC | true for the original Marching Cubes |
Set pointer to the data structure that will be used internally to store the mesh data
void niftk::CMC33::set_x_vert |
( |
const int |
val, |
|
|
const int |
i, |
|
|
const int |
j, |
|
|
const int |
k |
|
) |
| |
|
inlineprotected |
sets the pre-computed vertex index on the lower horizontal edge of a specific cube
- Parameters
-
val | the index of the new vertex |
i | abscisse of the cube |
j | ordinate of the cube |
k | height of the cube |
void niftk::CMC33::set_y_vert |
( |
const int |
val, |
|
|
const int |
i, |
|
|
const int |
j, |
|
|
const int |
k |
|
) |
| |
|
inlineprotected |
sets the pre-computed vertex index on the lower longitudinal edge of a specific cube
- Parameters
-
val | the index of the new vertex |
i | abscisse of the cube |
j | ordinate of the cube |
k | height of the cube |
void niftk::CMC33::set_z_vert |
( |
const int |
val, |
|
|
const int |
i, |
|
|
const int |
j, |
|
|
const int |
k |
|
) |
| |
|
inlineprotected |
sets the pre-computed vertex index on the lower vertical edge of a specific cube
- Parameters
-
val | the index of the new vertex |
i | abscisse of the cube |
j | ordinate of the cube |
k | height of the cube |
const int niftk::CMC33::size_x |
( |
| ) |
const |
|
inline |
accesses the width of the grid
const int niftk::CMC33::size_y |
( |
| ) |
const |
|
inline |
accesses the depth of the grid
const int niftk::CMC33::size_z |
( |
| ) |
const |
|
inline |
accesses the height of the grid
bool niftk::CMC33::test_face |
( |
schar |
face | ) |
|
|
protected |
tests if the components of the tesselation of the cube should be connected by the interior of an ambiguous face
bool niftk::CMC33::test_interior |
( |
schar |
s | ) |
|
|
protected |
tests if the components of the tesselation of the cube should be connected through the interior of the cube
void niftk::CMC33::test_vertex_addition |
( |
| ) |
|
|
protected |
tests and eventually doubles the vertex buffer capacity for a new vertex insertion
uchar niftk::CMC33::_case |
|
protected |
case of the active cube in [0..15]
bool niftk::CMC33::_computeNormals |
|
protected |
selects wether to compute normals or not
uchar niftk::CMC33::_config |
|
protected |
configuration of the active cube
real niftk::CMC33::_cube[8] |
|
protected |
values of the implicit function on the active cube
real* niftk::CMC33::_data |
|
protected |
implicit function values sampled on the grid
bool niftk::CMC33::_ext_data |
|
protected |
selects wether to allocate data or use data from another class
abscisse of the active cube
height of the active cube
ordinate of the active cube
uchar niftk::CMC33::_lut_entry |
|
protected |
cube sign representation in [0..255]
int niftk::CMC33::_ntrigs |
|
protected |
number of allocated triangles in the triangle buffer
int niftk::CMC33::_Ntrigs |
|
protected |
allocated size of the triangle buffer - buffer might have fewer elements
int niftk::CMC33::_nverts |
|
protected |
number of allocated vertices in the vertex buffer
int niftk::CMC33::_Nverts |
|
protected |
allocated size of the vertex buffer - buffer might have fewer elements
bool niftk::CMC33::_originalMC |
|
protected |
selects wether the algorithm will use the enhanced topologically controlled lookup table or the original MarchingCubes
int niftk::CMC33::_size_x |
|
protected |
int niftk::CMC33::_size_y |
|
protected |
int niftk::CMC33::_size_z |
|
protected |
uchar niftk::CMC33::_subconfig |
|
protected |
subconfiguration of the active cube
int* niftk::CMC33::_x_verts |
|
protected |
pre-computed vertex indices on the lower horizontal edge of each cube
int* niftk::CMC33::_y_verts |
|
protected |
pre-computed vertex indices on the lower longitudinal edge of each cube
int* niftk::CMC33::_z_verts |
|
protected |
pre-computed vertex indices on the lower vertical edge of each cube
externally allocated data structure that contains the mesh that we're working on
The documentation for this class was generated from the following files: