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

CUDAMarchingCubes.cu File Reference

#include "CUDAKernels.h"
#include "CUDAMarchingCubes.h"
#include <thrust/scan.h>
#include <thrust/functional.h>

Go to the source code of this file.

Defines

#define CUDAMARCHINGCUBES_INTERNAL   1
#define NTHREADS   48

Functions

__host__ __device__ float3 operator+ (float3 a, float3 b)
__host__ __device__ uint3 operator+ (uint3 a, uint3 b)
__host__ __device__ uint2 operator+ (uint2 a, uint2 b)
__host__ __device__ float3 operator- (float3 a, float3 b)
__host__ __device__ uint3 operator- (uint3 a, uint3 b)
__host__ __device__ float3 operator * (float b, float3 a)
__host__ __device__ float dot (float3 a, float3 b)
__device__ __host__ float3 lerp (float3 a, float3 b, float t)
__host__ __device__ float length (float3 v)
__device__ float sampleVolume (float *data, uint3 p, uint3 gridSize)
__device__ float3 sampleColors (float3 *data, uint3 p, uint3 gridSize)
__device__ uint3 calcGridPos (unsigned int i, uint3 gridSize)
__device__ float3 vertexInterp (float isolevel, float3 p0, float3 p1, float f0, float f1)
template<int gridis3d, int subgrid> __global__ void classifyVoxel (uint2 *voxelVerts, float *volume, uint3 gridSize, unsigned int numVoxels, float3 voxelSize, uint3 subGridStart, uint3 subGridEnd, float isoValue)
__global__ void compactVoxels (unsigned int *compactedVoxelArray, uint2 *voxelOccupied, unsigned int lastVoxel, unsigned int numVoxels, unsigned int numVoxelsp1)
__global__ void generateTriangleVerticesSMEM (float3 *pos, unsigned int *compactedVoxelArray, uint2 *numVertsScanned, float *volume, uint3 gridSize, float3 voxelSize, float isoValue, unsigned int activeVoxels, unsigned int maxVertsM3)
__global__ void offsetTriangleVertices (float3 *pos, float3 origin, unsigned int numVertsM1)
__global__ void generateTriangleNormals (float3 *pos, float3 *norm, float3 gridSizeInv, float3 bBoxInv, unsigned int numVerts)
__global__ void generateTriangleColorNormal (float3 *pos, float3 *col, float3 *norm, float3 *colors, uint3 gridSize, float3 gridSizeInv, float3 bBoxInv, unsigned int numVerts)
void allocateTextures (int **d_triTable, unsigned int **d_numVertsTable)
void bindVolumeTexture (cudaArray *d_vol, cudaChannelFormatDesc desc)
void ThrustScanWrapperUint2 (uint2 *output, uint2 *input, unsigned int numElements)
void ThrustScanWrapperArea (float *output, float *input, unsigned int numElements)
__global__ void computeTriangleAreas (float3 *pos, float *area, unsigned int maxTria)

Variables

texture< int, 1, cudaReadModeElementType > triTex
texture< unsigned int,
1, cudaReadModeElementType > 
numVertsTex
texture< float, 3, cudaReadModeElementType > volumeTex


Define Documentation

#define CUDAMARCHINGCUBES_INTERNAL   1
 

Definition at line 44 of file CUDAMarchingCubes.cu.

#define NTHREADS   48
 

Definition at line 51 of file CUDAMarchingCubes.cu.

Referenced by CUDAMarchingCubes::computeIsosurface, and generateTriangleVerticesSMEM.


Function Documentation

void allocateTextures int **    d_triTable,
unsigned int **    d_numVertsTable
 

Definition at line 467 of file CUDAMarchingCubes.cu.

References numVertsTex, and triTex.

Referenced by CUDAMarchingCubes::Initialize.

void bindVolumeTexture cudaArray *    d_vol,
cudaChannelFormatDesc    desc
 

Definition at line 480 of file CUDAMarchingCubes.cu.

References volumeTex.

Referenced by CUDAMarchingCubes::SetVolumeData.

__device__ uint3 calcGridPos unsigned int    i,
uint3    gridSize
 

Definition at line 129 of file CUDAMarchingCubes.cu.

Referenced by classifyVoxel, and generateTriangleVerticesSMEM.

template<int gridis3d, int subgrid>
__global__ void classifyVoxel uint2 *    voxelVerts,
float *    volume,
uint3    gridSize,
unsigned int    numVoxels,
float3    voxelSize,
uint3    subGridStart,
uint3    subGridEnd,
float    isoValue
 

Definition at line 149 of file CUDAMarchingCubes.cu.

References calcGridPos, numVertsTex, and sampleVolume.

__global__ void compactVoxels unsigned int *    compactedVoxelArray,
uint2 *    voxelOccupied,
unsigned int    lastVoxel,
unsigned int    numVoxels,
unsigned int    numVoxelsp1
 

Definition at line 243 of file CUDAMarchingCubes.cu.

__global__ void computeTriangleAreas float3 *    pos,
float *    area,
unsigned int    maxTria
 

Definition at line 517 of file CUDAMarchingCubes.cu.

References length.

__host__ __device__ float dot float3    a,
float3    b
[inline]
 

Definition at line 82 of file CUDAMarchingCubes.cu.

Referenced by length, main, and Wavefunction::sort_orbitals.

__global__ void generateTriangleColorNormal float3 *    pos,
float3 *    col,
float3 *    norm,
float3 *    colors,
uint3    gridSize,
float3    gridSizeInv,
float3    bBoxInv,
unsigned int    numVerts
 

Definition at line 403 of file CUDAMarchingCubes.cu.

References lerp, sampleColors, and volumeTex.

__global__ void generateTriangleNormals float3 *    pos,
float3 *    norm,
float3    gridSizeInv,
float3    bBoxInv,
unsigned int    numVerts
 

Definition at line 371 of file CUDAMarchingCubes.cu.

References volumeTex.

__global__ void generateTriangleVerticesSMEM float3 *    pos,
unsigned int *    compactedVoxelArray,
uint2 *    numVertsScanned,
float *    volume,
uint3    gridSize,
float3    voxelSize,
float    isoValue,
unsigned int    activeVoxels,
unsigned int    maxVertsM3
 

Definition at line 254 of file CUDAMarchingCubes.cu.

References calcGridPos, NTHREADS, numVertsTex, sampleVolume, triTex, and vertexInterp.

__host__ __device__ float length float3    v [inline]
 

Definition at line 92 of file CUDAMarchingCubes.cu.

References dot.

Referenced by cmd_rawtimestep, R3dDisplayDevice::comment, compile_branch, compile_regex, computeTriangleAreas, TclTextInterp::doEvent, TclTextInterp::evalFile, fill_header, find_fixedlength, imd_recv_header, imd_recv_header_nolengthswap, main, match, match_ref, obj_veclength, IMDSimThread::reader, JRegex::search, Mobile::sendMsgToClient, VMDDisplayList::set_clip_normal, transvec, Matrix4::transvec, transvecinv, Matrix4::transvecinv, IMDSimBlocking::update, vmdpcre_compile, and vmdpcre_exec.

__device__ __host__ float3 lerp float3    a,
float3    b,
float    t
[inline]
 

Definition at line 87 of file CUDAMarchingCubes.cu.

Referenced by generateTriangleColorNormal, and vertexInterp.

__global__ void offsetTriangleVertices float3 *    pos,
float3    origin,
unsigned int    numVertsM1
 

Definition at line 354 of file CUDAMarchingCubes.cu.

__host__ __device__ float3 operator * float    b,
float3    a
[inline]
 

Definition at line 77 of file CUDAMarchingCubes.cu.

__host__ __device__ uint2 operator+ uint2    a,
uint2    b
[inline]
 

Definition at line 64 of file CUDAMarchingCubes.cu.

__host__ __device__ uint3 operator+ uint3    a,
uint3    b
[inline]
 

Definition at line 61 of file CUDAMarchingCubes.cu.

__host__ __device__ float3 operator+ float3    a,
float3    b
[inline]
 

Definition at line 58 of file CUDAMarchingCubes.cu.

__host__ __device__ uint3 operator- uint3    a,
uint3    b
[inline]
 

Definition at line 72 of file CUDAMarchingCubes.cu.

__host__ __device__ float3 operator- float3    a,
float3    b
[inline]
 

Definition at line 69 of file CUDAMarchingCubes.cu.

__device__ float3 sampleColors float3 *    data,
uint3    p,
uint3    gridSize
 

Definition at line 118 of file CUDAMarchingCubes.cu.

References data.

Referenced by generateTriangleColorNormal.

__device__ float sampleVolume float *    data,
uint3    p,
uint3    gridSize
 

Definition at line 107 of file CUDAMarchingCubes.cu.

References data.

Referenced by classifyVoxel, and generateTriangleVerticesSMEM.

void ThrustScanWrapperArea float *    output,
float *    input,
unsigned int    numElements
 

Definition at line 510 of file CUDAMarchingCubes.cu.

Referenced by CUDAMarchingCubes::computeSurfaceArea.

void ThrustScanWrapperUint2 uint2 *    output,
uint2 *    input,
unsigned int    numElements
 

Definition at line 501 of file CUDAMarchingCubes.cu.

Referenced by CUDAMarchingCubes::computeIsosurface.

__device__ float3 vertexInterp float    isolevel,
float3    p0,
float3    p1,
float    f0,
float    f1
 

Definition at line 141 of file CUDAMarchingCubes.cu.

References lerp.

Referenced by generateTriangleVerticesSMEM.


Variable Documentation

texture<unsigned int, 1, cudaReadModeElementType> numVertsTex
 

Definition at line 102 of file CUDAMarchingCubes.cu.

Referenced by allocateTextures, classifyVoxel, and generateTriangleVerticesSMEM.

texture<int, 1, cudaReadModeElementType> triTex
 

Definition at line 101 of file CUDAMarchingCubes.cu.

Referenced by allocateTextures, and generateTriangleVerticesSMEM.

texture<float, 3, cudaReadModeElementType> volumeTex
 

Definition at line 104 of file CUDAMarchingCubes.cu.

Referenced by bindVolumeTexture, generateTriangleColorNormal, and generateTriangleNormals.


Generated on Sat May 26 01:48:44 2012 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002