Help with using vtkTransform collections as vtkAssembly
I am having quite a bit of trouble getting the hang of using the
vtkTransform class and am in desperate need of help. I am trying to
transform a set of vtkTransformCollections to behave in the same manner
as vtkAssembly. vtkAssembly is not adequate for my purposes as it only
transforms things in the visualisation pipeline and will not actually
transform the data set. So I am using vtkTransformPolyDataFilter for
this purpose. Some of my Transforms are being shared by different
TransformCollections and I suspect this is the cause of the strange
behaviour I am getting but I do not know how to go about fixing it.
I have two TransformCollections the first entailing transforms 1, 2, 3,
and 4 and the second entailing transforms 3, and 4. I want the first
collection to rotate about the center of the source (vtkSphereSource)
associated with transform 1 and the second collection to rotate about
the center of the source (another vtkSphereSource) associated with
transform 3. To get the same effect as a vtkAssembly I shift all the
transforms in each collection to the desired center do my rotation and
then shift them back again.
The first time I apply these instructions to each collection I get the
desired behaviour with each collection rotating the correct amount and
around the specified center. But on subsequent moves only the second
collection (with transforms 3 and 4) rotates around the correct center.
In the case of the first collection (with all four transforms)
transforms 1 and 2 rotate around the right center but the 3rd and 4th
transforms (the ones shared between the two collections) start shifting
and seperating from their group as they rotate with the other two
Can anyone please tell me why this is happening and how I should go
about stopping this from happening? I enclose my code below.