MarchingCubes Class Reference

Marching Cubes is a well-known algorithm for generating a polygonal approximation to an isosurface defined over a scalar field. This class is a fairly standard implementation of Marching Cubes in 3D that generates triangular meshes as output. More...

#include <MarchingCubes.h>

Inheritance diagram for MarchingCubes:

SSEAligned

List of all members.

Public Member Functions

Constructors
 MarchingCubes ()
 MarchingCubes (const Vector3 &resolution)
virtual ~MarchingCubes ()
Core functionality
virtual Meshpolygonize (const ScalarField &field, real_t threshold)
 Generates a triangular mesh approximating a specific isocontour defined over the given ScalarField at the threshold value specified.
Accessors / Mutators
const Vector3getResolution () const
void setResolution (const Vector3 &resolution)
 sets the resolution of the grid used for marching squares

Protected Member Functions

Vertex _calculateIntersection (const MCData &data, unsigned edge) const
unsigned _getVertexID (const MCData &data, unsigned edge) const
unsigned _getVertexID (const MCData &data) const
unsigned _getVertexID (unsigned i, unsigned j, unsigned k, unsigned width, unsigned height) const
Vertex _interpolate (const Vertex &v1, const Vertex &v2, real_t coeff1, real_t coeff2, real_t threshold) const
void _addVertex (const Vertex &vertex, unsigned id, MCData &data) const
void _cleanup (MCData &data) const

Protected Attributes

Vector3 m_resolution


Detailed Description

Marching Cubes is a well-known algorithm for generating a polygonal approximation to an isosurface defined over a scalar field. This class is a fairly standard implementation of Marching Cubes in 3D that generates triangular meshes as output.

Author:
Travis Fischer (fisch0920@gmail.com)

Matthew Jacobs (jacobs.mh@gmail.com)

Date:
Spring 2008
References: http://www.ia.hiof.no/~borres/cgraph/explain/marching/p-march.html

Definition at line 26 of file MarchingCubes.h.


Constructor & Destructor Documentation

MarchingCubes::MarchingCubes (  )  [inline]

Definition at line 31 of file MarchingCubes.h.

MarchingCubes::MarchingCubes ( const Vector3 resolution  )  [inline]

Definition at line 35 of file MarchingCubes.h.

virtual MarchingCubes::~MarchingCubes (  )  [inline, virtual]

Definition at line 39 of file MarchingCubes.h.


Member Function Documentation

Mesh * MarchingCubes::polygonize ( const ScalarField field,
real_t  threshold 
) [virtual]

Generates a triangular mesh approximating a specific isocontour defined over the given ScalarField at the threshold value specified.

Note:
the generated mesh is not guaranteed to be closed
Returns:
the generated Mesh or NULL upon error

Definition at line 57 of file MarchingCubes.cpp.

const Vector3& MarchingCubes::getResolution (  )  const [inline]

Returns:
the resolution of the grid used for marching squares

Definition at line 67 of file MarchingCubes.h.

void MarchingCubes::setResolution ( const Vector3 resolution  )  [inline]

sets the resolution of the grid used for marching squares

Definition at line 75 of file MarchingCubes.h.

Vertex MarchingCubes::_calculateIntersection ( const MCData &  data,
unsigned  edge 
) const [protected]

Definition at line 236 of file MarchingCubes.cpp.

unsigned MarchingCubes::_getVertexID ( const MCData &  data,
unsigned  edge 
) const [inline, protected]

Definition at line 318 of file MarchingCubes.cpp.

unsigned MarchingCubes::_getVertexID ( const MCData &  data  )  const [inline, protected]

Definition at line 353 of file MarchingCubes.cpp.

unsigned MarchingCubes::_getVertexID ( unsigned  i,
unsigned  j,
unsigned  k,
unsigned  width,
unsigned  height 
) const [inline, protected]

Definition at line 357 of file MarchingCubes.cpp.

Vertex MarchingCubes::_interpolate ( const Vertex v1,
const Vertex v2,
real_t  coeff1,
real_t  coeff2,
real_t  threshold 
) const [inline, protected]

Definition at line 363 of file MarchingCubes.cpp.

void MarchingCubes::_addVertex ( const Vertex vertex,
unsigned  id,
MCData &  data 
) const [protected]

Definition at line 373 of file MarchingCubes.cpp.

void MarchingCubes::_cleanup ( MCData &  data  )  const [protected]

Definition at line 382 of file MarchingCubes.cpp.


Member Data Documentation

Definition at line 99 of file MarchingCubes.h.


The documentation for this class was generated from the following files:

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6