------------------------------------------------------------------------------
| 363 | |
| 364 | //------------------------------------------------------------------------------ |
| 365 | bool vtkNativePartitioningStrategy::InitializeCuts(vtkDataObjectTree* input) |
| 366 | { |
| 367 | if (!(vtkPartitionedDataSet::SafeDownCast(input) || |
| 368 | vtkPartitionedDataSetCollection::SafeDownCast(input))) |
| 369 | { |
| 370 | vtkErrorMacro("Input must be a PartitionedDataSet or PartitionedDataSetCollection"); |
| 371 | return false; |
| 372 | } |
| 373 | |
| 374 | auto comm = vtkDIYUtilities::GetCommunicator(this->Controller); |
| 375 | auto gbounds = ::GetGlobalBounds(input, comm); |
| 376 | |
| 377 | // Step 1: |
| 378 | // Generate cuts (or use existing cuts). |
| 379 | if (this->UseExplicitCuts && this->ExpandExplicitCuts && gbounds.IsValid()) |
| 380 | { |
| 381 | auto bbox = gbounds; |
| 382 | double xInflate = bbox.GetLength(0) < ::BOUNDING_BOX_LENGTH_TOLERANCE |
| 383 | ? ::BOUNDING_BOX_LENGTH_TOLERANCE |
| 384 | : ::BOUNDING_BOX_INFLATION_RATIO * bbox.GetLength(0); |
| 385 | double yInflate = bbox.GetLength(1) < ::BOUNDING_BOX_LENGTH_TOLERANCE |
| 386 | ? ::BOUNDING_BOX_LENGTH_TOLERANCE |
| 387 | : ::BOUNDING_BOX_INFLATION_RATIO * bbox.GetLength(1); |
| 388 | double zInflate = bbox.GetLength(2) < ::BOUNDING_BOX_LENGTH_TOLERANCE |
| 389 | ? ::BOUNDING_BOX_LENGTH_TOLERANCE |
| 390 | : ::BOUNDING_BOX_INFLATION_RATIO * bbox.GetLength(2); |
| 391 | bbox.Inflate(xInflate, yInflate, zInflate); |
| 392 | |
| 393 | this->Cuts = vtkNativePartitioningStrategy::ExpandCuts(this->ExplicitCuts, bbox); |
| 394 | } |
| 395 | else if (this->UseExplicitCuts) |
| 396 | { |
| 397 | this->Cuts = this->ExplicitCuts; |
| 398 | } |
| 399 | else |
| 400 | { |
| 401 | this->Cuts = this->GenerateCuts(input); |
| 402 | } |
| 403 | return true; |
| 404 | } |
| 405 | |
| 406 | //------------------------------------------------------------------------------ |
| 407 | std::vector<vtkBoundingBox> vtkNativePartitioningStrategy::GenerateCuts(vtkDataObject* dobj) |
no test coverage detected