MeVisLabToolboxReference
SoVirtualVolume Class Reference

The SoVirtualVolume class for fast voxel based access to paged ML images; see also mlVirtualVolume and mlTVirtualVolume in project MLTools for examples etc. More...

#include <SoVirtualVolume.h>

List of all members.

Public Member Functions

SO_VIRTUALVOLUME_EXPORT SoVirtualVolume (SoSFMLImage &image, MLDataType dType=ML_INVALID_DATA_TYPE, long maxNumKB=-1, bool useExceptions=false)
 Constructor which creates a SoVirtualVolume interface to an ML paged image hidden behind image.
SO_VIRTUALVOLUME_EXPORT SoVirtualVolume (const XVImageSize &ext=XVImageSize(0), long double fillVal=0, MLDataType dType=MLuint8Type, long maxNumKB=-1, bool useExceptions=false)
 Constructor to map an image of extents ext filled with fillVal.
virtual SO_VIRTUALVOLUME_EXPORT ~SoVirtualVolume ()
 Destructor.
SO_VIRTUALVOLUME_EXPORT bool isValid () const
 Returns true if access methods may be called, otherwise false.
SO_VIRTUALVOLUME_EXPORT
SoSFMLImage
getImage () const
 Returns the SoSFMLImage the SoVirtualVolume is associated to or NULL if it's a Virtual Volume of user defined extents and contents.
SO_VIRTUALVOLUME_EXPORT MLDataType getDataType () const
 Returns the data type used as internal data type of the virtual volume or - if currently no valid virtual volume exists - the value passed as dType to the constructor.
long getMaxNumKB () const
 Returns the maxNumKB value passed to the constructor.
bool areExceptionsOn () const
 Returns the useExceptions value passed to the constructor.
SO_VIRTUALVOLUME_EXPORT
unsigned long 
getNumMappedPages () const
 Returns number of currently mapped (volatile) pages. Written pages are counted only temporarily here.
SO_VIRTUALVOLUME_EXPORT
unsigned long 
getNumWrittenPages ()
 Returns number of written (and therefore locked) pages.
SO_VIRTUALVOLUME_EXPORT
unsigned long 
getNumPages () const
 Returns number of all (mapped and written) pages.
SO_VIRTUALVOLUME_EXPORT
unsigned long 
getNumBytes () const
 Returns number of bytes currently allocated as pages in the virtual volume.
SO_VIRTUALVOLUME_EXPORT XVImageSize getPageExtent () const
 Returns extents of a written and read pages used by the virtual volume.
SO_VIRTUALVOLUME_EXPORT XVImageSize getPageArrayExtent () const
 Returns extents of the array of page buffers.
SO_VIRTUALVOLUME_EXPORT void * getWrittenPageData (MLuint32 wp)
 Returns untyped pointer to data of written page with page id wp.
SO_VIRTUALVOLUME_EXPORT void unMapAndClearWrittenPages ()
 This function throws away all written pages.
SO_VIRTUALVOLUME_EXPORT void resize (const XVImageSize &newExt)
 This method resizes the virtual volume to the extents given by ext.
Functions for virtual volume access and cursor movement, filling etc.

See documentation of corresponding functions in ML_NAMESPACE::TVirtualVolume for a detailed description.

Note:
Template versions of cursor voxel and voxel access functions are often faster since data values are not cast as in the non template versions.
Casting XVIMageSize to ml:ImageVector is legal, the guarantee that they can be cast is guaranteed by checks in SoVirtualVolumeInit. Without that cast a strong performance downgrade would result.
const XVImageSizegetCursorPosition ()
MLint getIntValue (const XVImageSize &pos)
MLint64 getInt64Value (const XVImageSize &pos)
MLdouble getDoubleValue (const XVImageSize &pos)
MLldouble getLDoubleValue (const XVImageSize &pos)
MLint getIntCursorValue ()
MLint64 getInt64CursorValue ()
MLdouble getDoubleCursorValue ()
MLldouble getLDoubleCursorValue ()
bool isMapped (const XVImageSize &pos)
void setCursorPosition (const XVImageSize &pos)
void setIntValue (const XVImageSize &pos, MLint v)
void setInt64Value (const XVImageSize &pos, MLint64 v)
void setDoubleValue (const XVImageSize &pos, MLdouble v)
void setLDoubleValue (const XVImageSize &pos, MLldouble v)
void setIntCursorValue (MLint v)
void setInt64CursorValue (MLint64 v)
void setDoubleCursorValue (MLdouble v)
void setLDoubleCursorValue (MLldouble v)
void fillInt (const XVImageSize &boxV1, const XVImageSize &boxV2, MLint v)
void fillInt64 (const XVImageSize &boxV1, const XVImageSize &boxV2, MLint64 v)
void fillDouble (const XVImageSize &boxV1, const XVImageSize &boxV2, MLdouble v)
void fillLDouble (const XVImageSize &boxV1, const XVImageSize &boxV2, MLldouble v)
void moveCursorX ()
void moveCursorY ()
void moveCursorZ ()
void moveCursorC ()
void moveCursorT ()
void moveCursorU ()
void reverseMoveCursorX ()
void reverseMoveCursorY ()
void reverseMoveCursorZ ()
void reverseMoveCursorC ()
void reverseMoveCursorT ()
void reverseMoveCursorU ()
void moveCursorByOffset (const XVImageSize &off)
void resetCursor ()
bool moveCursorXWrapAround ()
Typed access functions. Only to be called if \c isValid() returns true and \c DATATYPE matches getDataType()!
template<typename DATATYPE >
SO_VIRTUALVOLUME_EXPORT void getValue (const XVImageSize &pos, DATATYPE &retVal)
 Get a voxel from the virtual volume.
template<typename DATATYPE >
SO_VIRTUALVOLUME_EXPORT void setValue (const XVImageSize &pos, DATATYPE data)
 Write a voxel into the virtual volume.
template<typename DATATYPE >
SO_VIRTUALVOLUME_EXPORT void setCursorValue (DATATYPE val)
 Set value under cursor and lock page.
template<typename DATATYPE >
SO_VIRTUALVOLUME_EXPORT void getCursorValue (DATATYPE &retVal)
template<typename DATATYPE >
SO_VIRTUALVOLUME_EXPORT void fill (const XVImageSize &boxV1, const XVImageSize &boxV2, DATATYPE value)
 Fill the area box in the virtual image with voxel value value.
template<typename DATATYPE >
SO_VIRTUALVOLUME_EXPORT void getWrittenPageData (MLuint32 wp, DATATYPE *&dataPtr) const
 Returns typed pointer to voxel data of written page number wp.
Deprecated methods.
SO_VIRTUALVOLUME_EXPORT XVImageSize getPageExt () const
SO_VIRTUALVOLUME_EXPORT XVImageSize getPageArrayExt () const
const XVImageSizegetCursorPos ()
MLint getIntVoxel (const XVImageSize &pos)
MLint64 getInt64Voxel (const XVImageSize &pos)
MLdouble getDoubleVoxel (const XVImageSize &pos)
MLldouble getLDoubleVoxel (const XVImageSize &pos)
MLint getIntCursorVoxel ()
MLint64 getInt64CursorVoxel ()
MLdouble getDoubleCursorVoxel ()
MLldouble getLDoubleCursorVoxel ()
void setCursorPos (const XVImageSize &pos)
void setIntVoxel (const XVImageSize &pos, MLint v)
void setInt64Voxel (const XVImageSize &pos, MLint64 v)
void setDoubleVoxel (const XVImageSize &pos, MLdouble v)
void setLDoubleVoxel (const XVImageSize &pos, MLldouble v)
void setIntCursorVoxel (MLint v)
void setInt64CursorVoxel (MLint64 v)
void setDoubleCursorVoxel (MLdouble v)
void setLDoubleCursorVoxel (MLldouble v)
void moveFX ()
void moveFY ()
void moveFZ ()
void moveFC ()
void moveFT ()
void moveFU ()
void moveBX ()
void moveBY ()
void moveBZ ()
void moveBC ()
void moveBT ()
void moveBU ()
void moveOffset (const XVImageSize &off)
bool moveCursorFXLF ()
template<typename DATATYPE >
void getVoxel (const XVImageSize &pos, DATATYPE &retVal)
template<typename DATATYPE >
void setVoxel (const XVImageSize &pos, DATATYPE data)
template<typename DATATYPE >
void getCursorVoxel (DATATYPE &retVal)
template<typename DATATYPE >
void setCursorVoxel (DATATYPE val)

Protected Member Functions

SO_VIRTUALVOLUME_EXPORT SoVirtualVolume (const SoVirtualVolume &virtVol)
 Copy constructor.
SO_VIRTUALVOLUME_EXPORT
SoVirtualVolume
operator= (const SoVirtualVolume &virtVol)
 Assignment operator.
SO_VIRTUALVOLUME_EXPORT void _updateVirtualVolumes (const XVImageSize &ext=XVImageSize(0), long double fillVal=0, MLDataType dType=MLuint8Type, long maxNumKB=-1, bool useExceptions=false)
 If there is a non NULL SoSFMLImage pointer in _image which contains a valid connection to a valid ML image then this method recreates the virtual volume with the extents of _image.
SO_VIRTUALVOLUME_EXPORT void _createTypedVirtualVolume ()
 Create the typed version of the virtual volume and set up all function pointers from function wrapper.
SO_VIRTUALVOLUME_EXPORT void _removeVirtualVolumes (bool removeOnlyTyped=false)
 Removes all current virtual volumes.
void _enforceInstPub ()
 Template instantiation helper function. This function must not be called.
void _enforceInstPub2 ()
 Template instantiation helper function. This function must not be called.

Static Protected Member Functions

static SO_VIRTUALVOLUME_EXPORT void _imageChangedCB (void *clientData, SoSensor *sensor)
 Static function called if _fieldSensor detects a change of _image; it updates the internal virtual volumes to image changes.

Protected Attributes

SoSFMLImage_image
 Reference to the SoSFMLImage passed in the constructor.
MLDataType _constructorDataType
 Extents passed to constructor.
long _constructorMaxNumKB
 maxNumKB passed to constructor.
bool _constructorAreExceptionsOn
 useExceptions passed to constructor.
SoFieldSensor _fieldSensor
 Field sensor attached to the SoSFMLImage passed in the constructor.
ml::VirtualVolume_virtualVolume
 Pointer to the current untyped virtual volume or NULL if there is none.
void * _tVirtualVolume
 Pointer to the current typed virtual volume or NULL if there is none.

Detailed Description

The SoVirtualVolume class for fast voxel based access to paged ML images; see also mlVirtualVolume and mlTVirtualVolume in project MLTools for examples etc.

Definition at line 34 of file SoVirtualVolume.h.


Constructor & Destructor Documentation

SO_VIRTUALVOLUME_EXPORT SoVirtualVolume::SoVirtualVolume ( SoSFMLImage image,
MLDataType  dType = ML_INVALID_DATA_TYPE,
long  maxNumKB = -1,
bool  useExceptions = false 
)

Constructor which creates a SoVirtualVolume interface to an ML paged image hidden behind image.

If possible a SoVirtualVolume should be created as soon as possible after the SoSFMLImage initialization to be sure that it's notified first before other sensors on changes of image. So accesses to the SoVirtualVolume take place before other notifications.

Parameters:
imageis the SoSFMLImage which shall be interfaced by the SoSVirtualVolume.
dTypeis the ML data type the SoVirtualVolume shall use internally. If passed as -1 the data type of image is used.
maxNumKB
useExceptionscontrols whether the virtual volume runs save accesses to the image or unsafe ones. If disabled invalid accesses will lead to undefined program state; if enabled the controlled exceptions will be thrown which can be handled safely. See mlVirtualVolume.h in project MLTools for more infos.
SO_VIRTUALVOLUME_EXPORT SoVirtualVolume::SoVirtualVolume ( const XVImageSize ext = XVImageSize(0),
long double  fillVal = 0,
MLDataType  dType = MLuint8Type,
long  maxNumKB = -1,
bool  useExceptions = false 
)

Constructor to map an image of extents ext filled with fillVal.

Parameters:
extspecifies the extents of the virtual volume to be created. Default is 0.
fillValis the default value for all unwritten (i.e. background) virtual volume areas. Default is 0.
dTypedefines the data type of the virtual volume. Default is MLuint8Type.
maxNumKBmeans that enough pages are buffered so that at least one horizontal line of image data can be accessed without swapping pages. Otherwise maxNumKB determines the maximum buffer size for all swapped read pages. Default is -1.
useExceptionsIf true then testing of all calls for validity is enabled and exception are thrown on errors. Otherwise errors only partially throw exceptions or could lead to undefined program behaviour. See mlVirtualVolume.h in project MLTools for more infos.
virtual SO_VIRTUALVOLUME_EXPORT SoVirtualVolume::~SoVirtualVolume ( ) [virtual]

Destructor.

It destroys the voxel based access to the SoSFMLImage (if such a constructor was used). Anyway, you can keep on using that SoSFMLImage image after destruction of this.

SO_VIRTUALVOLUME_EXPORT SoVirtualVolume::SoVirtualVolume ( const SoVirtualVolume virtVol) [protected]

Copy constructor.

Protected since copying of mapped virtual volumes is not well defined, especially if they're associated to SoSFMLImages.


Member Function Documentation

SO_VIRTUALVOLUME_EXPORT void SoVirtualVolume::_createTypedVirtualVolume ( ) [protected]

Create the typed version of the virtual volume and set up all function pointers from function wrapper.

All former pointers are overwritten, even allocated pointers.

void SoVirtualVolume::_enforceInstPub ( ) [inline, protected]

Template instantiation helper function. This function must not be called.

Definition at line 425 of file SoVirtualVolume.h.

void SoVirtualVolume::_enforceInstPub2 ( ) [inline, protected]

Template instantiation helper function. This function must not be called.

Definition at line 428 of file SoVirtualVolume.h.

static SO_VIRTUALVOLUME_EXPORT void SoVirtualVolume::_imageChangedCB ( void *  clientData,
SoSensor *  sensor 
) [static, protected]

Static function called if _fieldSensor detects a change of _image; it updates the internal virtual volumes to image changes.

Parameters:
clientDataData passed to the sensor while it is attached to the image. In this case it will point to the instance, i.e. it is this.
sensorThe which has detected the field change and which is calling this function. In this case it's &_fieldSensor.
SO_VIRTUALVOLUME_EXPORT void SoVirtualVolume::_removeVirtualVolumes ( bool  removeOnlyTyped = false) [protected]

Removes all current virtual volumes.

If removeOnlyTyped is true then only the typed virtual volume is removed and the untyped one remains.

SO_VIRTUALVOLUME_EXPORT void SoVirtualVolume::_updateVirtualVolumes ( const XVImageSize ext = XVImageSize(0),
long double  fillVal = 0,
MLDataType  dType = MLuint8Type,
long  maxNumKB = -1,
bool  useExceptions = false 
) [protected]

If there is a non NULL SoSFMLImage pointer in _image which contains a valid connection to a valid ML image then this method recreates the virtual volume with the extents of _image.

The data type of the virtual volume is set to dType if that's valid, otherwise the data type of the SoSFMLImage is used. The size of the page buffer is automatically determined if maxNumKB is < 0; otherwise a buffer size given by maxNumKB is assumed. Exception handling is enabled if areExceptionOn() is true; otherwise it's disabled. If no valid _image is set then a virtual volume of extents given by ext with data type dType is created. maxNumKB and useExceptions are handled as above. Passing an invalid dType there will lead to an error and the invalidation of the virtual volume.

Parameters:
extDetermines the extents of the virtual volume if _image is not valid. Default is (0,0,0,0,0,0).
fillValDetermines the background/fill value of the virtual volume if _image is not valid. Default is 0.
dTypeDetermines the data type how data is stored in the virtual volume. If -1 then the type of _image is used. If that's not valid then an error is created and the virtual volume will be invalidated. Default is MLuint8Type.
maxNumKBIf -1 it means that enough pages are buffered so that at least one horizontal line of image data can be accessed without swapping pages. Otherwise maxNumKB determines the maximum buffer size for all swapped read pages. Default is -1.
useExceptionsException handling is enabled if areExceptionOn() is true; otherwise it's disabled. Default is false.
bool SoVirtualVolume::areExceptionsOn ( ) const [inline]

Returns the useExceptions value passed to the constructor.

Definition at line 99 of file SoVirtualVolume.h.

References _constructorAreExceptionsOn.

template<typename DATATYPE >
SO_VIRTUALVOLUME_EXPORT void SoVirtualVolume::fill ( const XVImageSize boxV1,
const XVImageSize boxV2,
DATATYPE  value 
)

Fill the area box in the virtual image with voxel value value.

If area reaches outside the valid virtual volume area it is automatically clamped to valid voxels.

Note:
DATATYPE must fit the internal SoVirtualVolume type or crashes will occur.
void SoVirtualVolume::fillDouble ( const XVImageSize boxV1,
const XVImageSize boxV2,
MLdouble  v 
) [inline]

Definition at line 184 of file SoVirtualVolume.h.

References _tVirtualVolume.

void SoVirtualVolume::fillInt ( const XVImageSize boxV1,
const XVImageSize boxV2,
MLint  v 
) [inline]

Definition at line 182 of file SoVirtualVolume.h.

References _tVirtualVolume.

void SoVirtualVolume::fillInt64 ( const XVImageSize boxV1,
const XVImageSize boxV2,
MLint64  v 
) [inline]

Definition at line 183 of file SoVirtualVolume.h.

References _tVirtualVolume.

void SoVirtualVolume::fillLDouble ( const XVImageSize boxV1,
const XVImageSize boxV2,
MLldouble  v 
) [inline]

Definition at line 185 of file SoVirtualVolume.h.

References _tVirtualVolume.

const XVImageSize& SoVirtualVolume::getCursorPos ( ) [inline]
Deprecated:
Use getCursorPosition() instead.

Definition at line 449 of file SoVirtualVolume.h.

References getCursorPosition().

const XVImageSize& SoVirtualVolume::getCursorPosition ( ) [inline]

Definition at line 163 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by getCursorPos().

template<typename DATATYPE >
SO_VIRTUALVOLUME_EXPORT void SoVirtualVolume::getCursorValue ( DATATYPE &  retVal)
Returns:
The value under the current cursor.
Note:
DATATYPE must fit the internal SoVirtualVolume type or crashes will occur.
template<typename DATATYPE >
void SoVirtualVolume::getCursorVoxel ( DATATYPE &  retVal) [inline]
Deprecated:
Use getCursorValue() instead.

Definition at line 557 of file SoVirtualVolume.h.

SO_VIRTUALVOLUME_EXPORT MLDataType SoVirtualVolume::getDataType ( ) const

Returns the data type used as internal data type of the virtual volume or - if currently no valid virtual volume exists - the value passed as dType to the constructor.

MLdouble SoVirtualVolume::getDoubleCursorValue ( ) [inline]

Definition at line 170 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by getDoubleCursorVoxel().

MLdouble SoVirtualVolume::getDoubleCursorVoxel ( ) [inline]
Deprecated:
Use getDoubleCursorValue() instead.

Definition at line 470 of file SoVirtualVolume.h.

References getDoubleCursorValue().

MLdouble SoVirtualVolume::getDoubleValue ( const XVImageSize pos) [inline]

Definition at line 166 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by getDoubleVoxel().

MLdouble SoVirtualVolume::getDoubleVoxel ( const XVImageSize pos) [inline]
Deprecated:
Use getDoubleValue() instead.

Definition at line 458 of file SoVirtualVolume.h.

References getDoubleValue().

SO_VIRTUALVOLUME_EXPORT SoSFMLImage* SoVirtualVolume::getImage ( ) const

Returns the SoSFMLImage the SoVirtualVolume is associated to or NULL if it's a Virtual Volume of user defined extents and contents.

MLint64 SoVirtualVolume::getInt64CursorValue ( ) [inline]

Definition at line 169 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by getInt64CursorVoxel().

MLint64 SoVirtualVolume::getInt64CursorVoxel ( ) [inline]
Deprecated:
Use getInt64CursorValue() instead.

Definition at line 467 of file SoVirtualVolume.h.

References getInt64CursorValue().

MLint64 SoVirtualVolume::getInt64Value ( const XVImageSize pos) [inline]

Definition at line 165 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by getInt64Voxel().

MLint64 SoVirtualVolume::getInt64Voxel ( const XVImageSize pos) [inline]
Deprecated:
Use getInt64Value() instead.

Definition at line 455 of file SoVirtualVolume.h.

References getInt64Value().

MLint SoVirtualVolume::getIntCursorValue ( ) [inline]

Definition at line 168 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by getIntCursorVoxel().

MLint SoVirtualVolume::getIntCursorVoxel ( ) [inline]
Deprecated:
Use getIntCursorValue() instead.

Definition at line 464 of file SoVirtualVolume.h.

References getIntCursorValue().

MLint SoVirtualVolume::getIntValue ( const XVImageSize pos) [inline]

Definition at line 164 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by getIntVoxel().

MLint SoVirtualVolume::getIntVoxel ( const XVImageSize pos) [inline]
Deprecated:
Use getIntValue() instead.

Definition at line 452 of file SoVirtualVolume.h.

References getIntValue().

MLldouble SoVirtualVolume::getLDoubleCursorValue ( ) [inline]

Definition at line 171 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by getLDoubleCursorVoxel().

MLldouble SoVirtualVolume::getLDoubleCursorVoxel ( ) [inline]
Deprecated:
Use getLDoubleCursorValue() instead.

Definition at line 473 of file SoVirtualVolume.h.

References getLDoubleCursorValue().

MLldouble SoVirtualVolume::getLDoubleValue ( const XVImageSize pos) [inline]

Definition at line 167 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by getLDoubleVoxel().

MLldouble SoVirtualVolume::getLDoubleVoxel ( const XVImageSize pos) [inline]
Deprecated:
Use getLDoubleValue() instead.

Definition at line 461 of file SoVirtualVolume.h.

References getLDoubleValue().

long SoVirtualVolume::getMaxNumKB ( ) const [inline]

Returns the maxNumKB value passed to the constructor.

Definition at line 96 of file SoVirtualVolume.h.

References _constructorMaxNumKB.

SO_VIRTUALVOLUME_EXPORT unsigned long SoVirtualVolume::getNumBytes ( ) const

Returns number of bytes currently allocated as pages in the virtual volume.

SO_VIRTUALVOLUME_EXPORT unsigned long SoVirtualVolume::getNumMappedPages ( ) const

Returns number of currently mapped (volatile) pages. Written pages are counted only temporarily here.

SO_VIRTUALVOLUME_EXPORT unsigned long SoVirtualVolume::getNumPages ( ) const

Returns number of all (mapped and written) pages.

SO_VIRTUALVOLUME_EXPORT unsigned long SoVirtualVolume::getNumWrittenPages ( )

Returns number of written (and therefore locked) pages.

SO_VIRTUALVOLUME_EXPORT XVImageSize SoVirtualVolume::getPageArrayExt ( ) const [inline]
Deprecated:
Use getPageArrayExtent() instead.

Definition at line 445 of file SoVirtualVolume.h.

References getPageArrayExtent().

SO_VIRTUALVOLUME_EXPORT XVImageSize SoVirtualVolume::getPageArrayExtent ( ) const

Returns extents of the array of page buffers.

Referenced by getPageArrayExt().

SO_VIRTUALVOLUME_EXPORT XVImageSize SoVirtualVolume::getPageExt ( ) const [inline]
Deprecated:
Use getPageExtent() instead.

Definition at line 441 of file SoVirtualVolume.h.

References getPageExtent().

SO_VIRTUALVOLUME_EXPORT XVImageSize SoVirtualVolume::getPageExtent ( ) const

Returns extents of a written and read pages used by the virtual volume.

Referenced by getPageExt().

template<typename DATATYPE >
SO_VIRTUALVOLUME_EXPORT void SoVirtualVolume::getValue ( const XVImageSize pos,
DATATYPE &  retVal 
)

Get a voxel from the virtual volume.

The position must be within the valid image area.

Note:
DATATYPE must fit the internal SoVirtualVolume type or crashes will occur.
template<typename DATATYPE >
void SoVirtualVolume::getVoxel ( const XVImageSize pos,
DATATYPE &  retVal 
) [inline]
Deprecated:
Use getValue() instead.

Definition at line 547 of file SoVirtualVolume.h.

SO_VIRTUALVOLUME_EXPORT void* SoVirtualVolume::getWrittenPageData ( MLuint32  wp)

Returns untyped pointer to data of written page with page id wp.

Parameters:
wpis the page id of the written page to access and it must be within [0, getNumWrittenPages()-1].
Returns:
The pointer to the data related to page with index wp or NULL if wp is out of range.
Note:
If page is a page crossed by the image border then it could also contain undefined data.
The number of voxels in such a page is given by getPageExt().compMul().
template<typename DATATYPE >
SO_VIRTUALVOLUME_EXPORT void SoVirtualVolume::getWrittenPageData ( MLuint32  wp,
DATATYPE *&  dataPtr 
) const

Returns typed pointer to voxel data of written page number wp.

Parameters:
wpmust be within [0, vVol.getNumWrittenPages()-1].
dataPtris the reference to a pointer which shall point to the data of page wp.
Returns:
The pointer to the data related to page with index wp or NULL if wp is out of range. Useful for fast access to written pages.
Note:
If page is a border page then it could also contain undefined data.
Number of voxels in page is given by vVol.getPageExt().compMul().
DATATYPE must fit the internal SoVirtualVolume type or crashes will occur.
bool SoVirtualVolume::isMapped ( const XVImageSize pos) [inline]

Definition at line 172 of file SoVirtualVolume.h.

References _tVirtualVolume.

SO_VIRTUALVOLUME_EXPORT bool SoVirtualVolume::isValid ( ) const

Returns true if access methods may be called, otherwise false.

void SoVirtualVolume::moveBC ( ) [inline]
Deprecated:
Use reverseMoveCursorC() instead.

Definition at line 530 of file SoVirtualVolume.h.

References reverseMoveCursorC().

void SoVirtualVolume::moveBT ( ) [inline]
Deprecated:
Use reverseMoveCursorT() instead.

Definition at line 533 of file SoVirtualVolume.h.

References reverseMoveCursorT().

void SoVirtualVolume::moveBU ( ) [inline]
Deprecated:
Use reverseMoveCursorU() instead.

Definition at line 536 of file SoVirtualVolume.h.

References reverseMoveCursorU().

void SoVirtualVolume::moveBX ( ) [inline]
Deprecated:
Use reverseMoveCursorX() instead.

Definition at line 521 of file SoVirtualVolume.h.

References reverseMoveCursorX().

void SoVirtualVolume::moveBY ( ) [inline]
Deprecated:
Use reverseMoveCursorY() instead.

Definition at line 524 of file SoVirtualVolume.h.

References reverseMoveCursorY().

void SoVirtualVolume::moveBZ ( ) [inline]
Deprecated:
Use reverseMoveCursorZ() instead.

Definition at line 527 of file SoVirtualVolume.h.

References reverseMoveCursorZ().

void SoVirtualVolume::moveCursorByOffset ( const XVImageSize off) [inline]

Definition at line 198 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by moveOffset().

void SoVirtualVolume::moveCursorC ( ) [inline]

Definition at line 189 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by moveFC().

bool SoVirtualVolume::moveCursorFXLF ( ) [inline]
Deprecated:
Use moveCursorXWrapAround() instead.

Definition at line 542 of file SoVirtualVolume.h.

References moveCursorXWrapAround().

void SoVirtualVolume::moveCursorT ( ) [inline]

Definition at line 190 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by moveFT().

void SoVirtualVolume::moveCursorU ( ) [inline]

Definition at line 191 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by moveFU().

void SoVirtualVolume::moveCursorX ( ) [inline]

Definition at line 186 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by moveFX().

bool SoVirtualVolume::moveCursorXWrapAround ( ) [inline]

Definition at line 200 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by moveCursorFXLF().

void SoVirtualVolume::moveCursorY ( ) [inline]

Definition at line 187 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by moveFY().

void SoVirtualVolume::moveCursorZ ( ) [inline]

Definition at line 188 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by moveFZ().

void SoVirtualVolume::moveFC ( ) [inline]
Deprecated:
Use moveCursorC() instead.

Definition at line 512 of file SoVirtualVolume.h.

References moveCursorC().

void SoVirtualVolume::moveFT ( ) [inline]
Deprecated:
Use moveCursorT() instead.

Definition at line 515 of file SoVirtualVolume.h.

References moveCursorT().

void SoVirtualVolume::moveFU ( ) [inline]
Deprecated:
Use moveCursorU() instead.

Definition at line 518 of file SoVirtualVolume.h.

References moveCursorU().

void SoVirtualVolume::moveFX ( ) [inline]
Deprecated:
Use moveCursorX() instead.

Definition at line 503 of file SoVirtualVolume.h.

References moveCursorX().

void SoVirtualVolume::moveFY ( ) [inline]
Deprecated:
Use moveCursorY() instead.

Definition at line 506 of file SoVirtualVolume.h.

References moveCursorY().

void SoVirtualVolume::moveFZ ( ) [inline]
Deprecated:
Use moveCursorZ() instead.

Definition at line 509 of file SoVirtualVolume.h.

References moveCursorZ().

void SoVirtualVolume::moveOffset ( const XVImageSize off) [inline]
Deprecated:
Use moveCursorByOffset() instead.

Definition at line 539 of file SoVirtualVolume.h.

References moveCursorByOffset().

SO_VIRTUALVOLUME_EXPORT SoVirtualVolume& SoVirtualVolume::operator= ( const SoVirtualVolume virtVol) [protected]

Assignment operator.

Protected since copying of mapped virtual volumes is not well defined, especially if they're associated to SoSFMLImages.

void SoVirtualVolume::resetCursor ( ) [inline]

Definition at line 199 of file SoVirtualVolume.h.

References _tVirtualVolume.

SO_VIRTUALVOLUME_EXPORT void SoVirtualVolume::resize ( const XVImageSize newExt)

This method resizes the virtual volume to the extents given by ext.

Pages which do not overlap any longer with the image are thrown away and areas where new pages are needed there the corresponding tables are updated. Already mapped pages which are overlapped by the image before and after the resizing operation will remain without changing the mapping state.

Note:
Resizing a virtual volume associated with a SoSFMLImage is not supported since the underlying image can not be resized. In case of errors an MLErrorCode exception is thrown if exception handling is enabled; otherwise ML_PRINT_ERROR or ML_PRINT_FATAL_ERROR messages will be generated. Resizing invalid virtual volumes or other errors will also be handled like this.
void SoVirtualVolume::reverseMoveCursorC ( ) [inline]

Definition at line 195 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by moveBC().

void SoVirtualVolume::reverseMoveCursorT ( ) [inline]

Definition at line 196 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by moveBT().

void SoVirtualVolume::reverseMoveCursorU ( ) [inline]

Definition at line 197 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by moveBU().

void SoVirtualVolume::reverseMoveCursorX ( ) [inline]

Definition at line 192 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by moveBX().

void SoVirtualVolume::reverseMoveCursorY ( ) [inline]

Definition at line 193 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by moveBY().

void SoVirtualVolume::reverseMoveCursorZ ( ) [inline]

Definition at line 194 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by moveBZ().

void SoVirtualVolume::setCursorPos ( const XVImageSize pos) [inline]
Deprecated:
Use setCursorPosition() instead.

Definition at line 476 of file SoVirtualVolume.h.

References setCursorPosition().

void SoVirtualVolume::setCursorPosition ( const XVImageSize pos) [inline]

Definition at line 173 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by setCursorPos().

template<typename DATATYPE >
SO_VIRTUALVOLUME_EXPORT void SoVirtualVolume::setCursorValue ( DATATYPE  val)

Set value under cursor and lock page.

Note:
DATATYPE must fit the internal SoVirtualVolume type or crashes will occur.
template<typename DATATYPE >
void SoVirtualVolume::setCursorVoxel ( DATATYPE  val) [inline]
Deprecated:
Use setCursorValue() instead.

Definition at line 562 of file SoVirtualVolume.h.

void SoVirtualVolume::setDoubleCursorValue ( MLdouble  v) [inline]

Definition at line 180 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by setDoubleCursorVoxel().

void SoVirtualVolume::setDoubleCursorVoxel ( MLdouble  v) [inline]
Deprecated:
Use setDoubleCursorValue() instead.

Definition at line 497 of file SoVirtualVolume.h.

References setDoubleCursorValue().

void SoVirtualVolume::setDoubleValue ( const XVImageSize pos,
MLdouble  v 
) [inline]

Definition at line 176 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by setDoubleVoxel().

void SoVirtualVolume::setDoubleVoxel ( const XVImageSize pos,
MLdouble  v 
) [inline]
Deprecated:
Use setDoubleValue() instead.

Definition at line 485 of file SoVirtualVolume.h.

References setDoubleValue().

void SoVirtualVolume::setInt64CursorValue ( MLint64  v) [inline]

Definition at line 179 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by setInt64CursorVoxel().

void SoVirtualVolume::setInt64CursorVoxel ( MLint64  v) [inline]
Deprecated:
Use setInt64CursorValue() instead.

Definition at line 494 of file SoVirtualVolume.h.

References setInt64CursorValue().

void SoVirtualVolume::setInt64Value ( const XVImageSize pos,
MLint64  v 
) [inline]

Definition at line 175 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by setInt64Voxel().

void SoVirtualVolume::setInt64Voxel ( const XVImageSize pos,
MLint64  v 
) [inline]
Deprecated:
Use setInt64Value() instead.

Definition at line 482 of file SoVirtualVolume.h.

References setInt64Value().

void SoVirtualVolume::setIntCursorValue ( MLint  v) [inline]

Definition at line 178 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by setIntCursorVoxel().

void SoVirtualVolume::setIntCursorVoxel ( MLint  v) [inline]
Deprecated:
Use setIntCursorValue() instead.

Definition at line 491 of file SoVirtualVolume.h.

References setIntCursorValue().

void SoVirtualVolume::setIntValue ( const XVImageSize pos,
MLint  v 
) [inline]

Definition at line 174 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by setIntVoxel().

void SoVirtualVolume::setIntVoxel ( const XVImageSize pos,
MLint  v 
) [inline]
Deprecated:
Use setIntValue() instead.

Definition at line 479 of file SoVirtualVolume.h.

References setIntValue().

void SoVirtualVolume::setLDoubleCursorValue ( MLldouble  v) [inline]

Definition at line 181 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by setLDoubleCursorVoxel().

void SoVirtualVolume::setLDoubleCursorVoxel ( MLldouble  v) [inline]
Deprecated:
Use setLDoubleCursorValue() instead.

Definition at line 500 of file SoVirtualVolume.h.

References setLDoubleCursorValue().

void SoVirtualVolume::setLDoubleValue ( const XVImageSize pos,
MLldouble  v 
) [inline]

Definition at line 177 of file SoVirtualVolume.h.

References _tVirtualVolume.

Referenced by setLDoubleVoxel().

void SoVirtualVolume::setLDoubleVoxel ( const XVImageSize pos,
MLldouble  v 
) [inline]
Deprecated:
Use setLDoubleValue() instead.

Definition at line 488 of file SoVirtualVolume.h.

References setLDoubleValue().

template<typename DATATYPE >
SO_VIRTUALVOLUME_EXPORT void SoVirtualVolume::setValue ( const XVImageSize pos,
DATATYPE  data 
)

Write a voxel into the virtual volume.

The position must be within the valid image area. Written pages are hold in memory until vVol is deleted.

Note:
DATATYPE must fit the internal SoVirtualVolume type or crashes will occur.
template<typename DATATYPE >
void SoVirtualVolume::setVoxel ( const XVImageSize pos,
DATATYPE  data 
) [inline]
Deprecated:
Use setValue() instead.

Definition at line 552 of file SoVirtualVolume.h.

SO_VIRTUALVOLUME_EXPORT void SoVirtualVolume::unMapAndClearWrittenPages ( )

This function throws away all written pages.

So accesses to the previously written pages will access the original data. Note that this destroys all written information in the image. Currently mapped pages which are not written remain mapped and unchanged.


Member Data Documentation

useExceptions passed to constructor.

Definition at line 319 of file SoVirtualVolume.h.

Referenced by areExceptionsOn().

Extents passed to constructor.

Definition at line 313 of file SoVirtualVolume.h.

maxNumKB passed to constructor.

Definition at line 316 of file SoVirtualVolume.h.

Referenced by getMaxNumKB().

SoFieldSensor SoVirtualVolume::_fieldSensor [protected]

Field sensor attached to the SoSFMLImage passed in the constructor.

It fires on changes of that image to notify about called when

Definition at line 323 of file SoVirtualVolume.h.

Reference to the SoSFMLImage passed in the constructor.

Definition at line 310 of file SoVirtualVolume.h.

Pointer to the current untyped virtual volume or NULL if there is none.

Definition at line 326 of file SoVirtualVolume.h.


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