[vtkusers] InteractorStyle Subclassing

David Cole DLRdave at aol.com
Tue Jan 16 10:06:34 EST 2018


It does sound reasonable.

I work on a project where we do this: subclass the trackballActor
interactor style and then instantiate and hold a camera interactor
style that we delegate to "when appropriate", and the when appropriate
is based on whether the trackballActor interaction prop is null or not
at mouse down time.

Totally works.

I'd point you to it, but it's not publicly available open source at
this point...

Good luck!
David C.



On Tue, Jan 16, 2018 at 8:51 AM, Cory Quammen <cory.quammen at kitware.com> wrote:
> That sounds like a reasonable approach to me.
>
> - Cory
>
> On Tue, Jan 16, 2018 at 4:40 AM, Majid Mohammad sadeghi via vtkusers
> <vtkusers at vtk.org> wrote:
>> Dear All,
>>
>> What I am trying to do is:
>>
>> Based on the position of the mouse click in the window, if no actor is
>> clicked on, then move the camera (like InteractorStyleTrackballCamera) but
>> if the mouse is clicked on an actor(and there are different actors in the
>> scene), then move the actor (like InteractorStyleTrackballActor). Also limit
>> the motion type of the actor to a specific translation or rotation.
>>
>> The way I think I might be able to do it is:
>>
>> Write my own interactor style with a combination of trackballActor and
>> trackballCamera after I check the pickposition of the mouse.
>>
>> My question is:
>>
>> Am I in the right path? Can I do it in a faster or better way? Is there a
>> widget which might help me?
>>
>> Thank you all.
>>
>> _______________________________________________
>> 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
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> https://vtk.org/mailman/listinfo/vtkusers
>>
>
>
>
> --
> Cory Quammen
> Staff R&D Engineer
> Kitware, Inc.
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtkusers


More information about the vtkusers mailing list