actor.getMapper().getInputData() as I saw.
// Now we retrieve the source object from vtkActor reversely,
// meaning we don't use the spheresource object we instantiated
// above directly,
// instead we retrieve a reference to the spheresource through the
// An advantage of this concept might be that we don't need to
// maintain the source object anymore
// in a more complex application.
// To demonstrate that we can modify properties of the spheresource
// through this reference
// beside changing some properties of the actor (in this example we
// change actor's x-position),
// we change the radius of the spheresource as well.
// next two lines are the core lines for reverse access
vtkSmartPointer<vtkAlgorithm> algorithm =
vtkSmartPointer<vtkSphereSource> srcReference =
float origRadius = srcReference->GetRadius();
for (int i = 0; i < 360; ++i)
// change radius of the spheresource
srcReference->SetRadius(origRadius * (1 + sin((float)i/180.0 * vtkMath::Pi())));
// change x-position of the actor
sphereActor->SetPosition(sin((float)i/45.0 * vtkMath::Pi())*0.5, 0, 0);
// Thanks to the usage of vtkSmartPointer there is no explicit need
// to free any objects at this point.