I have a module that invokes custom event
MyEvent. I’m looking for a way to catch this event within displayable node.
I can see an option here:
- I can invoke the event from the module’s logic but set scene as a caller;
- invoke the event from the logic and set the logic as a caller
If I choose the first option than
MyEvent enum will be defined in
MyLogic.h and the caller will be the scene. I think this is not a good idea.
If I choose the second option then it seems that I will be unable to get module instance from the displayable node and thus I will be unable to
addObserver from the node to the logic.
Also there is a third option: from the module logic iterate through all displayable nodes and call the common method (probably
ProcessMRMLEvents) and within this method I should process the chosen event. But I think this is also not a best choice.
Is there any recommendation?