Display::IsoSurface Class Reference

#include <isosurface.h>

List of all members.


Detailed Description

Mesh generator with the marching cube algorithm.

Display an isosurface of a 3D image. It uses the marching cube algorithm to display the isosurface mesh.

displayisosurface.png

To compute the normal of the mesh two options are available. The first method uses the triangle normals. The resulting mesh is blocky as the normal is identical on the whole triangle. The second method uses the data gradient. The resulting mesh is smoother as the normal is different on the triangle. The default is to use the gradient method as it gives a nicer mesh.

It the isosurface to be displayed is showing a darker region, the surface normals must be changed as they normally points from bright to dark regions.

For better results use the following OpenGL initialization:

   glShadeModel(GL_SMOOTH);
   glEnable(GL_DEPTH_TEST);
   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

The Marching Cube code is adapted from Paul Bourke code which can be found at: http://local.wasp.uwa.edu.au/~pbourke/modelling/polygonise/

Public Member Functions

 IsoSurface ()
 ~IsoSurface ()
void display () const
template<typename DataType>
void update (const DataType *data, unsigned int width, unsigned int height, unsigned depth, float isovalue, bool from_bright_to_dark=true, bool use_gradient=true)

Classes

struct  GRIDCELL
struct  TRIANGLE
struct  XYZ


Constructor & Destructor Documentation

Display::IsoSurface::IsoSurface (  ) 

Display::IsoSurface::~IsoSurface (  ) 


Member Function Documentation

void Display::IsoSurface::display (  )  const

display the isosurface mesh

template<typename DataType>
void Display::IsoSurface::update ( const DataType *  data,
unsigned int  width,
unsigned int  height,
unsigned  depth,
float  isovalue,
bool  from_bright_to_dark = true,
bool  use_gradient = true 
) [inline]

create a new mesh

Parameters:
data 3D image to extract the isovalue
width width of the data
height height of the data
depth depth of the data
isovalue isovalue to extract
from_bright_to_dark is the surface enclosing a bright (true) or dark (false) surface
use_gradient compute the surface normals from the image gradient (smoother) rather than using triangle normals (produces facets)


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

Generated on Tue Aug 4 17:57:43 2009 for libvd by  doxygen 1.5.5