vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE > Class Template Reference
[Trimesh]

This class implements the Marching Cubes algorithm. More...

#include <marching_cubes.h>

List of all members.

Public Types

typedef vcg::tri::Allocator
< TRIMESH_TYPE > 
AllocatorType
typedef TRIMESH_TYPE::CoordType * CoordPointer
typedef TRIMESH_TYPE::CoordType CoordType
enum  Dimension { X, Y, Z }
typedef TRIMESH_TYPE::FaceIterator FaceIterator
typedef TRIMESH_TYPE::FacePointer FacePointer
typedef TRIMESH_TYPE::FaceType FaceType
typedef TRIMESH_TYPE::ScalarType ScalarType
typedef _W64 unsigned int size_t
typedef
TRIMESH_TYPE::VertexIterator 
VertexIterator
typedef TRIMESH_TYPE::VertexPointer VertexPointer
typedef TRIMESH_TYPE::VertexType VertexType

Public Member Functions

void Finalize ()
void Initialize ()
 MarchingCubes (TRIMESH_TYPE &mesh, WALKER_TYPE &walker)
void ProcessCell (const vcg::Point3i &min, const vcg::Point3i &max)

Private Member Functions

void AddTriangles (const char *vertices_list, char n, VertexPointer v12=NULL)
void ComputeCVertex (VertexPointer &v12)
bool TestFace (signed char face)
bool TestInterior (signed char s)

Private Attributes

unsigned char _case
unsigned char _config
vcg::Point3i _corners [8]
ScalarType _field [8]
TRIMESH_TYPE * _mesh
unsigned char _subconfig
WALKER_TYPE * _walker

Detailed Description

template<class TRIMESH_TYPE, class WALKER_TYPE>
class vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >

This class implements the Marching Cubes algorithm.

The implementation is enough generic: this class works only on one volume cell for each call to ProcessCell. Using the field value at the cell corners, it adds to the mesh the triangles set approximating the surface that cross that cell. The ambiguities are resolved using an enhanced topologically controlled lookup table.

Parameters:
TRIMESH_TYPE (Template parameter) the mesh type that will be constructed
WALKER_TYPE (Template parameter) the class that implement the traversal ordering of the volume

Definition at line 61 of file marching_cubes.h.


Member Typedef Documentation

template<class TRIMESH_TYPE , class WALKER_TYPE >
typedef vcg::tri::Allocator< TRIMESH_TYPE > vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::AllocatorType

Definition at line 75 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
typedef TRIMESH_TYPE::CoordType* vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::CoordPointer

Definition at line 84 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
typedef TRIMESH_TYPE::CoordType vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::CoordType

Definition at line 83 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
typedef TRIMESH_TYPE::FaceIterator vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::FaceIterator

Definition at line 82 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
typedef TRIMESH_TYPE::FacePointer vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::FacePointer

Definition at line 81 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
typedef TRIMESH_TYPE::FaceType vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::FaceType

Definition at line 80 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
typedef TRIMESH_TYPE::ScalarType vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::ScalarType

Definition at line 76 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
typedef _W64 unsigned int vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::size_t

Definition at line 72 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
typedef TRIMESH_TYPE::VertexIterator vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::VertexIterator

Definition at line 79 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
typedef TRIMESH_TYPE::VertexPointer vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::VertexPointer

Definition at line 78 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
typedef TRIMESH_TYPE::VertexType vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::VertexType

Definition at line 77 of file marching_cubes.h.


Member Enumeration Documentation

template<class TRIMESH_TYPE , class WALKER_TYPE >
enum vcg::tri::MarchingCubes::Dimension
Enumerator:
X 
Y 
Z 

Definition at line 64 of file marching_cubes.h.


Constructor & Destructor Documentation

template<class TRIMESH_TYPE , class WALKER_TYPE >
vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::MarchingCubes ( TRIMESH_TYPE &  mesh,
WALKER_TYPE &  walker 
) [inline]

Constructor

Parameters:
mesh the mesh that will be constructed
walker the class implementing the traversal policy

Definition at line 91 of file marching_cubes.h.


Member Function Documentation

template<class TRIMESH_TYPE , class WALKER_TYPE >
void vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::AddTriangles ( const char *  vertices_list,
char  n,
VertexPointer  v12 = NULL 
) [inline, private]

Adds new triangles to the mesh

Parameters:
vertices_list The list of vertex indices
n The number of triangles that will be added to the mesh
v12 The pointer to the vertex inside the current cell

Definition at line 672 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
void vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::ComputeCVertex ( VertexPointer v12  )  [inline, private]

Adds a vertex inside the current cube

Parameters:
v The pointer to the new vertex along the edge

Definition at line 597 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
void vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::Finalize (  )  [inline]

This method must be executed after the last call to ApplyMC

Definition at line 110 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
void vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::Initialize (  )  [inline]

Execute the initialiazation. This method must be executed before the first call to ApplyMC

Definition at line 101 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
void vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::ProcessCell ( const vcg::Point3i min,
const vcg::Point3i max 
) [inline]

Apply the marching cubes algorithm to the volume cell identified by the two points min and max. All the three coordinates of the first point must be smaller than the respectives three coordinatas of the second point.

Parameters:
min the first point
max the second point

Definition at line 122 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
bool vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::TestFace ( signed char  face  )  [inline, private]

Tests if the components of the tesselation of the cube should be connected by the interior of an ambiguous face

Definition at line 417 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
bool vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::TestInterior ( signed char  s  )  [inline, private]

Tests if the components of the tesselation of the cube should be connected through the interior of the cube

Definition at line 440 of file marching_cubes.h.


Member Data Documentation

template<class TRIMESH_TYPE , class WALKER_TYPE >
unsigned char vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::_case [private]

Case of the volume cell being processed

Definition at line 401 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
unsigned char vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::_config [private]

Configuration of the volume cell being processed

Definition at line 406 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
vcg::Point3i vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::_corners[8] [private]

Array of the 8 corners of the volume cell being processed

Definition at line 396 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
ScalarType vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::_field[8] [private]

The field value at the cell corners

Definition at line 391 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
TRIMESH_TYPE* vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::_mesh [private]

Definition at line 386 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
unsigned char vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::_subconfig [private]

Subconfiguration of the volume cell being processed

Definition at line 411 of file marching_cubes.h.

template<class TRIMESH_TYPE , class WALKER_TYPE >
WALKER_TYPE* vcg::tri::MarchingCubes< TRIMESH_TYPE, WALKER_TYPE >::_walker [private]

Definition at line 378 of file marching_cubes.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


vcglib
Author(s): Christian Bersch
autogenerated on Fri Jan 11 09:23:33 2013