Medical Imaging Interaction Toolkit
2024.06.00
Medical Imaging Interaction Toolkit
|
Creates everything needed to load and playback interaction events. More...
#include <mitkInteractionTestHelper.h>
Public Types | |
typedef std::vector< RenderWindow::Pointer > | RenderWindowListType |
Public Member Functions | |
InteractionTestHelper (const std::string &interactionXmlFilePath) | |
InteractionTestHelper set up all neseccary objects by calling Initialize. More... | |
virtual | ~InteractionTestHelper () |
DataStorage::Pointer | GetDataStorage () |
Returns the datastorage, in order to modify the data inside a rendering test. More... | |
void | AddNodeToStorage (DataNode::Pointer node) |
AddNodeToStorage Add a node to the datastorage and perform a reinit which is necessary for rendering. More... | |
void | PlaybackInteraction () |
PlaybackInteraction playback loaded interaction by passing events to the dispatcher. More... | |
void | SetTimeStep (int newTimeStep) |
SetTimeStep Sets timesteps of all SliceNavigationControllers to given timestep. More... | |
const RenderWindowListType & | GetRenderWindowList () |
RenderWindow * | GetRenderWindowByName (const std::string &name) |
GetRenderWindowByName Get renderWindow by the name of its renderer. More... | |
RenderWindow * | GetRenderWindowByDefaultViewDirection (AnatomicalPlane viewDirection) |
Get a renderWindow by its default view direction. More... | |
RenderWindow * | GetRenderWindow (unsigned int index) |
GetRenderWindow Get renderWindow at position 'index'. More... | |
void | AddDisplayPlaneSubTree () |
AddDisplayPlaneSubTree. More... | |
void | Set3dCameraSettings () |
Protected Member Functions | |
void | Initialize (const std::string &interactionXmlFilePath) |
Initialize Internal method to initialize the renderwindow and set the datastorage. More... | |
void | InitializeDisplayActionEventHandling () |
Initialize the interaction event observer / event state machine and register it as a service. More... | |
void | LoadInteraction () |
LoadInteraction loads events from xml file. More... | |
Creates everything needed to load and playback interaction events.
The interaction is loaded from an xml file and the events are created. This file is usually a recorded user interaction with the GUI. This can be done with InteractionEventRecorder plugin. Also all necessary objects to handle interaction events are generated. The user of this class is responsible to add the data object to interact with to the data storage of InteractionTestHelper. And must also make sure that a proper data interactor is associated with the data object.
To test a PointSet interaction for instance make sure you have a PointSet node and a PointSetDataInteractor. Then just add the node to the storage of the your InteractionTestHelper by calling InteractionTestHelper::AddNodeToStorage. Use InteractionTestHelper::PlaybackInteraction to execute. The result can afterwards be compared to a reference object.
Make sure to destroy the test helper instance after each test, since all render windows and its renderers have to be unregistered.
Definition at line 50 of file mitkInteractionTestHelper.h.
typedef std::vector<RenderWindow::Pointer> mitk::InteractionTestHelper::RenderWindowListType |
Definition at line 87 of file mitkInteractionTestHelper.h.
mitk::InteractionTestHelper::InteractionTestHelper | ( | const std::string & | interactionXmlFilePath | ) |
InteractionTestHelper set up all neseccary objects by calling Initialize.
interactionXmlFilePath | path to xml file containing events and configuration information for the render windows. |
|
virtual |
void mitk::InteractionTestHelper::AddDisplayPlaneSubTree | ( | ) |
AddDisplayPlaneSubTree.
Creates DisplayPlanes that are shown in a 3D RenderWindow.
void mitk::InteractionTestHelper::AddNodeToStorage | ( | DataNode::Pointer | node | ) |
AddNodeToStorage Add a node to the datastorage and perform a reinit which is necessary for rendering.
node | The data you want to add. |
DataStorage::Pointer mitk::InteractionTestHelper::GetDataStorage | ( | ) |
Returns the datastorage, in order to modify the data inside a rendering test.
RenderWindow* mitk::InteractionTestHelper::GetRenderWindow | ( | unsigned int | index | ) |
GetRenderWindow Get renderWindow at position 'index'.
index | Position within the renderWindow list. |
RenderWindow* mitk::InteractionTestHelper::GetRenderWindowByDefaultViewDirection | ( | AnatomicalPlane | viewDirection | ) |
Get a renderWindow by its default view direction.
viewDirection |
RenderWindow* mitk::InteractionTestHelper::GetRenderWindowByName | ( | const std::string & | name | ) |
GetRenderWindowByName Get renderWindow by the name of its renderer.
name | The name of the renderer of the desired renderWindow. |
|
inline |
Definition at line 89 of file mitkInteractionTestHelper.h.
|
protected |
Initialize Internal method to initialize the renderwindow and set the datastorage.
mitk::Exception | if interaction xml file can not be loaded. |
|
protected |
Initialize the interaction event observer / event state machine and register it as a service.
|
protected |
LoadInteraction loads events from xml file.
void mitk::InteractionTestHelper::PlaybackInteraction | ( | ) |
PlaybackInteraction playback loaded interaction by passing events to the dispatcher.
void mitk::InteractionTestHelper::Set3dCameraSettings | ( | ) |
void mitk::InteractionTestHelper::SetTimeStep | ( | int | newTimeStep | ) |
SetTimeStep Sets timesteps of all SliceNavigationControllers to given timestep.
newTimeStep | new timestep |
Does the same as using ImageNavigators Time slider. Use this if your data was modified in a timestep other than 0.
|
protected |
Definition at line 140 of file mitkInteractionTestHelper.h.
|
protected |
Definition at line 141 of file mitkInteractionTestHelper.h.
|
protected |
Definition at line 135 of file mitkInteractionTestHelper.h.
|
protected |
Definition at line 137 of file mitkInteractionTestHelper.h.
|
protected |
Definition at line 139 of file mitkInteractionTestHelper.h.