How did you add this new vtkPolyData
?
By adding a vtkPolyDataMapper (which contains a vtkPolyData) to an vtkActor, the bounds are aumatically calculated
vtkSphereSource *sphere = vtkSphereSource::New();
sphere->SetRadius(10.0);
sphere->Update();
vtkPolyDataMapper *map = vtkPolyDataMapper::New();
map->SetInputData(sphere->GetOutput());
vtkActor *aSphere = vtkActor::New();
aSphere->SetMapper(map);
std::cout << aSphere->GetBounds ()[0] << " "
<< aSphere->GetBounds ()[1] << std::endl; // print : -10 10
You can compute bounds of several vtkPolyData before using an actor with vtkAppendPolyData
vtkSphereSource *sphere2 = vtkSphereSource::New();
sphere2->SetRadius(10.0);
sphere2->SetCenter (15, 15, 0);
sphere2->Update();
vtkAppendPolyData *app = vtkAppendPolyData::New();
app->AddInputData (sphere->GetOutput ());
app->AddInputData (sphere2->GetOutput ());
app->Update();
std::cout << app->GetOutput()->GetBounds ()[0] << " "
<< app->GetOutput()->GetBounds ()[1] << std::endl; // prints -10 25