[vtkusers] How to combine several actors into a single entity?

Simon Drouin sdrouin at bic.mni.mcgill.ca
Wed Mar 2 08:08:55 EST 2005


Yianis Nikolaou wrote:

>hi,
>
>try using vtkAppendPolyData to combine the (PolyData) output of your
>objects (use AddInput) and then create an actor from the (PolyData)
>output of the vtkAppendPolyData
>
>
>On Sat, 26 Feb 2005 12:50:36 -0800 (PST), Shi Jin <jinzishuai at yahoo.com> wrote:
>  
>
>>Hi there,
>>
>>I am very new to VTK. I have now a problem drawing a
>>multiple spring-bead polymer model. For example, I
>>want to draw a dumbbell with one spring and two
>>spheres at the end. Now what I do is to make three
>>actors for them. But ideally I think I should be able
>>to make them into a single identity so that it is
>>easier to manipulate them as a whole. Is there a way
>>to make these three actors into a single actor or
>>something similiar?
>>
>>I initialy thought that they are just data so that I
>>can make them into one polyData object by inserting
>>several parts. But I then found out that all I can
>>insert is cells, but not the primitives such as
>>spheres and springs(which is a
>>vtkRotationalExtrusionFilter).
>>
>>Can you help me?
>>Thanks a lot.
>>
>>Shi
>>
>>    
>>
A better way than using vtkAppendPolyData is probably to use 
vtkAssembly. This class is used to group a set of vtkProp3D ( vtkActor 
is derived from vtkProp3D ). That way, if you want to transform all your 
objects togheter, you use vtkAssembly's transform.

Simon Drouin



More information about the vtkusers mailing list