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

vlVolIterConst< DataType, vlLayout::Linear > Class Template Reference

This class defines an iterator for "linear" data volumes. More...

#include <vlvoliter_linear_const.h>

Inheritance diagram for vlVolIterConst< DataType, vlLayout::Linear >:

vlVolIterBaseConst< DataType > vlVolIterSuperBase vlVolIter< DataType, vlLayout::Linear > List of all members.

Public Member Functions

 vlVolIterConst (const vlVolume *vol)
 Constructor when volume pointer is provided.

 vlVolIterConst (const vlVolData *data)
 Constructor when volume data pointer is provided.

 vlVolIterConst (const vlVolDataLayout< DataType, vlLayout::Linear > *data)
 Constructor when volume data in linear layout pointer is provided.

virtual ~vlVolIterConst ()
 default destructor

bool isValid ()
 Returns true if the iterator was properly initialized.

bool end ()
 Returns true if end of volume reached.

vlPoint3ui pos ()
 Return the position of the iterator.

bool moveTo (const vlPoint3ui &newPosition)
 move the iterator to voxel at newPosition - for random access

bool moveRelative (const vlOffset &offset)
 move the iterator by offset

DataType get ()
 Get the value of voxel at current position.

DataType getValueAt (const vlPoint3ui &pos)
 Get the value of voxel at the given position.

DataType getValueAt (const vlPoint3f &pos)
 Get the value of voxel at the given position - interpolation will be used.

bool operator++ ()
 move the iterator to the next position (no order assumed)

bool operator-- ()
 move the iterator to the previous position (no order assumed)

bool next ()
 move the iterator to the next voxel - NOTE : No order assumed - fastest traversal

void nextNBC ()
 move the iterator to the next voxel - WARNING : No bounds checking

bool nextXYZ ()
 move the iterator to the next voxel - move first along X, then Y and then Z

bool nextYZX ()
 move the iterator to the next voxel - move first along Y, then Z and then X

bool nextZXY ()
 move the iterator to the next voxel - move first along Z, then X and then Y

bool prev ()
 move the iterator to the previous voxel - NOTE : No order assumed - fastest traversal

void prevNBC ()
 move the iterator to the previous voxel - WARNING : No bounds checking

bool prevXYZ ()
 move the iterator to the previous voxel - move first along X, then Y and then Z

bool prevYZX ()
 move the iterator to the previous voxel - move first along Y, then Z and then X

bool prevZXY ()
 move the iterator to the previous voxel - move first along Z, then X and then Y

DataType getRelative (const vlOffset &offset)
 get value at a voxel with position delta from the current one

DataType getRelative (const vlPoint3f &delta)
 Get value at a point delta from the curret position of the iterator.

DataType getRelativeNBC (const vlOffset &offset)
 Same as getRelative but with NBC = No Boundary Check, thus faster.

DataType getRelativeX (const int32 offset)
 Get the voxel along X axis.

DataType getRelativeY (const int32 offset)
 Get the voxel along Y axis.

DataType getRelativeZ (const int32 offset)
 Get the voxel along Z axis.

bool setNeighborhood (const vlNeighborhood &neighborhood)
 Set the neighborhood of the current voxel to access.

DataType getNeighbor ()
 Get the value stored at currently selected neighboring voxel.

vlOffset getNeighborOffset ()
 Get the offset of the current neighbor in the neighborhood.

uint16 getNeighborId ()
 Get the id of the current neighbor in the neighborhood.

bool nextNeighbor ()
 Move the neighbor pointer to the next neighbor in the neighborhood list.

bool firstNeighbor ()
 Move the neighbor pointer to the first neighbor in the neighborhood list.

bool endOfNeighborhood ()
 This function checks if end of neighborhood is reached.

bool outside ()
 Returns the status of outside flag.

void resetOutside ()
 Explicitly reset the outside flag.

bool setInterpolation (const vlInterpolationType type)
 Set the type of interpolation to use whenever the need arises.

bool setInterpolation (const std::string &name)
 Same as previous function, except that it takes the name of interpolation as argument.

vlInterpolatorBase< DataType
> const * 
getInterpolator ()
 Returns pointer to the interpolator being used.

bool setVoxelOperation (const vlVoxelOpType type)
 Set the type of voxel operator to use.

bool setVoxelOperation (const std::string &name)
 Same as previous function, except that it takes the name of voxel operator as argument.

vlVoxelOpBase< DataType
> const * 
getVoxelOperator ()
 Returns pointer to the voxel operator being used.

bool getOp (DataType &value)
 Gets the value computed by the voxel operator.

bool getOp (vlVoxelOpValue &value)
 Gets the value computed by the voxel operator.

DataType getRelative (const int32 deltaOffset)
 Get value at a voxel with position deltaOffset from the current one.

DataType getRelativeNBC (const int32 deltaOffset)
 Same as getRelative(offset) but with NBC = No Boundary Check.


Protected Attributes

bool m_endOfNeighborhood
 Stores the end of neighborhood marker.

unsigned long m_voxelCount
 the total voxels in the volume

DataType * m_pFirstVoxel
 this will always point to the first voxel

DataType * m_pCurrVoxel
 this will always point to the current voxel

DataType * m_pLastVoxel
 Pointer to the last voxel of the volume.

vlVolDataLayout< DataType,
vlLayout::Linear > * 
m_data
 the volume data on which the iterator is defined

vlStep m_step
 Store the stepping distance along the three axis.

vlDim m_dim
 Store the dimensions of the volume.

vlDim m_dimLimit
 Limit for dimensions.

vlInterpolationType m_interpolation
 The type of interpolation to use.

bool m_outside
 Set to true if get*() accessed outside.

bool m_valid
 True if iterator is valid - initialized properly.

vlNeighborhood m_neighborhood
 Stores the neighborhood being used.

std::vector< vlOffset >::const_iterator m_currNeighbor
 Stores iterator which points to the current neighbor.

std::vector< vlOffset >::const_iterator m_endNeighbor
 Stores iterator which points to the end of offset list.

uint16 m_neighborId
 Stores the ID of the neighbor.

vlInterpolator< DataType,
vlLayout::Linear > * 
m_nativeIpolator
 Stores the pointer to native interpolator.

vlInterpolator< DataType,
vlLayout::VirtualCall > * 
m_virtualIpolator
 Stores the pointer to interpolator which uses VirtualCall iterator.

vlVoxelOperator< DataType,
vlLayout::Linear > * 
m_nativeVoxelOp
 Stores the pointer to native voxel operator.

vlVoxelOperator< DataType,
vlLayout::VirtualCall > * 
m_virtualVoxelOp
 Stores the pointer to voxel operator which uses VirtualCall iterator.


Detailed Description

template<class DataType>
class vlVolIterConst< DataType, vlLayout::Linear >

It is derived from vlVolIterator.

Todo:
Make & use local copies of m_step, m_dimLimit etc

Replace m_rData with m_pData and check performance

Add robust error checks - easy if moved to m_pData

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

Definition at line 49 of file vlvoliter_linear_const.h.


Constructor & Destructor Documentation

template<class DataType>
virtual vlVolIterConst< DataType, vlLayout::Linear >::~vlVolIterConst  )  [inline, virtual]
 


Member Function Documentation

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::end  )  [inline, virtual]
 

Implements vlVolIterBaseConst< DataType >.

Definition at line 152 of file vlvoliter_linear_const.h.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::endOfNeighborhood  )  [inline, virtual]
 

If it has reached, it returns true, else it returns false. End of neighborhood is defined as a call to nextNeighbor() when there are no more neighbors. That is, when nextNeighbor() is called while at the last neighbor. This function is useful mainly to write neat and easy-to-understand code like this:

 while(!iter.endOfNeighborhood()) {
  std::cout << iter.getNeighbor() << std::flush;
  iter.nextNeighbor();
 }

Implements vlVolIterBaseConst< DataType >.

Definition at line 256 of file vlvoliter_linear_const.h.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::firstNeighbor  )  [virtual]
 

Call this function to restart looping over the neighboring voxels.

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
DataType vlVolIterConst< DataType, vlLayout::Linear >::get  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
vlInterpolatorBase<DataType> const* vlVolIterConst< DataType, vlLayout::Linear >::getInterpolator  )  [virtual]
 

Returns 0L if no interpolator is set. This pointer can be used to get the type and name of the interpolator.

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
DataType vlVolIterConst< DataType, vlLayout::Linear >::getNeighbor  )  [virtual]
 

If a neighborhood is setup using a call to setNeighborhood(..), then there will always be a neighboring voxel that is selected at any given time. This function call will return the value at that voxel.

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
uint16 vlVolIterConst< DataType, vlLayout::Linear >::getNeighborId  )  [virtual]
 

This id is basically the position of the neighbor in the neighborhood list. Thus, this id can be used to access the neighbor's properties stored in vlNeighborhood or the classes that derive from it.

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
vlOffset vlVolIterConst< DataType, vlLayout::Linear >::getNeighborOffset  )  [virtual]
 

The offset is the location of the neighbor w.r.t. the current location.

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::getOp vlVoxelOpValue value  )  [virtual]
 

Use this function call when the voxel operation returns arbitrary data (i.e. not a voxel). Make sure you have set the voxel operator using setVoxelOp(...) before calling this function.

See also:
setVoxelOp()

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::getOp DataType &  value  )  [virtual]
 

Use this function call when the voxel operation returns a voxel as a result. Make sure you have set the voxel operator using setVoxelOp(...) before calling this function.

See also:
setVoxelOp()

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
DataType vlVolIterConst< DataType, vlLayout::Linear >::getRelative const int32  deltaOffset  ) 
 

NOTE : This function is available only for Linear layout.

template<class DataType>
DataType vlVolIterConst< DataType, vlLayout::Linear >::getRelative const vlPoint3f delta  )  [virtual]
 

This will be an iterpolated value. Set the type of interpolation using setIterpolation() NOTE : Not implmented as of this update of the documentation.

Todo:
Implement interpolation.

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
DataType vlVolIterConst< DataType, vlLayout::Linear >::getRelative const vlOffset offset  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
DataType vlVolIterConst< DataType, vlLayout::Linear >::getRelativeNBC const int32  deltaOffset  ) 
 

NOTE : This function is available only for Linear layout.

template<class DataType>
DataType vlVolIterConst< DataType, vlLayout::Linear >::getRelativeNBC const vlOffset offset  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
DataType vlVolIterConst< DataType, vlLayout::Linear >::getRelativeX const int32  offset  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
DataType vlVolIterConst< DataType, vlLayout::Linear >::getRelativeY const int32  offset  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
DataType vlVolIterConst< DataType, vlLayout::Linear >::getRelativeZ const int32  offset  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
DataType vlVolIterConst< DataType, vlLayout::Linear >::getValueAt const vlPoint3f pos  )  [virtual]
 

Set the type of interpolation to use using setInterpolation(). NOTE : Not implmented as of this update of the documentation.

Todo:
Implement interpolation.

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
DataType vlVolIterConst< DataType, vlLayout::Linear >::getValueAt const vlPoint3ui pos  )  [virtual]
 

NOTE : Not implemented yet.

Todo:
Implement getValueAt(vlPoint3ui pos)

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
vlVoxelOpBase<DataType> const* vlVolIterConst< DataType, vlLayout::Linear >::getVoxelOperator  )  [virtual]
 

Returns 0L if no voxel operator is used. This pointer can be used to get the type and name of the voxel operator. In addition, this can be used to optionally configure the operator.

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::isValid  )  [inline, virtual]
 

Implements vlVolIterSuperBase.

Definition at line 146 of file vlvoliter_linear_const.h.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::moveRelative const vlOffset offset  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::moveTo const vlPoint3ui newPosition  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::next  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
void vlVolIterConst< DataType, vlLayout::Linear >::nextNBC  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::nextNeighbor  )  [virtual]
 

If there are no more neighbors left, then the function will return false.

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::nextXYZ  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::nextYZX  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::nextZXY  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::operator++  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::operator--  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::outside  )  [inline, virtual]
 

Implements vlVolIterBaseConst< DataType >.

Definition at line 259 of file vlvoliter_linear_const.h.

template<class DataType>
vlPoint3ui vlVolIterConst< DataType, vlLayout::Linear >::pos  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::prev  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
void vlVolIterConst< DataType, vlLayout::Linear >::prevNBC  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::prevXYZ  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::prevYZX  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::prevZXY  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
void vlVolIterConst< DataType, vlLayout::Linear >::resetOutside  )  [inline, virtual]
 

Implements vlVolIterBaseConst< DataType >.

Definition at line 262 of file vlvoliter_linear_const.h.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::setInterpolation const std::string &  name  )  [virtual]
 

Do not use this function unless you want to use a interpolation plugin about which OpenVL has no idea (i.e. there is no interpolation type specified in vlInterpolationType.

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::setInterpolation const vlInterpolationType  type  )  [virtual]
 

For e.g., getValueAt(float) will need interpolation to get value at non-grid points.

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::setNeighborhood const vlNeighborhood neighborhood  )  [virtual]
 

A neighborhood is defined by a list of offsets stored in the vlNeighborhood object.

See also:
vlNeighborhood

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::setVoxelOperation const std::string &  name  )  [virtual]
 

Do not use this function unless you want to use a voxel operator plugin about which OpenVL has no idea (i.e. there is no voxel operator type specified in vlVoxelOpType)

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::setVoxelOperation const vlVoxelOpType  type  )  [virtual]
 

This operator will be used to perform the operation when getOp() is called.

Implements vlVolIterBaseConst< DataType >.

template<class DataType>
vlVolIterConst< DataType, vlLayout::Linear >::vlVolIterConst const vlVolDataLayout< DataType, vlLayout::Linear > *  data  )  [inline]
 

template<class DataType>
vlVolIterConst< DataType, vlLayout::Linear >::vlVolIterConst const vlVolData data  )  [inline]
 

template<class DataType>
vlVolIterConst< DataType, vlLayout::Linear >::vlVolIterConst const vlVolume vol  )  [inline]
 


Member Data Documentation

template<class DataType>
std::vector<vlOffset>::const_iterator vlVolIterConst< DataType, vlLayout::Linear >::m_currNeighbor [protected]
 

Definition at line 341 of file vlvoliter_linear_const.h.

template<class DataType>
vlVolDataLayout<DataType, vlLayout::Linear>* vlVolIterConst< DataType, vlLayout::Linear >::m_data [protected]
 

Definition at line 317 of file vlvoliter_linear_const.h.

template<class DataType>
vlDim vlVolIterConst< DataType, vlLayout::Linear >::m_dim [protected]
 

Definition at line 323 of file vlvoliter_linear_const.h.

template<class DataType>
vlDim vlVolIterConst< DataType, vlLayout::Linear >::m_dimLimit [protected]
 

Definition at line 326 of file vlvoliter_linear_const.h.

template<class DataType>
std::vector<vlOffset>::const_iterator vlVolIterConst< DataType, vlLayout::Linear >::m_endNeighbor [protected]
 

Definition at line 344 of file vlvoliter_linear_const.h.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::m_endOfNeighborhood [protected]
 

Set to true when nextNeighbor() is called while at the last voxel in then neighborhood list.

Definition at line 302 of file vlvoliter_linear_const.h.

template<class DataType>
vlInterpolationType vlVolIterConst< DataType, vlLayout::Linear >::m_interpolation [protected]
 

Definition at line 329 of file vlvoliter_linear_const.h.

template<class DataType>
vlInterpolator<DataType, vlLayout::Linear>* vlVolIterConst< DataType, vlLayout::Linear >::m_nativeIpolator [protected]
 

Definition at line 350 of file vlvoliter_linear_const.h.

template<class DataType>
vlVoxelOperator<DataType, vlLayout::Linear>* vlVolIterConst< DataType, vlLayout::Linear >::m_nativeVoxelOp [protected]
 

Definition at line 356 of file vlvoliter_linear_const.h.

template<class DataType>
vlNeighborhood vlVolIterConst< DataType, vlLayout::Linear >::m_neighborhood [protected]
 

Definition at line 338 of file vlvoliter_linear_const.h.

template<class DataType>
uint16 vlVolIterConst< DataType, vlLayout::Linear >::m_neighborId [protected]
 

Definition at line 347 of file vlvoliter_linear_const.h.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::m_outside [protected]
 

Definition at line 332 of file vlvoliter_linear_const.h.

template<class DataType>
DataType* vlVolIterConst< DataType, vlLayout::Linear >::m_pCurrVoxel [protected]
 

Definition at line 311 of file vlvoliter_linear_const.h.

template<class DataType>
DataType* vlVolIterConst< DataType, vlLayout::Linear >::m_pFirstVoxel [protected]
 

Definition at line 308 of file vlvoliter_linear_const.h.

template<class DataType>
DataType* vlVolIterConst< DataType, vlLayout::Linear >::m_pLastVoxel [protected]
 

Definition at line 314 of file vlvoliter_linear_const.h.

template<class DataType>
vlStep vlVolIterConst< DataType, vlLayout::Linear >::m_step [protected]
 

Definition at line 320 of file vlvoliter_linear_const.h.

template<class DataType>
bool vlVolIterConst< DataType, vlLayout::Linear >::m_valid [protected]
 

Definition at line 335 of file vlvoliter_linear_const.h.

template<class DataType>
vlInterpolator<DataType, vlLayout::VirtualCall>* vlVolIterConst< DataType, vlLayout::Linear >::m_virtualIpolator [protected]
 

Definition at line 353 of file vlvoliter_linear_const.h.

template<class DataType>
vlVoxelOperator<DataType, vlLayout::VirtualCall>* vlVolIterConst< DataType, vlLayout::Linear >::m_virtualVoxelOp [protected]
 

Definition at line 359 of file vlvoliter_linear_const.h.

template<class DataType>
unsigned long vlVolIterConst< DataType, vlLayout::Linear >::m_voxelCount [protected]
 

Definition at line 305 of file vlvoliter_linear_const.h.


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