[vtkusers] vtkInteractorStyleRubberBand2D to obtain rectangle

Rodrigo Valiña Gutiérrez rodrigo.valina at usc.es
Wed Apr 28 10:25:47 EDT 2010


I submitted the bug:

http://vtk.org/Bug/view.php?id=10634

As I say in the bug report, I managed to get it work by adding
observers to "StartInteractionEvent" and "EndInteractionEvent", and
recording the two coordinates with iren.GetEventPosition().

--
Rodrigo

On Wed, Apr 28, 2010 at 3:34 PM, Jeff Baumes <jeff.baumes at kitware.com> wrote:
> It looks like you have tried the appropriate things, so there likely
> is no way. The approach of making the start/end position accessible
> seems reasonable. You can report a bug here
>
> http://vtk.org/Bug
>
> and better yet, you can make the appropriate patch and attach it to
> the bug for inclusion in VTK.
>
> Jeff
>
> On Wed, Apr 28, 2010 at 7:36 AM, Rodrigo Valiña Gutiérrez
> <rodrigo.valina at usc.es> wrote:
>> Hi,
>>
>> 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" (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.
>>
>> Is there any way of obtain the coordinates of the selected rectangle?
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
>
>
> --
> Jeff Baumes, Ph.D.
> R&D Engineer, Kitware Inc.
> (518) 881-4932
> jeff.baumes at kitware.com
>



More information about the vtkusers mailing list