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

vlVolDataLayout< DataType, LayoutType > Class Template Reference

This class implements a disk-based storage layout for volumetric data. More...

#include <vlvoldata_diskraw.h>

Inheritance diagram for vlVolDataLayout< DataType, LayoutType >:

vlVolDataLayoutBase< DataType > vlVolDataLayoutBase< DataType > vlVolData vlVolData List of all members.

Public Member Functions

 vlVolDataLayout (const vlDim &dim, const vlUnit &units=vlUnit(1.0, 1.0, 1.0))
 Default constructor.

virtual ~vlVolDataLayout ()
 Default destructor.

DataType getVoxel (const vlPoint3ui &position) const
 Get the voxel value at the given position.

DataType getVoxel (const vlPoint3f &position) const
 Get the voxel value at the given position.

bool setVoxel (vlPoint3ui const &position, DataType const voxel)
 Set the voxel at given position to the given value.

bool isValid () const
 Returns true if the data is valid.

bool clear (const uint8 data=0x00)
 Clears the volume data with the given data.

void * getVoxelVoidPtr (const vlPoint3ui &position) const
 Returns the pointer to the voxel at the given position.

DataType * getVoxelPtr (const vlPoint3ui &position) const
 Returns the pointer to the voxel at the given position.

 vlVolDataLayout (const vlDim &dim, const vlUnit &units=vlUnit(1.0, 1.0, 1.0))
 Default constructor.

virtual ~vlVolDataLayout ()
 Default destructor.

DataType getVoxel (const vlPoint3ui &position) const
 Get the voxel value at the given position.

DataType getVoxel (const vlPoint3f &position) const
 Get the voxel value at the given position.

bool setVoxel (vlPoint3ui const &position, DataType const voxel)
 Set the voxel at given position to the given value.

bool isValid () const
 Returns true if the data is valid.

bool clear (const uint8 data=0x00)
 Clears the volume data with the given data.

void * getVoxelVoidPtr (const vlPoint3ui &position) const
 Returns the pointer to the voxel at the given position.

DataType * getVoxelPtr (const vlPoint3ui &position) const
 Returns the pointer to the voxel at the given position.


Protected Member Functions

DataType * dataPtr () const
 Return a const pointer to the stored data.


Private Attributes

FILE * m_fp
 File pointer to the data.

vlDim m_dimLimit
 this is dimension-1 in each direction. for speeding up bounds checking - save one subtraction

DataType * m_pData
 pointer to the linear data


Friends

class vlVolIterConst< DataType, LayoutType >
class vlVolIter< DataType, LayoutType >

Detailed Description

template<typename DataType>
class vlVolDataLayout< DataType, LayoutType >

The entire data is stored in a file on disk. When the data is accessed, it is accessed directly from the disk. This layout does not load or try to load any part of the data into memory. The idea is to let the operating system (OS) handle the caching for us. This way, the total memory used by the data is 0 bytes. Whatever memory is allocated, is done by the OS as a cache. This memory will be freed and given to other programs if the machine is short on main memory.

The data access is implemented using the file i/o functionailty provided by the underlying OS.

Author:
Sarang Lakare <sarang#users.sf.net>

Definition at line 61 of file vlvoldata_diskraw.h.


Constructor & Destructor Documentation

template<class DataType>
vlVolDataLayout< DataType, LayoutType >::~vlVolDataLayout  )  [virtual]
 

Parameters:
DataType the type of data to be stored.

Definition at line 160 of file vlvoldata_diskraw.h.

template<typename DataType>
virtual vlVolDataLayout< DataType, LayoutType >::~vlVolDataLayout  )  [virtual]
 


Member Function Documentation

template<typename DataType>
bool vlVolDataLayout< DataType, LayoutType >::clear const uint8  data = 0x00  )  [virtual]
 

Implements vlVolDataLayoutBase< DataType >.

template<class DataType>
bool vlVolDataLayout< DataType, LayoutType >::clear const uint8  data = 0x00  )  [inline, virtual]
 

Implements vlVolDataLayoutBase< DataType >.

Definition at line 237 of file vlvoldata_diskraw.h.

template<typename DataType>
DataType* vlVolDataLayout< DataType, LayoutType >::dataPtr  )  const [inline, protected]
 

Definition at line 101 of file vlvoldata_rlencode.h.

template<typename DataType>
DataType vlVolDataLayout< DataType, LayoutType >::getVoxel const vlPoint3f position  )  const [virtual]
 

Implements vlVolDataLayoutBase< DataType >.

template<typename DataType>
DataType vlVolDataLayout< DataType, LayoutType >::getVoxel const vlPoint3ui position  )  const [virtual]
 

Implements vlVolDataLayoutBase< DataType >.

template<class DataType>
DataType vlVolDataLayout< DataType, LayoutType >::getVoxel const vlPoint3f position  )  const [inline, virtual]
 

Parameters:
DataType 
position position of the voxel (x,y,z)
Returns:
voxel value at the given position

Implements vlVolDataLayoutBase< DataType >.

Definition at line 197 of file vlvoldata_diskraw.h.

References vlTriple< float >::x(), vlTriple< float >::y(), and vlTriple< float >::z().

template<class DataType>
DataType vlVolDataLayout< DataType, LayoutType >::getVoxel const vlPoint3ui position  )  const [inline, virtual]
 

Parameters:
DataType 
position position of the voxel (x,y,z)
Returns:
voxel value at the given position

Implements vlVolDataLayoutBase< DataType >.

Definition at line 174 of file vlvoldata_diskraw.h.

References vlTriple< uint16 >::x(), vlTriple< uint16 >::y(), and vlTriple< uint16 >::z().

template<typename DataType>
DataType* vlVolDataLayout< DataType, LayoutType >::getVoxelPtr const vlPoint3ui position  )  const [virtual]
 

Do not use this unless it is absolutely necessary. Use iterators instead.

Parameters:
position location of the voxel in 3D.
Returns:
void * pointer to the memory location of the voxel.

Implements vlVolDataLayoutBase< DataType >.

template<class DataType>
DataType * vlVolDataLayout< DataType, LayoutType >::getVoxelPtr const vlPoint3ui position  )  const [inline, virtual]
 

Do not use this unless it is absolutely necessary. Use iterators instead.

Parameters:
position location of the voxel in 3D.
Returns:
void * pointer to the memory location of the voxel.

Implements vlVolDataLayoutBase< DataType >.

Definition at line 252 of file vlvoldata_diskraw.h.

template<typename DataType>
void* vlVolDataLayout< DataType, LayoutType >::getVoxelVoidPtr const vlPoint3ui position  )  const [inline, virtual]
 

This returns a void pointer, so make sure you cast it to the correct type. To avoid type-conflicts, "use iterators".

Parameters:
position location of the voxel in 3D.
Returns:
void * pointer to the memory location of the voxel.

Reimplemented from vlVolDataLayoutBase< DataType >.

Definition at line 87 of file vlvoldata_rlencode.h.

References vlVolDataLayout< DataType, Layout >::getVoxelPtr().

template<typename DataType>
void* vlVolDataLayout< DataType, LayoutType >::getVoxelVoidPtr const vlPoint3ui position  )  const [inline, virtual]
 

This returns a void pointer, so make sure you cast it to the correct type. To avoid type-conflicts, "use iterators".

Parameters:
position location of the voxel in 3D.
Returns:
void * pointer to the memory location of the voxel.

Reimplemented from vlVolDataLayoutBase< DataType >.

Definition at line 96 of file vlvoldata_diskraw.h.

References vlVolDataLayout< DataType, Layout >::getVoxelPtr().

template<typename DataType>
bool vlVolDataLayout< DataType, LayoutType >::isValid  )  const [inline, virtual]
 

Implements vlVolDataLayoutBase< DataType >.

Definition at line 75 of file vlvoldata_rlencode.h.

template<typename DataType>
bool vlVolDataLayout< DataType, LayoutType >::isValid  )  const [inline, virtual]
 

Implements vlVolDataLayoutBase< DataType >.

Definition at line 84 of file vlvoldata_diskraw.h.

template<typename DataType>
bool vlVolDataLayout< DataType, LayoutType >::setVoxel vlPoint3ui const &  position,
DataType const  voxel
 

template<typename DataType>
bool vlVolDataLayout< DataType, LayoutType >::setVoxel vlPoint3ui const &  position,
DataType const  voxel
 

template<typename DataType>
vlVolDataLayout< DataType, LayoutType >::vlVolDataLayout const vlDim dim,
const vlUnit units = vlUnit(1.0, 1.0, 1.0)
 

template<class DataType>
vlVolDataLayout< DataType, LayoutType >::vlVolDataLayout const vlDim dim,
const vlUnit units = vlUnit(1.0, 1.0, 1.0)
 

Parameters:
DataType the type of data to be stored.
dim dimensions of the data.
dataType type of the data to be stored.

Definition at line 129 of file vlvoldata_diskraw.h.

References getVariableDataType, LayoutType, vlVolData::m_bitsPerVoxel, vlVolData::m_bytesPerVoxel, vlVolData::m_dataType, vlVolData::m_dim, UnsignedInt8, vlTriple< uint16 >::x(), vlTriple< uint16 >::y(), and vlTriple< uint16 >::z().


Friends And Related Function Documentation

template<typename DataType>
friend class vlVolIter< DataType, LayoutType > [friend]
 

Definition at line 57 of file vlvoldata_rlencode.h.

template<typename DataType>
friend class vlVolIterConst< DataType, LayoutType > [friend]
 

Definition at line 56 of file vlvoldata_rlencode.h.


Member Data Documentation

template<typename DataType>
vlDim vlVolDataLayout< DataType, LayoutType >::m_dimLimit [private]
 

Definition at line 108 of file vlvoldata_rlencode.h.

template<typename DataType>
FILE* vlVolDataLayout< DataType, LayoutType >::m_fp [private]
 

Definition at line 114 of file vlvoldata_diskraw.h.

template<typename DataType>
DataType* vlVolDataLayout< DataType, LayoutType >::m_pData [private]
 

Definition at line 105 of file vlvoldata_rlencode.h.


The documentation for this class was generated from the following files:
Generated on Fri Mar 18 11:33:20 2005 for OpenVL by doxygen 1.3.3