------------------------------------------------------------------------------
| 405 | |
| 406 | //------------------------------------------------------------------------------ |
| 407 | std::vector<vtkBoundingBox> vtkNativePartitioningStrategy::GenerateCuts(vtkDataObject* dobj) |
| 408 | { |
| 409 | auto controller = this->GetController(); |
| 410 | const int num_partitions = (controller && this->GetNumberOfPartitions() < 0) |
| 411 | ? controller->GetNumberOfProcesses() |
| 412 | : this->GetNumberOfPartitions(); |
| 413 | auto bbox = vtkDIYUtilities::GetLocalBounds(dobj); |
| 414 | |
| 415 | if (bbox.IsValid()) |
| 416 | { |
| 417 | double xInflate = bbox.GetLength(0) < ::BOUNDING_BOX_LENGTH_TOLERANCE |
| 418 | ? ::BOUNDING_BOX_LENGTH_TOLERANCE |
| 419 | : ::BOUNDING_BOX_INFLATION_RATIO * bbox.GetLength(0); |
| 420 | double yInflate = bbox.GetLength(1) < ::BOUNDING_BOX_LENGTH_TOLERANCE |
| 421 | ? ::BOUNDING_BOX_LENGTH_TOLERANCE |
| 422 | : ::BOUNDING_BOX_INFLATION_RATIO * bbox.GetLength(1); |
| 423 | double zInflate = bbox.GetLength(2) < ::BOUNDING_BOX_LENGTH_TOLERANCE |
| 424 | ? ::BOUNDING_BOX_LENGTH_TOLERANCE |
| 425 | : ::BOUNDING_BOX_INFLATION_RATIO * bbox.GetLength(2); |
| 426 | bbox.Inflate(xInflate, yInflate, zInflate); |
| 427 | } |
| 428 | |
| 429 | double bds[6]; |
| 430 | bbox.GetBounds(bds); |
| 431 | return vtkDIYKdTreeUtilities::GenerateCuts( |
| 432 | dobj, std::max(1, num_partitions), /*use_cell_centers=*/true, controller, bds); |
| 433 | } |
| 434 | |
| 435 | //------------------------------------------------------------------------------ |
| 436 | std::vector<vtkBoundingBox> vtkNativePartitioningStrategy::ExpandCuts( |
no test coverage detected