Eulerian Smoke Simulation on the GPU
VolumeMesher Class Reference

A class that polygonizes a scalar field using the marching cubes and dividing cubes algorithms. More...

#include <VolumeMesher.h>

List of all members.

Public Types

enum  MeshingMethod { MARCHING_CUBES, DIVIDING_CUBES }

Public Member Functions

 VolumeMesher (int _resX, int _resY, int _resZ, ImageUnitStack *_imageUnitStack)
 Constructor.
 ~VolumeMesher ()
 Destructor.
void init ()
 Initialization function.
int getResX () const
 Accessor for the X dimension of the marching grid.
int getResY () const
 Accessor for the Y dimension of the marching grid.
int getResZ () const
 Accessor for the Z dimension of the marching grid.
void setResolution (int _resX, int _resY, int _resZ)
 Sets the marching grid's resolution.
float getSamplingStepX () const
 Accessor for the sampling step in the X direction.
float getSamplingStepY () const
 Accessor for the sampling step in the Y direction.
float getSamplingStepZ () const
 Accessor for the sampling step in the Z direction.
void drawMesh (Texture3D *_texture3D, float _isoLevel, int _samplingChannel, ngl::Colour *_colour, ngl::Matrix _modelMatrix, bool _inverseNormals=false)
 Draws the generated mesh.
void resetResolution (int _resX, int _resY, int _resZ)
 Resets the marching grid resolution.
void setMeshingMethod (MeshingMethod _meshingMethod)
 Changes the meshing method.
void passViewProjectionMatrix (ngl::Matrix _modelViewMatrix, ngl::Matrix _projectionMatrix)
 Passes the view and projection matrices to the class.

Detailed Description

A class that polygonizes a scalar field using the marching cubes and dividing cubes algorithms.

Author:
Nikolaos Verigakis
Version:
1.0
Date:
14/06/11 Revision History : Initial Version 14/06/11

Constructor & Destructor Documentation

VolumeMesher::VolumeMesher ( int  _resX,
int  _resY,
int  _resZ,
ImageUnitStack _imageUnitStack 
)

Constructor.

end of citation

Parameters:
[in]_resXthe resolution in X
[in]_resXthe resolution in Y
[in]_resXthe resolution in Z

Member Function Documentation

void VolumeMesher::drawMesh ( Texture3D _texture3D,
float  _isoLevel,
int  _samplingChannel,
ngl::Colour _colour,
ngl::Matrix  _modelMatrix,
bool  _inverseNormals = false 
)

Draws the generated mesh.

Parameters:
[in]_texture3Dthe 3D texture to draw
[in]_isoLevelthe iso-surface's iso threshold
[in]_samplingChannelthe texture channel to sample the iso-surface from
[in]_colourthe iso-surface colour
[in]_modelMatrixthe active model matrix
[in]_inverseNormalsa flag for inversing the surface normals
void VolumeMesher::passViewProjectionMatrix ( ngl::Matrix  _modelViewMatrix,
ngl::Matrix  _projectionMatrix 
)

Passes the view and projection matrices to the class.

Parameters:
[in]_modelViewMatrixthe model view matrix
[in]_projectionMatrixthe projection matrix
void VolumeMesher::resetResolution ( int  _resX,
int  _resY,
int  _resZ 
)

Resets the marching grid resolution.

Parameters:
[in]_resXthe new resolution in X
[in]_resYthe new resolution in Y
[in]_resZthe new resolution in Z
void VolumeMesher::setMeshingMethod ( MeshingMethod  _meshingMethod)

Changes the meshing method.

Parameters:
[in]_meshingMethodthe new meshing method
void VolumeMesher::setResolution ( int  _resX,
int  _resY,
int  _resZ 
) [inline]

Sets the marching grid's resolution.

Parameters:
[in]_resXthe resolution in the X direction
[in]_resYthe resolution in the Y direction
[in]_resZthe resolution in the Z direction

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables