Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::EventRecorder Class Reference

Observer that enables recording of all user interaction with the render windows and storing it in an XML file. More...

#include <mitkEventRecorder.h>

Inheritance diagram for mitk::EventRecorder:
Collaboration diagram for mitk::EventRecorder:

Public Member Functions

 EventRecorder ()
 Constructor. More...
 
 ~EventRecorder () override
 Destructor. Closes any open file stream. More...
 
void Notify (InteractionEvent *interactionEvent, bool) override
 Callback that receives new interaction events. More...
 
void SetEventIgnoreList (std::vector< std::string > list)
 Set a list of event names to ignore during recording. More...
 
void StartRecording ()
 Start recording events to the output file. More...
 
void StopRecording ()
 Stop recording and close the output file. More...
 
bool IsActive ()
 Check whether the recorder is currently active. More...
 
void SetOutputFile (std::string filename)
 Set the output file path for recording. More...
 
- Public Member Functions inherited from mitk::InteractionEventObserver
 InteractionEventObserver ()
 
virtual ~InteractionEventObserver ()
 
void Disable ()
 Disable this observer so it no longer receives notifications. More...
 
void Enable ()
 Enable this observer so it receives notifications. More...
 
bool IsEnabled () const
 Check whether this observer is currently enabled. More...
 

Detailed Description

Observer that enables recording of all user interaction with the render windows and storing it in an XML file.

XML file will look like:

<?xml version="1.0"?>
<interactions>
<config>
<renderer RendererName="stdmulti.widget0" ViewDirection="0"/>
<renderer RendererName="stdmulti.widget1" ViewDirection="1"/>
<renderer RendererName="stdmulti.widget2" ViewDirection="2"/>
</config>
<events>
<event_variant class="MOUSEMOVEEVENT" >
<attribute name="PositionOnScreen" value="491,388"/>
<attribute name="PositionInWorld" value="128,235.771,124.816"/>
<attribute name="RendererName" value="stdmulti.widget1"/>
</event_variant>
</events>
</interactions>
See also
InteractionEventObserver
EventFactory

Definition at line 52 of file mitkEventRecorder.h.

Constructor & Destructor Documentation

◆ EventRecorder()

mitk::EventRecorder::EventRecorder ( )

Constructor.

◆ ~EventRecorder()

mitk::EventRecorder::~EventRecorder ( )
override

Destructor. Closes any open file stream.

Member Function Documentation

◆ IsActive()

bool mitk::EventRecorder::IsActive ( )
inline

Check whether the recorder is currently active.

Returns
true if recording is in progress, false otherwise.

Definition at line 97 of file mitkEventRecorder.h.

◆ Notify()

void mitk::EventRecorder::Notify ( InteractionEvent *  interactionEvent,
bool   
)
overridevirtual

Callback that receives new interaction events.

This function is called by the event dispatching system to notify the recorder about new events. The event is serialized to XML and written to the output file.

Parameters
interactionEventThe interaction event to record.

Implements mitk::InteractionEventObserver.

◆ SetEventIgnoreList()

void mitk::EventRecorder::SetEventIgnoreList ( std::vector< std::string >  list)

Set a list of event names to ignore during recording.

Events whose class name matches any entry in the list will not be recorded.

Parameters
listVector of event class names to ignore.

◆ SetOutputFile()

void mitk::EventRecorder::SetOutputFile ( std::string  filename)
inline

Set the output file path for recording.

Parameters
filenamePath to the XML output file.

Definition at line 104 of file mitkEventRecorder.h.

◆ StartRecording()

void mitk::EventRecorder::StartRecording ( )

Start recording events to the output file.

Precondition
The output file must be set via SetOutputFile() before calling this method.

◆ StopRecording()

void mitk::EventRecorder::StopRecording ( )

Stop recording and close the output file.


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