Commit 158d5346 authored by David Gobbi's avatar David Gobbi
Browse files

ENH: Add timestamp check on quality adjustment.

If a high-res texture is already loaded and if it will not have to
be re-loaded during the render, then keep it rather than forcing
generation of a low-res texture during interactive renders.
parent 118cf7e4
......@@ -120,7 +120,8 @@ void vtkImageResliceMapper::Render(vtkRenderer *ren, vtkImageSlice *prop)
int *isize = this->GetInput()->GetDimensions();
int maxisize = (isize[0] > isize[1] ? isize[0] : isize[1]);
maxisize = (isize[2] > maxisize ? isize[2] : maxisize);
if (maxisize <= maxrsize && maxisize <= 1024)
if (maxisize <= maxrsize && maxisize <= 1024 &&
prop->GetRedrawMTime() > this->SliceMapper->LoadTime)
{
this->InternalResampleToScreenPixels =
(prop->GetAllocatedRenderTime() >= 1.0);
......
......@@ -160,6 +160,7 @@ protected:
unsigned char *data, int xsize, int ysize,
const double imageSpacing[3], vtkImageProperty *property);
vtkTimeStamp LoadTime;
int SliceNumber;
int SliceNumberMinValue;
int SliceNumberMaxValue;
......
......@@ -92,7 +92,6 @@ protected:
// Check various OpenGL capabilities
void CheckOpenGLCapabilities(vtkOpenGLRenderWindow *renWin);
vtkTimeStamp LoadTime;
long Index; // OpenGL ID for texture or display list
long FragmentShaderIndex; // OpenGL ID for fragment shader
vtkRenderWindow *RenderWindow; // RenderWindow used for previous render
......
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