#include <View2DSlice.h>
Public Member Functions | |
| View2DSlice () | |
| constructor | |
| ~View2DSlice () | |
| destructor. | |
| void | destroy () |
| destroy the slice textures | |
| void | setInputImage (SoSFMLImage *img) |
| set the input image. | |
| SoSFMLImage * | getInputImage () |
| get the input image. | |
| void | setShader (View2DShader *shader) |
| sets the shader that should be used for rendering | |
| View2DShader * | getShader () |
| get the shader (might be NULL); | |
| void | setSliceZ (int z) |
| set the slice z position. | |
| int | getSliceZ () |
| get the slice z position. | |
| void | setDrawsData (bool flag) |
| enable/disable data loading | |
| void | setAspectRatio (float ratio) |
| set the aspect ratio | |
| float | getAspectRatio () |
| get the aspect ratio | |
| void | setFilter (View2DTextureFilter filter=FILTER_LINEAR) |
| set the filter | |
| View2DTextureFilter | getFilter () |
| get the filter | |
| void | setSliceAlignment (sliceAlignXMode x, sliceAlignYMode y) |
| set the alignment of the slice | |
| void | setFixedInnerZoom (bool flag, float fixedZoom) |
| set the fixed innerzoom | |
| void | setDrawSize (float sx, float sy) |
| set the slice size for drawing | |
| void | getDrawSize (float &sx, float &sy) |
| get the slice size for drawing | |
| void | setDrawPosition (float x, float y) |
| set the slice position for drawing | |
| void | getDrawPosition (float &x, float &y) |
| get the slice position for drawing | |
| void | setSliceOrigin (float x, float y) |
| set the inner slice origin | |
| void | getSliceOrigin (float &x, float &y) |
| get the inner slice origin | |
| void | setSliceZoom (float zoom) |
| set the inner slice zoom | |
| float | getSliceZoom () |
| get the inner slice zoom | |
| void | setCachingMode (SLICE_CACHING_MODE mode) |
| set data caching mode. | |
| SLICE_CACHING_MODE | getCachingMode () |
| get data caching mode. | |
| void | getVoxelSize (float &vx, float &vy, float &vz) |
| return voxel size | |
| void | updateLayout () |
| update internal layout | |
| void | setLut (ml::LUTData< MLuint8 > *lut) |
| set the lut | |
| void | setBlendMode (int blendMode, float *blendColor=NULL) |
| set blend mode | |
| void | setBackgroundColor (float *color) |
| set the background color (rgba) | |
| void | setTimePoint (int timepoint) |
| set the time point | |
| int | getTimePoint () |
| get the time point | |
| void | drawBackground () |
| draw background of the slice | |
| void | drawSlice (View2DSliceList *dsl, int originX, int originY, int width, int height, SoNodeList *extensions, bool extensionsOnly, bool isSlabRendering) |
| draw the slice (originX, originY, width and height are the current viewport position/size) | |
| void | drawTexture (View2DTexture *texture, int blendMode) |
| draw a View2DTexture (used for Slice drawing and for overlays also) | |
| void | drawTexture (View2DTexture *texture, int blendMode, float *blendColor) |
| draw a View2DTexture (used for Slice drawing and for overlays also) | |
| void | drawTexture (View2DTexture *texture, int blendMode, float *blendColor, View2DTextureFilter filter) |
| draw a View2DTexture (used for Slice drawing and for overlays also) | |
| void | drawTexture (View2DTexture *texture, float vp1[3], float vp2[3], float vp3[3], int blendMode, float *blendColor) |
| draw a View2DTexture in specified device coordinates (may be 3D coordinates also) | |
| void | drawTexture (View2DTexture *texture, float vp1[3], float vp2[3], float vp3[3], int blendMode, float *blendColor, View2DTextureFilter filter) |
| draw a View2DTexture in specified device coordinates (may be 3D coordinates also) | |
| bool | select (float x, float y, float &voxelX, float &voxelY, float &voxelZ) |
| Determine whether the slice can be selected, returned position is in voxel coordinates (typically this method is only used by View2DSliceList, please use mapDeviceToVoxel or mapDeviceToWorld instead!) (returns a correct voxel value even outside of the slice, but will return FALSE outside of the slice). | |
| bool | isSliceHit (float x, float y) |
| Returns if slice is hit at the given device coordinate if the visible device rect of a slice was hit returns TRUE,. | |
| void | invalidate () |
| Invalidate the current slice data. | |
| void | invalidateView () |
| Sets a flag that the current state of the instance does not correspond to the data on the display. | |
| float | millimeterToPixel (float lengthMillimeter) |
| calculates the pixel offset (in device coordinates) that corresponds to a certain distance (in mm, in world coordinates). | |
| void | mapVoxelToDevice (float voxelX, float voxelY, float voxelZ, float &rx, float &ry) |
| maps the local voxel coordinate to a device pixel coordinate which may be used in OpenGL (for drawing on the slice), Voxel z is currently ignored! | |
| void | mapWorldToDevice (float worldX, float worldY, float worldZ, float &rx, float &ry) |
| maps the world coordinate to a device pixel coordinate which may be used in OpenGL (for drawing on the slice) | |
| void | mapVoxelToDevice (const SbVec3f &voxelCoord, float &rx, float &ry) |
| maps the local voxel coordinate to a device pixel coordinate which may be used in OpenGL (for drawing on the slice), Voxel z is currently ignored! | |
| void | mapWorldToDevice (const SbVec3f &worldCoord, float &rx, float &ry) |
| maps the world coordinate to a device pixel coordinate which may be used in OpenGL (for drawing on the slice) | |
| void | getVisibleDeviceRect (float &dx1, float &dy1, float &dx2, float &dy2) |
| returns the visible device rect of the slice (the region the sliceOrigin and sliceZoom shows of the slice) | |
| View2DTexture * | getOverlayTexture (void *user=NULL, int id=0) |
| get the overlay texture (is only created on first call and cached afterwards) | |
| int | getLutSize () |
| get size of lut | |
| float | getInnerZoom () |
| get the inner zoom | |
| void | setDraw3D (bool flag, float devicePixelSize=1) |
| enable drawing in 3d | |
| bool | is3D () |
| check if current rendering is in 3d | |
| bool | containsVoxel (const SbVec3f &voxelPos) |
| returns if the slice contains the given voxel pos | |
Definition at line 88 of file View2DSlice.h.
| View2DSlice::View2DSlice | ( | ) |
constructor
| View2DSlice::~View2DSlice | ( | ) |
destructor.
| bool View2DSlice::containsVoxel | ( | const SbVec3f & | voxelPos | ) |
returns if the slice contains the given voxel pos
| void View2DSlice::destroy | ( | ) |
destroy the slice textures
| void View2DSlice::drawBackground | ( | ) |
draw background of the slice
| void View2DSlice::drawSlice | ( | View2DSliceList * | dsl, | |
| int | originX, | |||
| int | originY, | |||
| int | width, | |||
| int | height, | |||
| SoNodeList * | extensions, | |||
| bool | extensionsOnly, | |||
| bool | isSlabRendering | |||
| ) |
draw the slice (originX, originY, width and height are the current viewport position/size)
| void View2DSlice::drawTexture | ( | View2DTexture * | texture, | |
| float | vp1[3], | |||
| float | vp2[3], | |||
| float | vp3[3], | |||
| int | blendMode, | |||
| float * | blendColor, | |||
| View2DTextureFilter | filter | |||
| ) |
draw a View2DTexture in specified device coordinates (may be 3D coordinates also)
| void View2DSlice::drawTexture | ( | View2DTexture * | texture, | |
| float | vp1[3], | |||
| float | vp2[3], | |||
| float | vp3[3], | |||
| int | blendMode, | |||
| float * | blendColor | |||
| ) |
draw a View2DTexture in specified device coordinates (may be 3D coordinates also)
| void View2DSlice::drawTexture | ( | View2DTexture * | texture, | |
| int | blendMode, | |||
| float * | blendColor, | |||
| View2DTextureFilter | filter | |||
| ) |
draw a View2DTexture (used for Slice drawing and for overlays also)
| void View2DSlice::drawTexture | ( | View2DTexture * | texture, | |
| int | blendMode, | |||
| float * | blendColor | |||
| ) |
draw a View2DTexture (used for Slice drawing and for overlays also)
| void View2DSlice::drawTexture | ( | View2DTexture * | texture, | |
| int | blendMode | |||
| ) |
draw a View2DTexture (used for Slice drawing and for overlays also)
| float View2DSlice::getAspectRatio | ( | ) | [inline] |
| SLICE_CACHING_MODE View2DSlice::getCachingMode | ( | ) |
get data caching mode.
| void View2DSlice::getDrawPosition | ( | float & | x, | |
| float & | y | |||
| ) |
get the slice position for drawing
| void View2DSlice::getDrawSize | ( | float & | sx, | |
| float & | sy | |||
| ) |
get the slice size for drawing
| View2DTextureFilter View2DSlice::getFilter | ( | ) |
get the filter
| float View2DSlice::getInnerZoom | ( | ) |
get the inner zoom
| SoSFMLImage* View2DSlice::getInputImage | ( | ) |
get the input image.
| int View2DSlice::getLutSize | ( | ) |
get size of lut
| View2DTexture* View2DSlice::getOverlayTexture | ( | void * | user = NULL, |
|
| int | id = 0 | |||
| ) |
get the overlay texture (is only created on first call and cached afterwards)
| View2DShader* View2DSlice::getShader | ( | ) | [inline] |
| void View2DSlice::getSliceOrigin | ( | float & | x, | |
| float & | y | |||
| ) |
get the inner slice origin
| int View2DSlice::getSliceZ | ( | ) |
get the slice z position.
| float View2DSlice::getSliceZoom | ( | ) |
get the inner slice zoom
| int View2DSlice::getTimePoint | ( | ) |
get the time point
| void View2DSlice::getVisibleDeviceRect | ( | float & | dx1, | |
| float & | dy1, | |||
| float & | dx2, | |||
| float & | dy2 | |||
| ) |
returns the visible device rect of the slice (the region the sliceOrigin and sliceZoom shows of the slice)
| void View2DSlice::getVoxelSize | ( | float & | vx, | |
| float & | vy, | |||
| float & | vz | |||
| ) |
return voxel size
| void View2DSlice::invalidate | ( | ) |
Invalidate the current slice data.
| void View2DSlice::invalidateView | ( | ) |
Sets a flag that the current state of the instance does not correspond to the data on the display.
| bool View2DSlice::is3D | ( | ) | [inline] |
| bool View2DSlice::isSliceHit | ( | float | x, | |
| float | y | |||
| ) |
Returns if slice is hit at the given device coordinate if the visible device rect of a slice was hit returns TRUE,.
| void View2DSlice::mapVoxelToDevice | ( | const SbVec3f & | voxelCoord, | |
| float & | rx, | |||
| float & | ry | |||
| ) |
maps the local voxel coordinate to a device pixel coordinate which may be used in OpenGL (for drawing on the slice), Voxel z is currently ignored!
| void View2DSlice::mapVoxelToDevice | ( | float | voxelX, | |
| float | voxelY, | |||
| float | voxelZ, | |||
| float & | rx, | |||
| float & | ry | |||
| ) |
maps the local voxel coordinate to a device pixel coordinate which may be used in OpenGL (for drawing on the slice), Voxel z is currently ignored!
| void View2DSlice::mapWorldToDevice | ( | const SbVec3f & | worldCoord, | |
| float & | rx, | |||
| float & | ry | |||
| ) |
maps the world coordinate to a device pixel coordinate which may be used in OpenGL (for drawing on the slice)
| void View2DSlice::mapWorldToDevice | ( | float | worldX, | |
| float | worldY, | |||
| float | worldZ, | |||
| float & | rx, | |||
| float & | ry | |||
| ) |
maps the world coordinate to a device pixel coordinate which may be used in OpenGL (for drawing on the slice)
| float View2DSlice::millimeterToPixel | ( | float | lengthMillimeter | ) |
calculates the pixel offset (in device coordinates) that corresponds to a certain distance (in mm, in world coordinates).
| bool View2DSlice::select | ( | float | x, | |
| float | y, | |||
| float & | voxelX, | |||
| float & | voxelY, | |||
| float & | voxelZ | |||
| ) |
Determine whether the slice can be selected, returned position is in voxel coordinates (typically this method is only used by View2DSliceList, please use mapDeviceToVoxel or mapDeviceToWorld instead!) (returns a correct voxel value even outside of the slice, but will return FALSE outside of the slice).
| void View2DSlice::setAspectRatio | ( | float | ratio | ) | [inline] |
| void View2DSlice::setBackgroundColor | ( | float * | color | ) |
set the background color (rgba)
| void View2DSlice::setBlendMode | ( | int | blendMode, | |
| float * | blendColor = NULL | |||
| ) |
set blend mode
| void View2DSlice::setCachingMode | ( | SLICE_CACHING_MODE | mode | ) |
set data caching mode.
| void View2DSlice::setDraw3D | ( | bool | flag, | |
| float | devicePixelSize = 1 | |||
| ) |
enable drawing in 3d
| void View2DSlice::setDrawPosition | ( | float | x, | |
| float | y | |||
| ) |
set the slice position for drawing
| void View2DSlice::setDrawsData | ( | bool | flag | ) |
enable/disable data loading
| void View2DSlice::setDrawSize | ( | float | sx, | |
| float | sy | |||
| ) |
set the slice size for drawing
| void View2DSlice::setFilter | ( | View2DTextureFilter | filter = FILTER_LINEAR |
) |
set the filter
| void View2DSlice::setFixedInnerZoom | ( | bool | flag, | |
| float | fixedZoom | |||
| ) |
set the fixed innerzoom
| void View2DSlice::setInputImage | ( | SoSFMLImage * | img | ) |
set the input image.
| void View2DSlice::setLut | ( | ml::LUTData< MLuint8 > * | lut | ) |
set the lut
| void View2DSlice::setShader | ( | View2DShader * | shader | ) |
sets the shader that should be used for rendering
| void View2DSlice::setSliceAlignment | ( | sliceAlignXMode | x, | |
| sliceAlignYMode | y | |||
| ) |
set the alignment of the slice
| void View2DSlice::setSliceOrigin | ( | float | x, | |
| float | y | |||
| ) |
set the inner slice origin
| void View2DSlice::setSliceZ | ( | int | z | ) |
set the slice z position.
| void View2DSlice::setSliceZoom | ( | float | zoom | ) |
set the inner slice zoom
| void View2DSlice::setTimePoint | ( | int | timepoint | ) |
set the time point
| void View2DSlice::updateLayout | ( | ) |
update internal layout
1.5.8