Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics
[Home] [Tutorials] [All Classes] [Grouped Classes]
Classes | Public Member Functions | Protected Attributes

vlVolume::Volume Class Reference

Defines the volume data to be used with a MarchingCube object. More...

#include <MarchingCubes.hpp>

Inheritance diagram for vlVolume::Volume:
vl::Object

List of all members.

Classes

struct  Cube
 A Volume cell.

Public Member Functions

 Volume ()
virtual const char * className ()
 Returns the name of the class.
void setup (float *data, const vl::fvec3 &bottom_left, const vl::fvec3 &top_right, const vl::ivec3 &slices)
void setup (const Volume &)
vl::ref< Volumedownsample () const
 Returns a new volume which is half of the size of the original volume in each direction (thus requires up to 1/8th of the memory).
const float * values () const
float * values ()
const float & value (int i) const
float & value (int i)
const float & value (int x, int y, int z) const
float & value (int x, int y, int z)
void normalHQ (vl::fvec3 &normal, const vl::fvec3 &v, float dx, float dy, float dz)
 Computes a high quality normal (best rendering quality)
void normalLQ (vl::fvec3 &normal, const vl::fvec3 &v, float dx, float dy, float dz)
 Computes a low quality normal (best performances)
float sampleSmooth (float x, float y, float z) const
 Samples the volume using tri-linear interpolation sampling.
float sampleNearest (float x, float y, float z) const
 Samples the volume using nearest point sampling.
vl::fvec3 coordinate (int x, int y, int z) const
const vl::fvec3bottomLeft () const
const vl::fvec3topRight () const
const vl::ivec3slices () const
vl::fvec3 size () const
float computeMinimum () const
float computeMaximum () const
float computeAverage () const
float minimum () const
float maximum () const
float average () const
const Volume::Cube & cube (int x, int y, int z) const
const vl::fvec3cellSize () const
 Returns the x/y/z size of a cell.
bool dataIsDirty () const
 Returns true if the internal data hasn't been updated since the last call to setDataDirty() or setup()
void setDataDirty ()
 Notifies that the data of a Volume has changed and that the internal acceleration structures should be recomputed.
void setupInternalData ()

Protected Attributes

std::vector< float > mValues
vl::fvec3 mBottomLeft
vl::fvec3 mTopRight
vl::fvec3 mSize
vl::ivec3 mSlices
vl::fvec3 mCellSize
float mMinimum
float mMaximum
float mAverage
bool mDataIsDirty
std::vector< Cube > mCubes

Detailed Description

Defines the volume data to be used with a MarchingCube object.


Constructor & Destructor Documentation

Volume::Volume (  )

Member Function Documentation

virtual const char* vlVolume::Volume::className (  ) [inline, virtual]

Returns the name of the class.

Reimplemented from vl::Object.

void Volume::setup ( float *  data,
const vl::fvec3 bottom_left,
const vl::fvec3 top_right,
const vl::ivec3 slices 
)
void Volume::setup ( const Volume volume )
ref< Volume > Volume::downsample (  ) const

Returns a new volume which is half of the size of the original volume in each direction (thus requires up to 1/8th of the memory).

Use this function when the volume data to be processed is too big or produces too many polygons.

const float* vlVolume::Volume::values (  ) const [inline]
float* vlVolume::Volume::values (  ) [inline]
const float& vlVolume::Volume::value ( int  i ) const [inline]
float& vlVolume::Volume::value ( int  i ) [inline]
const float& vlVolume::Volume::value ( int  x,
int  y,
int  z 
) const [inline]
float& vlVolume::Volume::value ( int  x,
int  y,
int  z 
) [inline]
void Volume::normalHQ ( vl::fvec3 normal,
const vl::fvec3 v,
float  dx,
float  dy,
float  dz 
)

Computes a high quality normal (best rendering quality)

void Volume::normalLQ ( vl::fvec3 normal,
const vl::fvec3 v,
float  dx,
float  dy,
float  dz 
)

Computes a low quality normal (best performances)

float Volume::sampleSmooth ( float  x,
float  y,
float  z 
) const

Samples the volume using tri-linear interpolation sampling.

float Volume::sampleNearest ( float  x,
float  y,
float  z 
) const

Samples the volume using nearest point sampling.

vl::fvec3 vlVolume::Volume::coordinate ( int  x,
int  y,
int  z 
) const [inline]
const vl::fvec3& vlVolume::Volume::bottomLeft (  ) const [inline]
const vl::fvec3& vlVolume::Volume::topRight (  ) const [inline]
const vl::ivec3& vlVolume::Volume::slices (  ) const [inline]
vl::fvec3 vlVolume::Volume::size (  ) const [inline]
float Volume::computeMinimum (  ) const
float Volume::computeMaximum (  ) const
float Volume::computeAverage (  ) const
float vlVolume::Volume::minimum (  ) const [inline]
float vlVolume::Volume::maximum (  ) const [inline]
float vlVolume::Volume::average (  ) const [inline]
const Volume::Cube& vlVolume::Volume::cube ( int  x,
int  y,
int  z 
) const [inline]
const vl::fvec3& vlVolume::Volume::cellSize (  ) const [inline]

Returns the x/y/z size of a cell.

bool vlVolume::Volume::dataIsDirty (  ) const [inline]

Returns true if the internal data hasn't been updated since the last call to setDataDirty() or setup()

void vlVolume::Volume::setDataDirty (  ) [inline]

Notifies that the data of a Volume has changed and that the internal acceleration structures should be recomputed.

void Volume::setupInternalData (  )

Member Data Documentation

std::vector<float> vlVolume::Volume::mValues [protected]
float vlVolume::Volume::mMinimum [protected]
float vlVolume::Volume::mMaximum [protected]
float vlVolume::Volume::mAverage [protected]
std::vector<Cube> vlVolume::Volume::mCubes [protected]

The documentation for this class was generated from the following files:

Visualization Library v2010.11.1123 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Thu Nov 18 2010 02:08:19.
Permission is granted to use this page to write and publish articles regarding Visualization Library.