[vtkusers] [vtk-developers] Pick/select a vtkactor or a vtkpolydatamapper with Java

David Doria daviddoria at gmail.com
Mon Jun 2 07:40:45 EDT 2014


On Mon, Jun 2, 2014 at 7:36 AM, David Doria <daviddoria at gmail.com> wrote:

> On Mon, Jun 2, 2014 at 5:24 AM, Mark Hervagault <mark.hervagault at gmail.com
> > wrote:
>
>> Hi,
>>
>>
>> I'm stuck for some time. I try to select my vtkActor (or my
>> vtkPolyDataMapper). I want to see my object in a different color or the
>> color of the wallpaper changes when I select my object.
>>
>> Help me please! Thank you.
>>
> Mark,

Questions like this are more appropriate for the vtkusers mailing list (I
have changed the list in CC).

In VTK you would do something like this in an InteractorStyle. In this
example:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/SelectAnActor

you can see that in the OnLeftButtonDown() function of the InteractorStyle,
we check the InteractionProp object against some objects that we have told
the InteractorStyle about, and if it matches, we know we have selected the
object of interest. At that point, you can do whatever you want (change
it's color, change the background color, etc.).

Good luck,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140602/c447fe05/attachment.html>


More information about the vtkusers mailing list