OpenGL::Flat3dTextureSet Class Reference

#include <Flat3dTextureSet.h>

Inheritance diagram for OpenGL::Flat3dTextureSet:

OpenGL::IoTextureSet List of all members.

Public Member Functions

 Flat3dTextureSet (unsigned int computationWidth, unsigned int computationHeight, unsigned int computationDepth, GLenum target, GLint internalFormat)
void fillTexture (unsigned int textureId, unsigned int numChannels, const std::vector< float > &values)
void fillTexture (unsigned int textureId, const Util::VoxelGrid< Util::Color > &values)
Util::VoxelGrid< Util::ColorgetVoxelGrid (unsigned int textureId)
unsigned int getDomainLookup () const
unsigned int getNeighborLookup () const
unsigned int getOffsetLookup () const
unsigned int getSliceLookup () const
unsigned int getLayoutWidth () const
unsigned int getLayoutHeight () const
unsigned int getComputationWidth () const
unsigned int getComputationHeight () const
unsigned int getComputationDepth () const
std::pair< unsigned int, unsigned
int > 
getGlobalCoordinates (int x, int y, int z) const

Detailed Description

Flat3dTextureSet is a specialization of IoTextureSet for flat 3D textures. It maintains flat 3d texture representation of a 3d computation domain, and determines an efficient layout for texture tiles and creates domain, slice, and offset lookup textures needed by Cg programs operating on flat 3D textures. The depth slices of the 3d computation domain are stored as tiles in the flat 3d texture. In addition it provides functionality for writing voxel grid values to flat 3D textures without needing to know the internal representation.


Constructor & Destructor Documentation

OpenGL::Flat3dTextureSet::Flat3dTextureSet unsigned int  computationWidth,
unsigned int  computationHeight,
unsigned int  computationDepth,
GLenum  target,
GLint  internalFormat
 

Constructor.

Parameters:
computationWidth the width of the computation domain.
computationHeight the height of the computation domain.
computationDepth the depth of the computation domain.
target the OpenGL texture target.
internalFormat the internal format of the texture.


Member Function Documentation

void OpenGL::Flat3dTextureSet::fillTexture unsigned int  textureId,
const Util::VoxelGrid< Util::Color > &  values
 

Fills a flat 3d texture with Color values from a VoxelGrid representing the computation domain.

Parameters:
textureId the identifier of the texture to be filled.
values the Color values the texture should be filled with.

void OpenGL::Flat3dTextureSet::fillTexture unsigned int  textureId,
unsigned int  numChannels,
const std::vector< float > &  values
 

Fills a flat 3d texture with values from a float vector representing the computation domain. The vector layout should be on the following form: int offset = ((z * width + y) * height + x) * numChannels + channel

Parameters:
textureId the identifier of the texture to be filled.
numChannels the number of channels per pixels in the float vector. (Must be between 1 and 4).
values the pixel values the texture should be filled with.

unsigned int OpenGL::Flat3dTextureSet::getComputationDepth  )  const
 

Returns the depth of the computation domain.

Returns:
the computation depth.

unsigned int OpenGL::Flat3dTextureSet::getComputationHeight  )  const
 

Returns the height of the computation domain.

Returns:
the computation height.

unsigned int OpenGL::Flat3dTextureSet::getComputationWidth  )  const
 

Returns the width of the computation domain.

Returns:
the computation width.

unsigned int OpenGL::Flat3dTextureSet::getDomainLookup  )  const
 

The domain lookup texture has the same dimension as the flat 3d textures, and contains for each 2d coordinate the global 3d coordinates of the corresponding voxel in the computation domain.

Returns:
the identifier of the domain lookup texture.

std::pair< unsigned int, unsigned int > OpenGL::Flat3dTextureSet::getGlobalCoordinates int  x,
int  y,
int  z
const
 

Returns the local texture coordinates given the global x, y and z coordinate.

Parameters:
x the global x coordinate.
y the global y coordinate.
z the global z coordinate.
Returns:
the local texture coordinates (x and y).

unsigned int OpenGL::Flat3dTextureSet::getLayoutHeight  )  const
 

Returns the number of layout tiles in the y-direction of the flat 3d textures.

Returns:
the layout height.

unsigned int OpenGL::Flat3dTextureSet::getLayoutWidth  )  const
 

Returns the number of layout tiles in the x-direction of the flat 3d textures.

Returns:
the layout width.

unsigned int OpenGL::Flat3dTextureSet::getNeighborLookup  )  const
 

The neighbor lookup texture has the same dimension as the flat 3d textures, and contains for each 2d coordinate the 2d coordinates of the two neighboring voxels in the depth direction (xy and zw).

Returns:
the identifier of the neighbor lookup texture.

unsigned int OpenGL::Flat3dTextureSet::getOffsetLookup  )  const
 

The offset lookup texture has dimension depth x 1, and contains for each depth the offsets of the lower left corner of the corresponding tiles in the flat 3d textures.

Returns:
the identifier of the offset lookup texture.

unsigned int OpenGL::Flat3dTextureSet::getSliceLookup  )  const
 

The slice lookup texture has dimension 2*depth x 1, and contains offsets and directions for the various slices of the flat 3d textures.

Returns:
the identifier of the slice lookup texture.

Util::VoxelGrid< Util::Color > OpenGL::Flat3dTextureSet::getVoxelGrid unsigned int  textureId  ) 
 

Returns a VoxelGrid representation of a given flat 3d texture.

Parameters:
textureId the identifier of the texture.
Returns:
the VoxelGrid representation.


The documentation for this class was generated from the following files:
Generated on Fri Jun 16 08:42:52 2006 for GPU Thesis by  doxygen 1.4.6-NO