Marching Cubes algorithm. More...
#include <MarchingCubes.h>
Public Member Functions | |
MarchingCubes () | |
constructor | |
~MarchingCubes () | |
const int | nverts () const |
const int | ntrigs () const |
Point * | vert (const int i) const |
Triangle * | trig (const int i) const |
Point * | vertices () |
Triangle * | triangles () |
void | set_method (const bool originalMC=false) |
void | init_all () |
void | clean_temps () |
void | clean_all () |
void | writeOFF (const char *fn) |
real * | cube () |
Point * | space () |
Key * | indexes () |
data_access *& | dat_access () |
bool | tesselate_cube (real iso) |
void | draw_surf () |
Protected Member Functions | |
bool | process_cube () |
bool | test_face (schar face) |
bool | test_interior (schar s) |
bool | compute_intersection_points () |
void | add_triangle (const char *trig, char n, int v12=-1) |
void | test_vertex_addition () |
bool | add_vertex (char i, char j) |
int | get_vertex (char i, char j) |
int | add_c_vertex () |
void | print_cube () |
Protected Attributes | |
bool | _originalMC |
int | _nverts |
int | _ntrigs |
int | _Nverts |
int | _Ntrigs |
Point * | _vertices |
Triangle * | _triangles |
std::map< std::pair< Key, Key > , int > | _stored_vertices |
real | _cube [8] |
Point | _space [8] |
Key | _indexes [8] |
uchar | _lut_entry |
uchar | _case |
uchar | _config |
uchar | _subconfig |
data_access * | _dat_access |
Marching Cubes algorithm.
Marching Cubes Direct Draw.
Marching Cubes algorithm wrapper
MarchingCubes::MarchingCubes | ( | ) |
constructor
Main and default constructor
MarchingCubes::~MarchingCubes | ( | ) |
Destructor
int MarchingCubes::add_c_vertex | ( | ) | [protected] |
adds a vertex inside the current cube
void MarchingCubes::add_triangle | ( | const char * | trig, | |
char | n, | |||
int | v12 = -1 | |||
) | [protected] |
routine to add a triangle to the mesh
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 |
bool MarchingCubes::add_vertex | ( | char | i, | |
char | j | |||
) | [protected] |
adds a vertex on edge cube[i] cube[j]
void MarchingCubes::clean_all | ( | ) |
clears all structures : the temporary structures and the mesh buffers
void MarchingCubes::clean_temps | ( | ) |
clears temporary structures : the grid and the main
bool MarchingCubes::compute_intersection_points | ( | ) | [protected] |
computes almost all the vertices of the mesh by interpolation along the cubes edges
real* MarchingCubes::cube | ( | ) | [inline] |
retrieves the isovalues at the cube vertices
data_access*& MarchingCubes::dat_access | ( | ) | [inline] |
retrieves the data accessor
void MarchingCubes::draw_surf | ( | ) | [inline] |
draw the surface using openGL
int MarchingCubes::get_vertex | ( | char | i, | |
char | j | |||
) | [inline, protected] |
gets the vertex of edge cube[i] cube[j] (no check)
Key* MarchingCubes::indexes | ( | ) | [inline] |
retrieves the indexes of the cube
void MarchingCubes::init_all | ( | ) |
inits all structures (must set sizes before call) : the temporary structures and the mesh buffers
const int MarchingCubes::ntrigs | ( | ) | const [inline] |
accesses the number of triangles of the generated mesh
const int MarchingCubes::nverts | ( | ) | const [inline] |
accesses the number of vertices of the generated mesh
void MarchingCubes::print_cube | ( | ) | [protected] |
prints cube for debug
bool MarchingCubes::process_cube | ( | ) | [protected] |
tesselates one cube
void MarchingCubes::set_method | ( | const bool | originalMC = false |
) | [inline] |
selects wether the algorithm will use the enhanced topologically controlled lookup table or the original MarchingCubes
originalMC | true for the original Marching Cubes |
Point* MarchingCubes::space | ( | ) | [inline] |
retrieves the geometry of the cube
bool MarchingCubes::tesselate_cube | ( | real | iso | ) |
Main algorithm
iso | isovalue |
bool MarchingCubes::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 MarchingCubes::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 MarchingCubes::test_vertex_addition | ( | ) | [protected] |
tests and eventually doubles the vertex buffer capacity for a new vertex insertion
Triangle* MarchingCubes::triangles | ( | ) | [inline] |
accesses the triangle buffer of the generated mesh
Triangle* MarchingCubes::trig | ( | const int | i | ) | const [inline] |
accesses a specific triangle of the generated mesh
Point* MarchingCubes::vert | ( | const int | i | ) | const [inline] |
accesses a specific vertex of the generated mesh
Point* MarchingCubes::vertices | ( | ) | [inline] |
accesses the vertex buffer of the generated mesh
void MarchingCubes::writeOFF | ( | const char * | fn | ) |
OFF exportation of the generated mesh
fn | name of the IV file to create |
uchar MarchingCubes::_case [protected] |
case of the active cube in [0..15]
uchar MarchingCubes::_config [protected] |
configuration of the active cube
real MarchingCubes::_cube[8] [protected] |
values of the implicit function on the active cube
data_access* MarchingCubes::_dat_access [protected] |
data accessor
Key MarchingCubes::_indexes[8] [protected] |
indiexs of the active cube
uchar MarchingCubes::_lut_entry [protected] |
cube sign representation in [0..255]
int MarchingCubes::_Ntrigs [protected] |
size of the triangle buffer
int MarchingCubes::_ntrigs [protected] |
number of allocated triangles in the triangle buffer
int MarchingCubes::_Nverts [protected] |
size of the vertex buffer
int MarchingCubes::_nverts [protected] |
number of allocated vertices in the vertex buffer
bool MarchingCubes::_originalMC [protected] |
selects wether the algorithm will use the enhanced topologically controlled lookup table or the original MarchingCubes
Point MarchingCubes::_space[8] [protected] |
coordinates of the active cube
uchar MarchingCubes::_subconfig [protected] |
subconfiguration of the active cube
Triangle* MarchingCubes::_triangles [protected] |
triangle buffer
Point* MarchingCubes::_vertices [protected] |
vertex buffer