Hello again,
If I understand your problem correctly, you are probably not interested in the mouse click itself, you are interested to know when a new markups control point is placed (and yes, usually this comes after a mouse click, but it could also come from a python command). Therefore, I think you should focus on the event of adding a new control point.
If your design only requires to have one vtkMRMLMarkupsFiducialNode
with several control points, I would create one in my code during initialization, and observe
# This should go in your logic initialization and should be called only
# once
self.markupsFiducialNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLMarkupsFiducialNode')
self.markupFiducialNode.AddObserver(self.markupsFiducialNode.PointPositionDefinedEvent, self.onControlPointAdded)
self.onControlPointAdded
is a callback function that will be called every time a new control point on self.markupsFiducialNode
is added. The callback function will have some parameters that will help you get all the information about the node and the control points. There is more information about this mechanism in: Handle Markups events from an external module - #28 by Fangwen_Zhai
I hope this works for you.