Commit a8976cc0 authored by David Gobbi's avatar David Gobbi
Browse files

BUG: Need to propagate AllocatedRenderTime to children.

parent 7fe8069d
......@@ -280,12 +280,15 @@ int vtkImageStack::RenderOpaqueGeometry(vtkViewport* viewport)
int rendered = 0;
vtkImageSlice *image = 0;
vtkCollectionSimpleIterator pit;
vtkIdType n = this->Images->GetNumberOfItems();
double renderTime = this->AllocatedRenderTime/(n + (n == 0));
if (this->Images->GetNumberOfItems() == 1)
if (n == 1)
{
// no multi-pass if only one image
this->Images->InitTraversal(pit);
image = this->Images->GetNextImage(pit);
image->SetAllocatedRenderTime(renderTime, viewport);
return image->RenderOpaqueGeometry(viewport);
}
......@@ -294,6 +297,7 @@ int vtkImageStack::RenderOpaqueGeometry(vtkViewport* viewport)
this->Images->InitTraversal(pit);
while ( (image = this->Images->GetNextImage(pit)) != 0)
{
image->SetAllocatedRenderTime(renderTime, viewport);
image->SetStackedImagePass(pass);
rendered |= image->RenderOpaqueGeometry(viewport);
image->SetStackedImagePass(-1);
......@@ -321,11 +325,14 @@ int vtkImageStack::RenderTranslucentPolygonalGeometry(vtkViewport* viewport)
int rendered = 0;
vtkImageSlice *image = 0;
vtkCollectionSimpleIterator pit;
vtkIdType n = this->Images->GetNumberOfItems();
double renderTime = this->AllocatedRenderTime/(n + (n == 0));
if (this->Images->GetNumberOfItems() == 1)
if (n == 1)
{
// no multi-pass if only one image
this->Images->InitTraversal(pit);
image->SetAllocatedRenderTime(renderTime, viewport);
image = this->Images->GetNextImage(pit);
return image->RenderTranslucentPolygonalGeometry(viewport);
}
......@@ -335,6 +342,7 @@ int vtkImageStack::RenderTranslucentPolygonalGeometry(vtkViewport* viewport)
this->Images->InitTraversal(pit);
while ( (image = this->Images->GetNextImage(pit)) != 0)
{
image->SetAllocatedRenderTime(renderTime, viewport);
image->SetStackedImagePass(pass);
rendered |= image->RenderTranslucentPolygonalGeometry(viewport);
image->SetStackedImagePass(-1);
......@@ -362,11 +370,14 @@ int vtkImageStack::RenderOverlay(vtkViewport* viewport)
int rendered = 0;
vtkImageSlice *image = 0;
vtkCollectionSimpleIterator pit;
vtkIdType n = this->Images->GetNumberOfItems();
double renderTime = this->AllocatedRenderTime/(n + (n == 0));
if (this->Images->GetNumberOfItems() == 1)
if (n == 1)
{
// no multi-pass if only one image
this->Images->InitTraversal(pit);
image->SetAllocatedRenderTime(renderTime, viewport);
image = this->Images->GetNextImage(pit);
return image->RenderOverlay(viewport);
}
......@@ -376,6 +387,7 @@ int vtkImageStack::RenderOverlay(vtkViewport* viewport)
this->Images->InitTraversal(pit);
while ( (image = this->Images->GetNextImage(pit)) != 0)
{
image->SetAllocatedRenderTime(renderTime, viewport);
image->SetStackedImagePass(pass);
rendered |= image->RenderOverlay(viewport);
image->SetStackedImagePass(-1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment