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

Student Life lifestudent37 at gmail.com
Tue Dec 30 14:02:44 EST 2014


Dear Mr David Doria,

Thank you for your response.

I am going to be using C++ to develop a software that allows the user to
interact with multiple objects/actors on the screen.
They should be able to move objects/actors independently from one another.

The thing is, I need to store all of this in memory and so I have come up
with this class structure to store objects/actors in memory. I also have
another class to handle the vtkPicker, i.e. if points are selected on the
actor, then they stay there even if that object/actor is moved
independently the points should move with it. I am thinking of using
inheritance, this is my sort of class structure...

Actor Class...
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
   void reset(); //Resets everything, including vtkActors
}

Picker Class...
class PickerActor : class ScreenObjects
{
    public:
    PickerActor();
}


Would really appreciate it if you could give me some ideas or suggestions
for my class structure.

Thanks


On Tue, Dec 30, 2014 at 6:33 PM, David Doria <daviddoria at gmail.com> wrote:

> 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/01fa645b/attachment.html>


More information about the vtkusers mailing list