------------------------------------------------------------------------------
| 420 | |
| 421 | //------------------------------------------------------------------------------ |
| 422 | int vtkImageStack::RenderOverlay(vtkViewport* viewport) |
| 423 | { |
| 424 | vtkDebugMacro(<< "vtkImageStack::RenderOverlay"); |
| 425 | |
| 426 | if (!this->IsIdentity) |
| 427 | { |
| 428 | this->PokeMatrices(this->GetMatrix()); |
| 429 | } |
| 430 | |
| 431 | int rendered = 0; |
| 432 | vtkImageSlice* image = nullptr; |
| 433 | vtkCollectionSimpleIterator pit; |
| 434 | vtkIdType n = 0; |
| 435 | this->Images->InitTraversal(pit); |
| 436 | while ((image = this->Images->GetNextImage(pit)) != nullptr) |
| 437 | { |
| 438 | n += (image->GetVisibility() != 0); |
| 439 | } |
| 440 | double renderTime = this->AllocatedRenderTime / (n + (n == 0)); |
| 441 | |
| 442 | if (n == 1) |
| 443 | { |
| 444 | // no multi-pass if only one image |
| 445 | this->Images->InitTraversal(pit); |
| 446 | while ((image = this->Images->GetNextImage(pit)) != nullptr) |
| 447 | { |
| 448 | if (image->GetVisibility()) |
| 449 | { |
| 450 | image->SetAllocatedRenderTime(renderTime, viewport); |
| 451 | rendered = image->RenderOverlay(viewport); |
| 452 | } |
| 453 | } |
| 454 | } |
| 455 | else |
| 456 | { |
| 457 | for (int pass = 1; pass < 3; pass++) |
| 458 | { |
| 459 | this->Images->InitTraversal(pit); |
| 460 | while ((image = this->Images->GetNextImage(pit)) != nullptr) |
| 461 | { |
| 462 | if (image->GetVisibility()) |
| 463 | { |
| 464 | image->SetAllocatedRenderTime(renderTime, viewport); |
| 465 | image->SetStackedImagePass(pass); |
| 466 | rendered |= image->RenderOverlay(viewport); |
| 467 | image->SetStackedImagePass(-1); |
| 468 | } |
| 469 | } |
| 470 | } |
| 471 | } |
| 472 | |
| 473 | if (!this->IsIdentity) |
| 474 | { |
| 475 | this->PokeMatrices(nullptr); |
| 476 | } |
| 477 | |
| 478 | return rendered; |
| 479 | } |
nothing calls this directly
no test coverage detected