------------------------------------------------------------------------------
| 360 | |
| 361 | //------------------------------------------------------------------------------ |
| 362 | int vtkImageStack::RenderTranslucentPolygonalGeometry(vtkViewport* viewport) |
| 363 | { |
| 364 | vtkDebugMacro(<< "vtkImageStack::RenderTranslucentPolygonalGeometry"); |
| 365 | |
| 366 | if (!this->IsIdentity) |
| 367 | { |
| 368 | this->PokeMatrices(this->GetMatrix()); |
| 369 | } |
| 370 | |
| 371 | int rendered = 0; |
| 372 | vtkImageSlice* image = nullptr; |
| 373 | vtkCollectionSimpleIterator pit; |
| 374 | vtkIdType n = 0; |
| 375 | this->Images->InitTraversal(pit); |
| 376 | while ((image = this->Images->GetNextImage(pit)) != nullptr) |
| 377 | { |
| 378 | n += (image->GetVisibility() != 0); |
| 379 | } |
| 380 | double renderTime = this->AllocatedRenderTime / (n + (n == 0)); |
| 381 | |
| 382 | if (n == 1) |
| 383 | { |
| 384 | // no multi-pass if only one image |
| 385 | this->Images->InitTraversal(pit); |
| 386 | while ((image = this->Images->GetNextImage(pit)) != nullptr) |
| 387 | { |
| 388 | if (image->GetVisibility()) |
| 389 | { |
| 390 | image->SetAllocatedRenderTime(renderTime, viewport); |
| 391 | rendered = image->RenderTranslucentPolygonalGeometry(viewport); |
| 392 | } |
| 393 | } |
| 394 | } |
| 395 | else |
| 396 | { |
| 397 | for (int pass = 1; pass < 3; pass++) |
| 398 | { |
| 399 | this->Images->InitTraversal(pit); |
| 400 | while ((image = this->Images->GetNextImage(pit)) != nullptr) |
| 401 | { |
| 402 | if (image->GetVisibility()) |
| 403 | { |
| 404 | image->SetAllocatedRenderTime(renderTime, viewport); |
| 405 | image->SetStackedImagePass(pass); |
| 406 | rendered |= image->RenderTranslucentPolygonalGeometry(viewport); |
| 407 | image->SetStackedImagePass(-1); |
| 408 | } |
| 409 | } |
| 410 | } |
| 411 | } |
| 412 | |
| 413 | if (!this->IsIdentity) |
| 414 | { |
| 415 | this->PokeMatrices(nullptr); |
| 416 | } |
| 417 | |
| 418 | return rendered; |
| 419 | } |
nothing calls this directly
no test coverage detected