Custom processInteractionEvents

Hello Team,

Kindly wanted to know from where is the function “processInteractionEvents()” triggered? How can we use this function in our custom module to capture mouse move event?

Regards

Probably triggering processInteractionEvents would not be a good solution.
Could you describe what you would like to achieve?

Hello Andras Lasso Sir,

I am trying to include VTKWidget and MRML subdirectories in my loadable module. Also in the the vtkSlicerWidget’s processInteractionEvent want to capture the mousemove event to get information of the coordinates of the mouse in the view. Say red view for now.

I am facing two main issues -

  1. I am unable to build once I create these folders and files using cmake

The error I get is

---------------------------------------------
LNK1104	cannot open file '..\lib\Slicer-5.3\qt-loadable-modules\Debug\vtkSlicer<MyModule>ModuleMRML.lib'	qSlicer<MyModule>Module	C:\<path to MyModule>\LINK	1
--------------------------------------------------------------------------
MSB8066	Custom build for 'C:\<Path>\build\CMakeFiles\xyz56\vtkSlicer<My Module>ModuleVTKWidgetsHierarchy.stamp.txt.rule;C:\<Path To MY Module>\VTKWidgets\CMakeLists.txt' exited with code 1.	vtkSlicer<MY Module>ModuleVTKWidgets	C:\<path>VC\v170\Microsoft.CppCommon.targets	247	
--------------------------------------------------------------------
  1. Locate the code from where processInteractionEvent gets triggered ( say from vtkMRMLAbstractWidget)

Kindly looking forward to your support.

Regards

If you just want to get the mouse cursor position then you can observe the crosshair node.

If you want to interactively collect mouse clicks then I would recommend to use markups module. You can create a markup node, activate/deactivate placement, etc. and observe the node changes. These are all quite straightforward, high-level operations, mostly just working with MRML nodes.

Hello Andras Lasso Sir,

Thank you. Will also lookinto that, but to work with MRML nodes in c++ we would need to add MRML folder right? However, when I do that. I am getting the below error:

---------------------------------------------
LNK1104	cannot open file '..\lib\Slicer-5.3\qt-loadable-modules\Debug\vtkSlicer<MyModule>ModuleMRML.lib'	qSlicer<MyModule>Module	C:\<path to MyModule>\LINK	1
--------------------------------------------------------------------------
MSB8066	Custom build for 'C:\<Path>\build\CMakeFiles\xyz56\vtkSlicer<My Module>ModuleVTKWidgetsHierarchy.stamp.txt.rule;C:\<Path To MY Module>\VTKWidgets\CMakeLists.txt' exited with code 1.	vtkSlicer<MY Module>ModuleVTKWidgets	C:\<path>VC\v170\Microsoft.CppCommon.targets	247	
--------------------------------------------------------------------

How can we solve this?

Regards

I would recommend to look at how similar modules in implemented in other extensions. The list of all extensions and their github repository URL is available in the Extensions Index.