27 vtkInformationVector **inputVector,
28 vtkInformationVector *outputVector) {
29 auto input = vtkDataObject::GetData(inputVector[0], 0);
31 double bounds[6] = {0, 0, 0, 0, 0, 0};
32 if(input->IsA(
"vtkMultiBlockDataSet")) {
33 auto inputAsMB = vtkMultiBlockDataSet::SafeDownCast(input);
34 inputAsMB->GetBounds(bounds);
35 }
else if(input->IsA(
"vtkDataSet")) {
36 auto inputAsDS = vtkDataSet::SafeDownCast(input);
37 inputAsDS->GetBounds(bounds);
39 this->
printErr(
"Unable to compute bounding box of "
40 + std::string(input->GetClassName()));
44 double const dx = bounds[1] - bounds[0];
45 double const dy = bounds[3] - bounds[2];
46 double const dz = bounds[5] - bounds[4];
48 this->
SetRadius(this->Scale * std::sqrt(dx * dx + dy * dy + dz * dz) / 2.0);
50 bounds[0] + dx * 0.5, bounds[2] + dy * 0.5, bounds[4] + dz * 0.5);