MeVisLabToolboxReference
View2DSliceList Class Reference

a list that holds all View2DSlice objects (lazily created) of a SoView2D More...

#include <View2DSliceList.h>

List of all members.

Public Member Functions

 View2DSliceList ()
 create empty list
 ~View2DSliceList ()
 destructor
void setInputImage (SoSFMLImage *img)
 set the input image.
SoSFMLImagegetInputImage ()
 get the input image.
void setSliceRange (int start, int num, int step=1)
 set the slice range.
void getSliceRange (int &start, int &num, int &step)
 get the slice range.
void setFilter (View2DTextureFilter filter=FILTER_LINEAR)
 set filter
View2DTextureFilter getFilter ()
 get filter
void setSliceAlignment (sliceAlignXMode x, sliceAlignYMode y)
 set slice alignment
void setAspectRatio (float ratio)
 set the aspect ratio
float getAspectRatio ()
 get the aspect ratio
void setFixedInnerZoom (bool flag, float fixedZoom)
 set the fixed innerzoom
void setBlendMode (int blendMode=0, float *_blendColor=NULL)
 set blendmode
int getBlendMode ()
 get blendmode
float * getBlendColor ()
 get the color for blending (4 floats)
void setDrawsData (bool flag)
 enable/disable data loading
void setUseShaders (bool flag)
 sets if the tries to use shaders for hardware lut
void initGL ()
 initialize internals that require a valid GL state
void setLut (ml::LUTData< MLuint8 > *lut)
 set lut
ml::LUTData< MLuint8 > * getLut ()
 get lut
void setSliceSize (float sizeX, float sizeY)
 Set the size of the slice to be drawn.
void getSliceSize (float &sizeX, float &sizeY)
 Get the size of the slice to be drawn.
void setSliceSpacing (float dx, float dy)
 Set the spacing between slices.
void getSliceSpacing (float &dx, float &dy)
 Get the spacing between slices.
void setSliceOrigin (float x, float y)
 Set the inner slice origin.
void getSliceOrigin (float &x, float &y)
 Get the inner slice origin.
void setDrawOffset (float x, float y)
 Set slice list draw offset.
void getDrawOffset (float &x, float &y)
 Get slice list draw offset.
void setTimePoint (int timepoint)
 Set the time point.
int getTimePoint ()
 Get the time point.
void setSliceZoom (float zoom)
 Set the inner slice zoom.
float getSliceZoom ()
 Get the inner slice zoom.
void setOwner (SoView2D *view)
 Set the owning SoView2D.
SoView2DgetOwner ()
 Get the owning SoView2D.
void setNumXSlices (int num)
 set number of slices in a row.
int getNumXSlices ()
 get number of slices in a row.
void setSlab (int slab)
 set number of slab slices (1 means no slab, one slice)
int getSlab ()
 get number of slab slices
void setCachingMode (SLICE_CACHING_MODE mode)
 set data caching mode.
SLICE_CACHING_MODE getCachingMode ()
 get data caching mode.
void setBackgroundColor (float *color)
 set the background color (rgba)
bool drawSlices (int originX, int originY, int width, int height, bool updateLayoutOnly, SoNodeList *extensions=NULL, int sharedCacheContext=-1, bool is3D=false, bool reverse=false)
 Draw the slices (originX, originY, width and height are the current viewport position/size) Returns FALSE on any error.
bool mapVoxelToDevice (float voxelX, float voxelY, float voxelZ, float &rx, float &ry)
 Determine a device pixel coordinate from the voxel coordinate in any slice.
bool mapWorldToDevice (float worldX, float worldY, float worldZ, float &rx, float &ry)
 Determine a device pixel coordinate from the world coordinate in any slice.
void mapWorldToVoxel (float worldX, float worldY, float worldZ, float &voxelX, float &voxelY, float &voxelZ)
 maps the world coordinate to local voxel coordinates
void mapVoxelToWorld (float voxelX, float voxelY, float voxelZ, float &worldX, float &worldY, float &worldZ)
 maps the voxel coordinate to world coordinates
bool isSliceHit (int x, int y)
 Returns if a slice's visible rect is hit at the given device coordinate, if a device rect of a slice was hit returns TRUE,.
int getSliceAtDevicePosition (int x, int y)
 Returns z index of slice whose visible rect is hit, return -1 if no slice is hit.
bool isVoxelInsideImage (float voxelX, float voxelY, float voxelZ)
 Returns if the given voxel is inside the image extends.
bool is3D ()
 is current rendering in 3D?
void set3DPixelSize (float devicePixelMM)
 set the device coordinate scale when slices are rendered in 3d
SbVec3f getSliceTranslation (int z)
 get translation vector of the slice in world coordinates (to voxel 0,0,z+0.5)
SbVec3f getSliceNormal ()
 get normal of slices in world coordinates (all slices have the same normal)
bool castRayOnSlides (const SbVec3f &p1, const SbVec3f &p2, const SbVec3f &viewpoint, SbVec3f &worldHit, SbVec3f &voxelHit, int *sliceID=NULL)
 Do a 3d collision with the slices, returns first hit of given line with the first slice plane from given viewpoint.
bool mapVoxelToDevice (const SbVec3f &voxelCoord, float &rx, float &ry)
 Determine a device pixel coordinate from the voxel coordinate in any slice.
bool mapVoxelToDevice (const SbVec3f &voxelCoord, SbVec2f &r)
 same as above
bool mapWorldToDevice (const SbVec3f &worldCoord, float &rx, float &ry)
 Determine a device pixel coordinate from the world coordinate in any slice.
bool mapWorldToDevice (const SbVec3f &voxelCoord, SbVec2f &r)
 same as above
void mapWorldToVoxel (const SbVec3f &worldCoord, SbVec3f &voxelCoord)
 maps the world coordinate to local voxel coordinates
void mapVoxelToWorld (const SbVec3f &voxelCoord, SbVec3f &worldCoord)
 maps the voxel coordinate to world coordinates
bool mapEventToWorld (View2DEvent *ec, float &worldX, float &worldY, float &worldZ)
 maps the given device event to world coords and returns if a slice was hit
bool mapEventToWorld (View2DEvent *ec, SbVec3f &world)
 maps the given device event to world coords and returns if a slice was hit
bool mapEventToVoxel (View2DEvent *ec, float &vx, float &vy, float &vz)
 maps the given device event to voxel coords and returns if a slice was hit
bool mapEventToVoxel (View2DEvent *ec, SbVec3f &voxel)
 maps the given device event to voxel coords and returns if a slice was hit
SbVec3f getWorldAxis (int a)
 returns the indicated axis (0/1/2) of the slices in world space
void getImageSize (int &x, int &y, int &z)
 returns the image size in pixels
void updateSliceList (int sharedContextId=-1, bool layoutOnly=false)
 Make the slice list up to date to the current settings.
View2DSlicegetSlice (int z)
 get slice with slice pos z
void getCurrentInnerZoom (float &x, float &y)
 get the inner x/y zoom
int getCurrentCacheContext ()
 get current cache context (-1 if none, can only be called while drawing)
void getWindowSize (int &x, int &y)
 get the window size that is currently rendered on
void cleanup ()
 Remove all current slice objects.
bool shouldRenderReverse (const SbVec3f &viewdir)
 returns if the 3d rendering should be done in reverse order dependent on view direction (in world coordinates)
bool mapDeviceToWorld (int x, int y, SbVec3f &worldCoord)
 Maps device coordinates to world coordinates, returns TRUE if successful, otherwise return FALSE.
bool mapDeviceToVoxel (int x, int y, SbVec3f &voxelCoord, int *sliceID=NULL)
 Maps device coordinates to local voxel coordinates, returns TRUE if successful, otherwise return FALSE.
bool mapDeviceToWorld (int x, int y, float &worldX, float &worldY, float &worldZ)
 Maps device coordinates to world coordinates, returns TRUE if successful, otherwise return FALSE.
bool mapDeviceToVoxel (int x, int y, float &voxelX, float &voxelY, float &voxelZ, int *sliceID=NULL)
 Maps device coordinates to local voxel coordinates, returns TRUE if successful, otherwise return FALSE.
void grabSlice ()
 Switch on or off slice grabbing, i.e.
void ungrabSlice ()

Detailed Description

a list that holds all View2DSlice objects (lazily created) of a SoView2D

Definition at line 31 of file View2DSliceList.h.


Constructor & Destructor Documentation

View2DSliceList::View2DSliceList ( )

create empty list

View2DSliceList::~View2DSliceList ( )

destructor


Member Function Documentation

bool View2DSliceList::castRayOnSlides ( const SbVec3f &  p1,
const SbVec3f &  p2,
const SbVec3f &  viewpoint,
SbVec3f &  worldHit,
SbVec3f &  voxelHit,
int *  sliceID = NULL 
)

Do a 3d collision with the slices, returns first hit of given line with the first slice plane from given viewpoint.

If a pointer to a "sliceID" parameter is given, the check is only done on the slice indicated. If this slice is NO_SLICE_ID, the check is done as if the pointer were NULL, but the value is afterwards changed to the resulting slice.

void View2DSliceList::cleanup ( )

Remove all current slice objects.

bool View2DSliceList::drawSlices ( int  originX,
int  originY,
int  width,
int  height,
bool  updateLayoutOnly,
SoNodeList *  extensions = NULL,
int  sharedCacheContext = -1,
bool  is3D = false,
bool  reverse = false 
)

Draw the slices (originX, originY, width and height are the current viewport position/size) Returns FALSE on any error.

float View2DSliceList::getAspectRatio ( ) [inline]

get the aspect ratio

Definition at line 61 of file View2DSliceList.h.

float* View2DSliceList::getBlendColor ( )

get the color for blending (4 floats)

int View2DSliceList::getBlendMode ( )

get blendmode

SLICE_CACHING_MODE View2DSliceList::getCachingMode ( )

get data caching mode.

int View2DSliceList::getCurrentCacheContext ( ) [inline]

get current cache context (-1 if none, can only be called while drawing)

Definition at line 255 of file View2DSliceList.h.

void View2DSliceList::getCurrentInnerZoom ( float &  x,
float &  y 
)

get the inner x/y zoom

void View2DSliceList::getDrawOffset ( float &  x,
float &  y 
)

Get slice list draw offset.

View2DTextureFilter View2DSliceList::getFilter ( )

get filter

void View2DSliceList::getImageSize ( int &  x,
int &  y,
int &  z 
)

returns the image size in pixels

SoSFMLImage* View2DSliceList::getInputImage ( )

get the input image.

ml::LUTData<MLuint8>* View2DSliceList::getLut ( )

get lut

int View2DSliceList::getNumXSlices ( )

get number of slices in a row.

SoView2D* View2DSliceList::getOwner ( ) [inline]

Get the owning SoView2D.

Definition at line 121 of file View2DSliceList.h.

int View2DSliceList::getSlab ( )

get number of slab slices

View2DSlice* View2DSliceList::getSlice ( int  z)

get slice with slice pos z

int View2DSliceList::getSliceAtDevicePosition ( int  x,
int  y 
)

Returns z index of slice whose visible rect is hit, return -1 if no slice is hit.

SbVec3f View2DSliceList::getSliceNormal ( )

get normal of slices in world coordinates (all slices have the same normal)

void View2DSliceList::getSliceOrigin ( float &  x,
float &  y 
)

Get the inner slice origin.

void View2DSliceList::getSliceRange ( int &  start,
int &  num,
int &  step 
)

get the slice range.

void View2DSliceList::getSliceSize ( float &  sizeX,
float &  sizeY 
)

Get the size of the slice to be drawn.

void View2DSliceList::getSliceSpacing ( float &  dx,
float &  dy 
)

Get the spacing between slices.

SbVec3f View2DSliceList::getSliceTranslation ( int  z)

get translation vector of the slice in world coordinates (to voxel 0,0,z+0.5)

float View2DSliceList::getSliceZoom ( )

Get the inner slice zoom.

int View2DSliceList::getTimePoint ( )

Get the time point.

void View2DSliceList::getWindowSize ( int &  x,
int &  y 
) [inline]

get the window size that is currently rendered on

Definition at line 258 of file View2DSliceList.h.

SbVec3f View2DSliceList::getWorldAxis ( int  a)

returns the indicated axis (0/1/2) of the slices in world space

void View2DSliceList::grabSlice ( )

Switch on or off slice grabbing, i.e.

if mapping from device to voxel coordinates should always refer to the same (initial) slice, even if this slice isn't hit anymore. This is used for mouse dragging, so when dragging starts call grabSlice() and when dragging ends call ungrabSlice(). Note: This will not actually store the slice but the index in the slice layout, so changing the start slice (slicing) will still change the grabbed slice.

void View2DSliceList::initGL ( )

initialize internals that require a valid GL state

bool View2DSliceList::is3D ( ) [inline]

is current rendering in 3D?

Definition at line 176 of file View2DSliceList.h.

bool View2DSliceList::isSliceHit ( int  x,
int  y 
)

Returns if a slice's visible rect is hit at the given device coordinate, if a device rect of a slice was hit returns TRUE,.

bool View2DSliceList::isVoxelInsideImage ( float  voxelX,
float  voxelY,
float  voxelZ 
)

Returns if the given voxel is inside the image extends.

bool View2DSliceList::mapDeviceToVoxel ( int  x,
int  y,
SbVec3f &  voxelCoord,
int *  sliceID = NULL 
)

Maps device coordinates to local voxel coordinates, returns TRUE if successful, otherwise return FALSE.

DEPRECATED, you should use mapEventToVoxel, so that your extension also works in 3D If a pointer to a "sliceID" parameter is given, the check is only done on the slice indicated. If this slice is NO_SLICE_ID, the check is done as if the pointer were NULL, but the value is afterwards changed to the resulting slice.

bool View2DSliceList::mapDeviceToVoxel ( int  x,
int  y,
float &  voxelX,
float &  voxelY,
float &  voxelZ,
int *  sliceID = NULL 
)

Maps device coordinates to local voxel coordinates, returns TRUE if successful, otherwise return FALSE.

DEPRECATED, you should use mapEventToVoxel, so that your extension also works in 3D. If a pointer to a "sliceID" parameter is given, the check is only done on the slice indicated. If this slice is NO_SLICE_ID, the check is done as if the pointer were NULL, but the value is afterwards changed to the resulting slice.

bool View2DSliceList::mapDeviceToWorld ( int  x,
int  y,
float &  worldX,
float &  worldY,
float &  worldZ 
)

Maps device coordinates to world coordinates, returns TRUE if successful, otherwise return FALSE.

DEPRECATED, you should use mapEventToWorld, so that your extension also works in 3D.

bool View2DSliceList::mapDeviceToWorld ( int  x,
int  y,
SbVec3f &  worldCoord 
)

Maps device coordinates to world coordinates, returns TRUE if successful, otherwise return FALSE.

DEPRECATED, you should use mapEventToWorld, so that your extension also works in 3D.

bool View2DSliceList::mapEventToVoxel ( View2DEvent ec,
SbVec3f &  voxel 
)

maps the given device event to voxel coords and returns if a slice was hit

bool View2DSliceList::mapEventToVoxel ( View2DEvent ec,
float &  vx,
float &  vy,
float &  vz 
)

maps the given device event to voxel coords and returns if a slice was hit

bool View2DSliceList::mapEventToWorld ( View2DEvent ec,
SbVec3f &  world 
)

maps the given device event to world coords and returns if a slice was hit

bool View2DSliceList::mapEventToWorld ( View2DEvent ec,
float &  worldX,
float &  worldY,
float &  worldZ 
)

maps the given device event to world coords and returns if a slice was hit

bool View2DSliceList::mapVoxelToDevice ( float  voxelX,
float  voxelY,
float  voxelZ,
float &  rx,
float &  ry 
)

Determine a device pixel coordinate from the voxel coordinate in any slice.

bool View2DSliceList::mapVoxelToDevice ( const SbVec3f &  voxelCoord,
float &  rx,
float &  ry 
)

Determine a device pixel coordinate from the voxel coordinate in any slice.

bool View2DSliceList::mapVoxelToDevice ( const SbVec3f &  voxelCoord,
SbVec2f &  r 
)

same as above

void View2DSliceList::mapVoxelToWorld ( float  voxelX,
float  voxelY,
float  voxelZ,
float &  worldX,
float &  worldY,
float &  worldZ 
)

maps the voxel coordinate to world coordinates

void View2DSliceList::mapVoxelToWorld ( const SbVec3f &  voxelCoord,
SbVec3f &  worldCoord 
)

maps the voxel coordinate to world coordinates

bool View2DSliceList::mapWorldToDevice ( const SbVec3f &  worldCoord,
float &  rx,
float &  ry 
)

Determine a device pixel coordinate from the world coordinate in any slice.

bool View2DSliceList::mapWorldToDevice ( float  worldX,
float  worldY,
float  worldZ,
float &  rx,
float &  ry 
)

Determine a device pixel coordinate from the world coordinate in any slice.

bool View2DSliceList::mapWorldToDevice ( const SbVec3f &  voxelCoord,
SbVec2f &  r 
)

same as above

void View2DSliceList::mapWorldToVoxel ( float  worldX,
float  worldY,
float  worldZ,
float &  voxelX,
float &  voxelY,
float &  voxelZ 
)

maps the world coordinate to local voxel coordinates

void View2DSliceList::mapWorldToVoxel ( const SbVec3f &  worldCoord,
SbVec3f &  voxelCoord 
)

maps the world coordinate to local voxel coordinates

void View2DSliceList::set3DPixelSize ( float  devicePixelMM) [inline]

set the device coordinate scale when slices are rendered in 3d

Definition at line 179 of file View2DSliceList.h.

void View2DSliceList::setAspectRatio ( float  ratio) [inline]

set the aspect ratio

Definition at line 58 of file View2DSliceList.h.

void View2DSliceList::setBackgroundColor ( float *  color)

set the background color (rgba)

void View2DSliceList::setBlendMode ( int  blendMode = 0,
float *  _blendColor = NULL 
)

set blendmode

void View2DSliceList::setCachingMode ( SLICE_CACHING_MODE  mode)

set data caching mode.

void View2DSliceList::setDrawOffset ( float  x,
float  y 
)

Set slice list draw offset.

void View2DSliceList::setDrawsData ( bool  flag)

enable/disable data loading

void View2DSliceList::setFilter ( View2DTextureFilter  filter = FILTER_LINEAR)

set filter

void View2DSliceList::setFixedInnerZoom ( bool  flag,
float  fixedZoom 
)

set the fixed innerzoom

void View2DSliceList::setInputImage ( SoSFMLImage img)

set the input image.

void View2DSliceList::setLut ( ml::LUTData< MLuint8 > *  lut)

set lut

void View2DSliceList::setNumXSlices ( int  num)

set number of slices in a row.

void View2DSliceList::setOwner ( SoView2D view) [inline]

Set the owning SoView2D.

Definition at line 119 of file View2DSliceList.h.

void View2DSliceList::setSlab ( int  slab)

set number of slab slices (1 means no slab, one slice)

void View2DSliceList::setSliceAlignment ( sliceAlignXMode  x,
sliceAlignYMode  y 
)

set slice alignment

void View2DSliceList::setSliceOrigin ( float  x,
float  y 
)

Set the inner slice origin.

void View2DSliceList::setSliceRange ( int  start,
int  num,
int  step = 1 
)

set the slice range.

void View2DSliceList::setSliceSize ( float  sizeX,
float  sizeY 
)

Set the size of the slice to be drawn.

void View2DSliceList::setSliceSpacing ( float  dx,
float  dy 
)

Set the spacing between slices.

void View2DSliceList::setSliceZoom ( float  zoom)

Set the inner slice zoom.

void View2DSliceList::setTimePoint ( int  timepoint)

Set the time point.

void View2DSliceList::setUseShaders ( bool  flag) [inline]

sets if the tries to use shaders for hardware lut

Definition at line 78 of file View2DSliceList.h.

bool View2DSliceList::shouldRenderReverse ( const SbVec3f &  viewdir)

returns if the 3d rendering should be done in reverse order dependent on view direction (in world coordinates)

void View2DSliceList::ungrabSlice ( )
void View2DSliceList::updateSliceList ( int  sharedContextId = -1,
bool  layoutOnly = false 
)

Make the slice list up to date to the current settings.

Create missing entries and remove redundant ones.


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