[vtkusers] How do interact with multiple actors independently in a render window?

David Doria daviddoria at gmail.com
Tue Dec 30 13:33:49 EST 2014


On Tue, Dec 30, 2014 at 1:29 PM, Student Life <lifestudent37 at gmail.com>
wrote:

> Hi,
>
> Basically, I have multiple actors in my render window, and so far if I
> rotate one actor all the actors move with it as well.
>
> I want to interact with multiple objects independently. For example, if I
> have 5 objects in a render window, I want to only move, rotate and interact
> with the one selected object; whilst the rest of the 4 objects stay where
> it is.
>
> At the moment, the camera is doing the magic and as I rotate the
> independent object, other objects move at the same time and I don't want
> that to happen.
>
> I also want to store all the objects in memory.
>
> I intend to use C++.
>
> This is my sort of class structure...
>
> class ScreenObjects{
>    vtkActor (LinkedList); // I intend on using a linkedlist to store all the actors
>
>    public:
>    ScreenObjects(); // Constructor. Initializes vtkActor to null.
>    void readSTLFile(); // Reads the STL File
>    bool setObject(); // Sets current object, so you can only interact with the selected object}
>
> I am missing quite a lot of functions and detail in my class, as I don't
> know what else to include that would be of use. I was also thinking of
> joining two objects together, but again, I don't know how to incorporate
> that in my class; any information on that would be appreciated.
> Would really appreciate it if I could be given ideas.
>

You need to specify an "interactor style" - the one you are looking for
here is vtkInteractorStyleTrackballActor. Here is an example:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/TrackballActor

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20141230/57c04523/attachment.html>


More information about the vtkusers mailing list