vtkInteractorStyleRubberBand2D: unable to obtain selected rectangle
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
I am using Python wrapping to VTK 5.4.2
I am using vtkInteractorStyleRubberBand2D to allow the user to select a rectangle in a 2D plot (vtkXYPlotActor).
When I connect, the callback:
self.inter.AddObserver("SelectionChangedEvent", self.selection)
def selection(self, obj, evt): ...
Does not receive the "callData" argument that is passed to InvokeEvent (which would contain the coordinates of the selected rectangle (rect)) like this:
this->InvokeEvent(vtkCommand::SelectionChangedEvent, reinterpret_cast<void*>(rect));
in (in this case, in C++ is an: "unsigned int rect[5];") that would provide the coordinates of the selected rectangle.
Also, the only variables that would provide the needed information in vtkInteractorStyleRubberBand2D, are StartPosition and EndPosition, and they are protected; no method is available to access them.
As a workaround, I managed to get it work by adding observers to "StartInteractionEvent" and "EndInteractionEvent", and recording the two coordinates with iren.GetEventPosition().
I would suggest to provide public methods like vtkInteractorStyleRubberBand2D::GetStartPosition() and vtkInteractorStyleRubberBand2D::GetEndPosition(), or to provide a means to obtain (in Python too) the "callData" argument passed to InvokeEvent.