OpenGL Volumizer 2.7 Reference Pages


NAME
vzBlock - Volumetric geometry representing an axis-aligned cuboid.

INHERITS FROM
vzVolumeGeometry

HEADER FILE
#include <Volumizer2/Block.h>

PUBLIC METHOD SUMMARY
vzBlock (  );
void setOffsets ( const float offsets[3]);
void setDimensions ( const float dims[3]);
void getOffsets ( float offsets[3]) const;
void getDimensions ( float dims[3]) const;
vzUnstructuredTetraMesh* tessellate (  ) const;

PROTECTED METHOD SUMMARY
virtual ~vzBlock (  );

CLASS DESCRIPTION
vzBlock provides a simple abstraction for an axis aligned cuboid. This class is the simplest and one of the most commonly used volumetric geometry types in volume rendering applications. The cuboid is described by setting the offsets and dimensions along each of the X, Y and Z axes.

METHOD DESCRIPTIONS

   vzBlock()
vzBlock (  );

Constructor for vzBlock. The vzBlock is constructed with default offset of (0, 0, 0) and dimensions of (1, 1, 1).

   ~vzBlock()
virtual ~vzBlock (  );

Destructor for the vzBlock.

   getDimensions()
void getDimensions ( float dims[3]) const;

Get the dimensions of the vzBlock.

   getOffsets()
void getOffsets ( float offsets[3]) const;

Get the offset of the vzBlock (the minimum x,y,z values.)

   setDimensions()
void setDimensions ( const float dims[3]);

Set the dimensions of the vzBlock. The dimensions of the cuboid correpond to the lengths of each of its axes. The following function reduces the dimensions of the cuboid by half -
// Function to change the dimensions of the given vzBlock
void shrinkBlock(vzBlock *block) {
   
   // Dimensions
   float dimensions[3];

   // Get the current dimensions
   block->getDimensions(dimensions);

   // Divide the dimensions by half
   for(int i = 0; i < 3; i++)
       dimensions[i] /= 2;
  
   // Set the new dimensions
   block->setDimensions(dimensions);
}

   setOffsets()
void setOffsets ( const float offsets[3]);

Set the offset of the vzBlock which correspond to the minumum X, Y and Z values for the geometry.

   tessellate()
vzUnstructuredTetraMesh* tessellate (  ) const;

Tessellate the vzBlock into a vzUnstructuredTetraMesh. The tessellation generates a simple tetrahedral mesh with 5 tetrahedra and 8 vertices.

SEE ALSO
vzBlock, vzUnstructuredTetraMesh, vzVolumeGeometry

Back to Index