[vtkusers] Best way to store multiple vtkActors using C++

Student Life lifestudent37 at gmail.com
Tue Jan 6 17:51:25 EST 2015

Dear David Doria,

Thank you for your response.

I did some research into the* vtkAssembly* class and found that the
method, *'void
AddPart (vtkProp3D *)'* adds the part. However, it takes a *vtkProp3D*
object as its parameter, but then *vtkActor *inherits from *vtkProp3D.*
Would I be right in saying that this function would still work, as my
objects are all declared as *vtkActor *and not *vtkProp3D?*

The only sort of difficulty/concern I am having is storing more than
one *vtkActor
*in a *vtkRenderer.*

So far, I intend on implementing an actor class in C++, and then another
class called 'MultipleActors' which takes instances of the actor class and
stores it as a linked list. However, I am not sure if this is a wise thing
to do. Is there another way/data structure that I could use for storing
multiple actors into memory in C++?

Also, in regards to moving the actor independently, I want to make use of
matrices? How do I incorporate this into my actor class/VTK?

Finally, I am slightly confused about how the* vtkPolyDataMapper* works/is
incorporated with *vtkActors*? Does every *vtkActor *have its own
*vtkPolyDataMapper?* Are rotations and the mathematics behind the


On Tue, Jan 6, 2015 at 1:57 PM, David Doria <daviddoria at gmail.com> wrote:

> On Tue, Jan 6, 2015 at 5:53 AM, Student Life <lifestudent37 at gmail.com>
> wrote:
>> Hi,
>> I basically want to store multiple vtkActors within my render window so
>> that the user can interact with them. I also want to group some vtkActors
>> together
>> I was thinking of using a linkedlist, to store each vtkActor.
>> I was also thinking of grouping multiple vtkActors so that they can be
>> interacted with and rotated in unison. I was thinking of doing this using a
>> vtkAssembly, but I'm not too sure.
>> I am new to VTK and would greatly appreciate some help/advice.
>> Many thanks
> Yes, a vtkAssembly is what you want:
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/Assembly
> Couple this with the vtkInteractorStyleTrackballActor:
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/MoveActor
> and you should be in business.
> David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150106/9453778b/attachment.html>

More information about the vtkusers mailing list