Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

CUDAMarchingCubes Class Reference

#include <CUDAMarchingCubes.h>

List of all members.

Public Types

enum  VolTexFormat { RGB3F, RGB4U }

Public Methods

 CUDAMarchingCubes ()
 constructor. More...

 ~CUDAMarchingCubes ()
 destructor. More...

bool Initialize (uint3 maxgridsize)
uint3 GetMaxGridSize () const
bool SetVolumeData (float *volume, float3 *colors, uint3 gridsize, float3 gridOrigin, float3 boundingBox, bool cudaArray)
bool SetVolumeData (float *volume, uchar4 *colors, uint3 gridsize, float3 gridOrigin, float3 boundingBox, bool cudaArray)
bool SetVolumeData (float *volume, void *colors, VolTexFormat texformat, uint3 gridsize, float3 gridOrigin, float3 boundingBox, bool cudaArray)
void SetSubVolume (uint3 start, uint3 end)
void computeIsosurface (float3 *vertOut, float3 *normOut, float3 *colOut, unsigned int maxverts)
void computeIsosurface (float3 *vertOut, float3 *normOut, uchar4 *colOut, unsigned int maxverts)
void computeIsosurface (float3 *vertOut, char3 *normOut, uchar4 *colOut, unsigned int maxverts)
bool computeIsosurface (float *volume, void *colors, VolTexFormat texformat, uint3 gridsize, float3 gridOrigin, float3 boundingBox, bool cudaArray, float3 *vertOut, float3 *normOut, float3 *colOut, unsigned int maxverts)
float computeSurfaceArea (float3 *verts, unsigned int triaCount)
void SetIsovalue (float isoval)
float GetIsovalue ()
unsigned int GetVertexCount ()
unsigned int GetActiveVoxelCount ()
unsigned int GetVoxelCount ()
bool UseColor ()
void Cleanup ()
size_t MemUsageAreaCalc (unsigned int triaCount) const

Static Public Methods

size_t MemUsageMC (unsigned int gx, unsigned int gy, unsigned int gz)


Member Enumeration Documentation

enum CUDAMarchingCubes::VolTexFormat
 

Enumeration values:
RGB3F 
RGB4U 

Definition at line 68 of file CUDAMarchingCubes.h.


Constructor & Destructor Documentation

CUDAMarchingCubes::CUDAMarchingCubes  
 

constructor.

Definition at line 683 of file CUDAMarchingCubes.cu.

References RGB3F.

CUDAMarchingCubes::~CUDAMarchingCubes  
 

destructor.

Definition at line 725 of file CUDAMarchingCubes.cu.

References Cleanup.


Member Function Documentation

void CUDAMarchingCubes::Cleanup  
 

Frees all allocated memory and resets all variables.

Definition at line 730 of file CUDAMarchingCubes.cu.

Referenced by computeIsosurface, Initialize, SetVolumeData, and ~CUDAMarchingCubes.

bool CUDAMarchingCubes::computeIsosurface float *    volume,
void *    colors,
VolTexFormat    texformat,
uint3    gridsize,
float3    gridOrigin,
float3    boundingBox,
bool    cudaArray,
float3 *    vertOut,
float3 *    normOut,
float3 *    colOut,
unsigned int    maxverts
 

Compute the isosurface using the Marching Cubes algorithm. The function initializes and frees device memory for each computation.

Parameters:
volume  The density grid values
colors  The color values per grid cell (may be NULL)
texformat  The volumetric texture format to be used
gridsize  The size of the density grid
gridOrigin  The cartesian coords of the grid's lower left corner
cudaArray  Must be 'true' for device memory, 'false' for host memory
vertOut  Triangle vertices (device memory, output)
normOut  Triangle vertex normals (device memory, output)
colOut  Triangle vertex colors (device memory, output)
maxverts  The maximum number of output vertices
boundingBox  The original boundig box dimensions

Definition at line 1274 of file CUDAMarchingCubes.cu.

References Cleanup, computeIsosurface, Initialize, and SetVolumeData.

void CUDAMarchingCubes::computeIsosurface float3 *    vertOut,
char3 *    normOut,
uchar4 *    colOut,
unsigned int    maxverts
 

Definition at line 1014 of file CUDAMarchingCubes.cu.

References make_float3, RGB3F, and RGB4U.

void CUDAMarchingCubes::computeIsosurface float3 *    vertOut,
float3 *    normOut,
uchar4 *    colOut,
unsigned int    maxverts
 

Definition at line 978 of file CUDAMarchingCubes.cu.

References make_float3, RGB3F, and RGB4U.

void CUDAMarchingCubes::computeIsosurface float3 *    vertOut,
float3 *    normOut,
float3 *    colOut,
unsigned int    maxverts
 

Compute the isosurface using the Marching Cubes algorithm.

Parameters:
vertOut  Triangle vertices (device memory, output)
normOut  Triangle vertex normals (device memory, output)
colOut  Triangle vertex colors (device memory, output)
maxverts  The maximum number of output vertices

Definition at line 943 of file CUDAMarchingCubes.cu.

References make_float3, RGB3F, and RGB4U.

Referenced by computeIsosurface.

float CUDAMarchingCubes::computeSurfaceArea float3 *    verts,
unsigned int    triaCount
 

Compute the surface area of the current isosurface.

Parameters:
verts  The vertex list of all triangles (device memory)
triaCount  The maximum number of output vertices
Returns:
The total surface area or -1 if anthing failed

Definition at line 1297 of file CUDAMarchingCubes.cu.

References ThrustScanWrapperArea.

unsigned int CUDAMarchingCubes::GetActiveVoxelCount   [inline]
 

Returns the total number of voxels that contribute to the isosurface.

Returns:
The voxel count

Definition at line 208 of file CUDAMarchingCubes.h.

float CUDAMarchingCubes::GetIsovalue   [inline]
 

Returns the current isovalue for the surface extraction.

Returns:
The isovalue used for the Marching Cubes computation

Definition at line 194 of file CUDAMarchingCubes.h.

uint3 CUDAMarchingCubes::GetMaxGridSize   const [inline]
 

Returns the maxgridsize supported by the current object

Returns:
Returns the maxgridsize supported by the current object

Definition at line 86 of file CUDAMarchingCubes.h.

unsigned int CUDAMarchingCubes::GetVertexCount   [inline]
 

Returns the total number of triangle vertices of the isosurface.

Returns:
The vertex count

Definition at line 201 of file CUDAMarchingCubes.h.

unsigned int CUDAMarchingCubes::GetVoxelCount   [inline]
 

Returns the total number of voxels.

Returns:
The voxel count

Definition at line 215 of file CUDAMarchingCubes.h.

bool CUDAMarchingCubes::Initialize uint3    maxgridsize
 

Initialization: Set variables and allocate device memory for computation

Parameters:
maxgridsize  The maximum size of the volumetric map in voxels
Returns:
'true' if initialization was successful, 'false' otherwise

Definition at line 1046 of file CUDAMarchingCubes.cu.

References Cleanup.

Referenced by computeIsosurface.

size_t CUDAMarchingCubes::MemUsageAreaCalc unsigned int    triaCount const [inline]
 

Return the amount of GPU memory that is be needed for the area calculation for a given number of triangles. TODO this number does not include memory for thrust::scan

Parameters:
triaCount  The number of triangles
Returns:
The memory size in bytes

Definition at line 258 of file CUDAMarchingCubes.h.

size_t CUDAMarchingCubes::MemUsageMC unsigned int    gx,
unsigned int    gy,
unsigned int    gz
[inline, static]
 

Return the amount of GPU memory that is be needed for the Marching Cubes calculation for a given grid size. TODO the allotments for the 3-D texture map and thrust are just a guess

Parameters:
gx  The width of the density grid
gy  The height of the density grid
gz  The depth of the density grid
Returns:
The memory size in bytes

Definition at line 239 of file CUDAMarchingCubes.h.

void CUDAMarchingCubes::SetIsovalue float    isoval [inline]
 

Set the isovalue for the surface extraction.

Parameters:
isoval  The isovalue used for the Marching Cubes computation

Definition at line 187 of file CUDAMarchingCubes.h.

void CUDAMarchingCubes::SetSubVolume uint3    start,
uint3    end
 

Set the volume sub-region for which the isosurface will be extracted.

Parameters:
start  starting voxel index for sub-region of volume
end  ending voxel index for sub-region of volume

Definition at line 1260 of file CUDAMarchingCubes.cu.

bool CUDAMarchingCubes::SetVolumeData float *    volume,
void *    colors,
VolTexFormat    texformat,
uint3    gridsize,
float3    gridOrigin,
float3    boundingBox,
bool    cudaArray
 

Set or update the density grid data. For device memory, this is just a pointer assignment. For host memory, this includes allocation of device memory and device-host copying.

Parameters:
volume  The density grid values
colors  The color values per grid cell (may be NULL)
texformat  The volumetric texture format to be used
gridsize  The size of the density grid (must comply with the grid size set at initialization!)
gridOrigin  Origin of the volume
boundingBox  The original boundig box dimensions
cudaArray  Must be 'true' for device memory, 'false' for host memory
Returns:
'true' if data assignment was successful, 'false' otherwise

Definition at line 1079 of file CUDAMarchingCubes.cu.

References Cleanup, make_float3, NULL, RGB3F, RGB4U, and size.

bool CUDAMarchingCubes::SetVolumeData float *    volume,
uchar4 *    colors,
uint3    gridsize,
float3    gridOrigin,
float3    boundingBox,
bool    cudaArray
 

Definition at line 1253 of file CUDAMarchingCubes.cu.

References RGB4U, and SetVolumeData.

bool CUDAMarchingCubes::SetVolumeData float *    volume,
float3 *    colors,
uint3    gridsize,
float3    gridOrigin,
float3    boundingBox,
bool    cudaArray
 

Set or update the density grid data. For device memory, this is just a pointer assignment. For host memory, this includes allocation of device memory and device-host copying.

Parameters:
volume  The density grid values
colors  The color values per grid cell (may be NULL)
gridsize  The size of the density grid (must comply with the grid size set at initialization!)
gridOrigin  Origin of the volume
boundingBox  The original boundig box dimensions
cudaArray  Must be 'true' for device memory, 'false' for host memory
Returns:
'true' if data assignment was successful, 'false' otherwise

Definition at line 1247 of file CUDAMarchingCubes.cu.

References RGB3F.

Referenced by computeIsosurface, and SetVolumeData.

bool CUDAMarchingCubes::UseColor   [inline]
 

Returns wether a color table was computed for the surface or not.

Returns:
'true' if colors were computed, 'false' otherwise

Definition at line 222 of file CUDAMarchingCubes.h.


The documentation for this class was generated from the following files:
Generated on Mon Apr 22 04:29:00 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002