NifTK
16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
|
A vl::UIEventListener bound to a QGLWidget (niftk::VLWidget) managing all VL/Vivid rendering and options and listening to mitk::DataStorage events. More...
Public Types | |
typedef std::map < mitk::DataNode::ConstPointer, vl::ref< VLMapper > > | DataNodeVLMapperMapType |
Public Member Functions | |
VLSceneView (VLWidget *vlwidget) | |
~VLSceneView () | |
void | setDataStorage (mitk::DataStorage *ds) |
bool | setCameraTrackingNode (const mitk::DataNode *node) |
void | setEyeHandFileName (const std::string &fileName) |
bool | setBackgroundNode (const mitk::DataNode *node) |
void | setRenderingMode (vl::Vivid::ERenderingMode) |
vl::Vivid::ERenderingMode | renderingMode () const |
void | setBackgroundColor (float r, float g, float b) |
vl::vec3 | backgroundColor () const |
void | setStencilEnabled (bool enabled) |
bool | isStencilEnabled () const |
void | setStencilBackgroundColor (const vl::vec4 &color) |
const vl::vec4 & | stencilBackgroundColor () const |
void | setStencilSmoothness (float smoothness) |
float | stencilSmoothness () const |
void | setOpacity (float opacity) |
float | opacity () const |
void | setDepthPeelingPasses (int n) |
int | depthPeelingPasses () const |
void | reInit (const vl::vec3 &dir=vl::vec3(0, 0, 1), const vl::vec3 &up=vl::vec3(0, 1, 0), float bias=1.0f) |
void | globalReInit (const vl::vec3 &dir=vl::vec3(0, 0, 1), const vl::vec3 &up=vl::vec3(0, 1, 0), float bias=1.0f) |
vl::VividRendering * | vividRendering () |
const vl::VividRendering * | vividRendering () const |
niftk::VLTrackballManipulator * | trackball () |
const niftk::VLTrackballManipulator * | trackball () const |
vl::CalibratedCamera * | camera () |
const vl::CalibratedCamera * | camera () const |
mitk::DataStorage * | dataStorage () |
const mitk::DataStorage * | dataStorage () const |
void | scheduleSceneRebuild () |
Protected Member Functions | |
void | initSceneFromDataStorage () |
void | clearScene () |
void | updateScene () |
void | renderScene () |
void | addDataStorageListeners () |
void | removeDataStorageListeners () |
void | scheduleTrackballAdjustView (bool schedule=true) |
void | scheduleNodeAdd (const mitk::DataNode *node) |
Schedules an addDataNode() at the next rendering. More... | |
void | scheduleNodeRemove (const mitk::DataNode *node) |
Schedules a removeDataNode() at the next rendering. More... | |
void | scheduleNodeUpdate (const mitk::DataNode *node) |
Schedules an updateDataNode() at the next rendering. More... | |
void | addDataNode (const mitk::DataNode *node) |
Adds to the scene a VLMapper subclass representing the given DataNode. More... | |
void | removeDataNode (const mitk::DataNode *node) |
Removes from the scene the VLMapper subclass representing the given DataNode. More... | |
void | updateDataNode (const mitk::DataNode *node) |
Updates the VLMapper subclass representing the given DataNode. More... | |
void | updateCameraParameters () |
Updates the camera position, projection and viewport. More... | |
VLMapper * | getVLMapper (const mitk::DataNode *node) |
Returns the VLMapper associated to the given DataNode. More... | |
virtual void | initEvent () |
virtual void | resizeEvent (int width, int height) |
virtual void | updateEvent () |
virtual void | destroyEvent () |
virtual void | addedListenerEvent (vl::OpenGLContext *) |
virtual void | removedListenerEvent (vl::OpenGLContext *) |
virtual void | enableEvent (bool) |
virtual void | visibilityEvent (bool) |
virtual void | mouseMoveEvent (int, int) |
virtual void | mouseUpEvent (vl::EMouseButton, int, int) |
virtual void | mouseDownEvent (vl::EMouseButton, int, int) |
virtual void | mouseWheelEvent (int) |
virtual void | keyPressEvent (unsigned short, vl::EKey) |
virtual void | keyReleaseEvent (unsigned short, vl::EKey) |
virtual void | fileDroppedEvent (const std::vector< vl::String > &) |
Protected Attributes | |
VLWidget * | m_VLWidget |
vl::ref< vl::VividRendering > | m_VividRendering |
vl::ref< vl::VividRenderer > | m_VividRenderer |
vl::ref < vl::SceneManagerActorTree > | m_SceneManager |
vl::ref< vl::CalibratedCamera > | m_Camera |
vl::ref < niftk::VLTrackballManipulator > | m_Trackball |
mitk::DataStorage::Pointer | m_DataStorage |
DataNodePropertyListener::Pointer | m_NodeVisibilityListener |
DataNodePropertyListener::Pointer | m_NodeColorPropertyListener |
DataNodePropertyListener::Pointer | m_NodeOpacityPropertyListener |
DataNodeVLMapperMapType | m_DataNodeVLMapperMap |
std::set < mitk::DataNode::ConstPointer > | m_NodesToUpdate |
std::set < mitk::DataNode::ConstPointer > | m_NodesToAdd |
std::set < mitk::DataNode::ConstPointer > | m_NodesToRemove |
mitk::DataNode::ConstPointer | m_CameraNode |
mitk::DataNode::ConstPointer | m_BackgroundNode |
mitk::Image::ConstPointer | m_BackgroundImage |
vl::mat4 | m_EyeHandMatrix |
bool | m_ScheduleTrackballAdjustView |
bool | m_ScheduleInitScene |
bool | m_RenderingInProgressGuard |
A vl::UIEventListener bound to a QGLWidget (niftk::VLWidget) managing all VL/Vivid rendering and options and listening to mitk::DataStorage events.
"Vivid" is the short name of the rendering engine based on Visualization Library developed exclusively for NifTK (see vl::VividRendering, vl::VividRenderer, vl::VividVolume and relative GLSL shaders).
VLSceneView listens for the QGLWidget update, resize, mouse, keyboard events and updates the rendering accordingly also allowing for user interaction via trackball. It also listens for mitk::DataStorage events and updates the scene adding, removing and updating objects according to the state of the mitk::DataStorage.
VLSceneView keeps track of ievery mitk::DataNode added and uses a niftk::VLMapper sub-class to render it and update it's visual aspect. The mapping from mitk::DataNode to niftk::VLMapper is done in the factory method niftk::VLMapper::create().
Supported objects types:
typedef std::map< mitk::DataNode::ConstPointer, vl::ref<VLMapper> > niftk::VLSceneView::DataNodeVLMapperMapType |
niftk::VLSceneView::VLSceneView | ( | VLWidget * | vlwidget | ) |
niftk::VLSceneView::~VLSceneView | ( | ) |
|
protected |
Adds to the scene a VLMapper subclass representing the given DataNode.
|
protected |
|
inlineprotectedvirtual |
vl::vec3 niftk::VLSceneView::backgroundColor | ( | ) | const |
|
inline |
Returns the underlying vl::CalibratedCamera, usually you don't need to touch this.
|
inline |
|
protected |
|
inline |
Returns the underlying mitk::DataStorage, usually you don't need to touch this.
|
inline |
int niftk::VLSceneView::depthPeelingPasses | ( | ) | const |
|
protectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
protected |
Returns the VLMapper associated to the given DataNode.
void niftk::VLSceneView::globalReInit | ( | const vl::vec3 & | dir = vl::vec3(0,0,1) , |
const vl::vec3 & | up = vl::vec3(0,1,0) , |
||
float | bias = 1.0f |
||
) |
Positions the camera for optimal scene visibility.
|
protectedvirtual |
|
protected |
bool niftk::VLSceneView::isStencilEnabled | ( | ) | const |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
float niftk::VLSceneView::opacity | ( | ) | const |
void niftk::VLSceneView::reInit | ( | const vl::vec3 & | dir = vl::vec3(0,0,1) , |
const vl::vec3 & | up = vl::vec3(0,1,0) , |
||
float | bias = 1.0f |
||
) |
Positions the camera for optimal visibility of the currently selected DataNode.
|
protected |
Removes from the scene the VLMapper subclass representing the given DataNode.
|
protected |
|
inlineprotectedvirtual |
vl::Vivid::ERenderingMode niftk::VLSceneView::renderingMode | ( | ) | const |
|
protected |
|
protected |
Schedules an addDataNode() at the next rendering.
|
protected |
Schedules a removeDataNode() at the next rendering.
|
protected |
Schedules an updateDataNode() at the next rendering.
void niftk::VLSceneView::scheduleSceneRebuild | ( | ) |
Destroys the current scene and schedules a rebuild at the next rendering.
|
protected |
void niftk::VLSceneView::setBackgroundColor | ( | float | r, |
float | g, | ||
float | b | ||
) |
The rendering background color.
bool niftk::VLSceneView::setBackgroundNode | ( | const mitk::DataNode * | node | ) |
Sets a node containing an mitk::Image or niftk::CUDAImage to be used as background. Passing NULL will disable the background image.
bool niftk::VLSceneView::setCameraTrackingNode | ( | const mitk::DataNode * | node | ) |
Sets the transform to be used to move the camera around. Passing NULL will disable camera tracking and enable the trackball.
void niftk::VLSceneView::setDataStorage | ( | mitk::DataStorage * | ds | ) |
Sets the mitk::DataStorage to listen from. The scene will be destroyed and recreated and niftk::VLGlobalSettingsDataNode added if not present already.
The number of depth peeling passes to be done. The more passes the more transparency layers will be rendered and the slower the rendering. When vl::VividRendering::depthPeelingAutoThrottleEnabled() is false the rendering will always do N passes, else it will try to do only one pass if all objects are fully opaque and no fogging or clipping is using the alpha target.
void niftk::VLSceneView::setEyeHandFileName | ( | const std::string & | fileName | ) |
Loads the file storing the eye-hand calibration matrix.
void niftk::VLSceneView::setOpacity | ( | float | opacity | ) |
The opacity of the 3D rendering above the background. The background is always fully opaque.
void niftk::VLSceneView::setRenderingMode | ( | vl::Vivid::ERenderingMode | mode | ) |
The rendering mode, mainly for debugging purposes.
void niftk::VLSceneView::setStencilBackgroundColor | ( | const vl::vec4 & | color | ) |
Color of the stencil background.
void niftk::VLSceneView::setStencilEnabled | ( | bool | enabled | ) |
Whether geometry stencil effect is enabled.
void niftk::VLSceneView::setStencilSmoothness | ( | float | smoothness | ) |
Smoothness in pixels of the stencil background. Defines the size of the smoothing kernel so the bigger the slower the rendering.
const vl::vec4 & niftk::VLSceneView::stencilBackgroundColor | ( | ) | const |
float niftk::VLSceneView::stencilSmoothness | ( | ) | const |
|
inline |
Returns the underlying niftk::VLTrackballManipulator, usually you don't need to touch this.
|
inline |
|
protected |
Updates the camera position, projection and viewport.
|
protected |
Updates the VLMapper subclass representing the given DataNode.
|
protectedvirtual |
|
protected |
|
inlineprotectedvirtual |
|
inline |
Returns the underlying vl::VividRendering, usually you don't need to touch this.
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |