Commit 0e25b4a5 authored by Francois Bertel's avatar Francois Bertel

ENH:Added ForceCompileOnly only ivar to PolyData mappers in order to tell...

ENH:Added ForceCompileOnly only ivar to PolyData mappers in order to tell display lists painters to not execute the display list. This is required to be able to deal with nested display lists calls. In OpenGL, display lists calls can be nested but not their creation.
parent 2ab27967
......@@ -28,7 +28,7 @@
#include "vtkStandardPolyDataPainter.h"
#include "vtkTStripsPainter.h"
vtkCxxRevisionMacro(vtkChooserPainter, "1.5");
vtkCxxRevisionMacro(vtkChooserPainter, "1.6");
vtkStandardNewMacro(vtkChooserPainter);
vtkCxxSetObjectMacro(vtkChooserPainter, VertPainter, vtkPolyDataPainter);
......@@ -289,7 +289,8 @@ vtkPolyDataPainter* vtkChooserPainter::CreatePainter(const char *paintertype)
//-----------------------------------------------------------------------------
void vtkChooserPainter::RenderInternal(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags)
unsigned long typeflags,
bool forceCompileOnly)
{
vtkPolyData* pdInput = this->GetInputAsPolyData();
vtkIdType numVerts = pdInput->GetNumberOfVerts();
......@@ -318,7 +319,8 @@ void vtkChooserPainter::RenderInternal(vtkRenderer* renderer, vtkActor* actor,
{
//cout << this << "Verts" << endl;
this->ProgressScaleFactor = static_cast<double>(numVerts)/total_cells;
this->VertPainter->Render(renderer, actor, vtkPainter::VERTS);
this->VertPainter->Render(renderer, actor, vtkPainter::VERTS,
forceCompileOnly);
this->TimeToDraw += this->VertPainter->GetTimeToDraw();
this->ProgressOffset += this->ProgressScaleFactor;
}
......@@ -327,7 +329,8 @@ void vtkChooserPainter::RenderInternal(vtkRenderer* renderer, vtkActor* actor,
{
//cout << this << "Lines" << endl;
this->ProgressScaleFactor = static_cast<double>(numLines)/total_cells;
this->LinePainter->Render(renderer, actor, vtkPainter::LINES);
this->LinePainter->Render(renderer, actor, vtkPainter::LINES,
forceCompileOnly);
this->TimeToDraw += this->LinePainter->GetTimeToDraw();
this->ProgressOffset += this->ProgressScaleFactor;
}
......@@ -337,7 +340,8 @@ void vtkChooserPainter::RenderInternal(vtkRenderer* renderer, vtkActor* actor,
{
//cout << this << "Polys" << endl;
this->ProgressScaleFactor = static_cast<double>(numPolys)/total_cells;
this->PolyPainter->Render(renderer, actor, vtkPainter::POLYS);
this->PolyPainter->Render(renderer, actor, vtkPainter::POLYS,
forceCompileOnly);
this->TimeToDraw += this->PolyPainter->GetTimeToDraw();
this->ProgressOffset += this->ProgressScaleFactor;
}
......@@ -346,10 +350,11 @@ void vtkChooserPainter::RenderInternal(vtkRenderer* renderer, vtkActor* actor,
{
//cout << this << "Strips" << endl;
this->ProgressScaleFactor = static_cast<double>(numStrips)/total_cells;
this->StripPainter->Render(renderer, actor, vtkPainter::STRIPS);
this->StripPainter->Render(renderer, actor, vtkPainter::STRIPS,
forceCompileOnly);
this->TimeToDraw += this->StripPainter->GetTimeToDraw();
}
this->Superclass::RenderInternal(renderer, actor, typeflags);
this->Superclass::RenderInternal(renderer, actor, typeflags,forceCompileOnly);
}
//-----------------------------------------------------------------------------
......
......@@ -92,7 +92,7 @@ protected:
// DelegatePainter is in sync with this painter i.e. UpdatePainter()
// has been called.
virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags);
unsigned long typeflags, bool forceCompileOnly);
// Description:
// Take part in garbage collection.
......
......@@ -29,7 +29,7 @@
# include "vtkOpenGL.h"
#endif
vtkStandardNewMacro(vtkCompositePainter);
vtkCxxRevisionMacro(vtkCompositePainter, "1.1");
vtkCxxRevisionMacro(vtkCompositePainter, "1.2");
vtkInformationKeyMacro(vtkCompositePainter, COLOR_LEAVES, Integer);
//----------------------------------------------------------------------------
vtkCompositePainter::vtkCompositePainter()
......@@ -64,8 +64,10 @@ vtkDataObject* vtkCompositePainter::GetOutput()
}
//----------------------------------------------------------------------------
void vtkCompositePainter::RenderInternal(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags)
void vtkCompositePainter::RenderInternal(vtkRenderer* renderer,
vtkActor* actor,
unsigned long typeflags,
bool forceCompileOnly)
{
vtkPainterDeviceAdapter* device = renderer->GetRenderWindow()->
GetPainterDeviceAdapter();
......@@ -73,7 +75,8 @@ void vtkCompositePainter::RenderInternal(vtkRenderer* renderer, vtkActor* actor,
vtkCompositeDataSet* input = vtkCompositeDataSet::SafeDownCast(this->GetInput());
if (!input || !this->DelegatePainter)
{
this->Superclass::RenderInternal(renderer, actor, typeflags);
this->Superclass::RenderInternal(renderer, actor, typeflags,
forceCompileOnly);
return;
}
......@@ -117,7 +120,8 @@ void vtkCompositePainter::RenderInternal(vtkRenderer* renderer, vtkActor* actor,
this->DelegatePainter->SetInput(dobj);
this->OutputData = dobj;
this->Superclass::RenderInternal(renderer, actor, typeflags);
this->Superclass::RenderInternal(renderer, actor, typeflags,
forceCompileOnly);
this->OutputData = 0;
}
}
......
......@@ -65,7 +65,7 @@ protected:
// DelegatePainter is in sync with this painter i.e. UpdateDelegatePainter()
// has been called.
virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags);
unsigned long typeflags, bool forceCompileOnly);
vtkSetMacro(ColorLeaves, int);
vtkGetMacro(ColorLeaves, int);
......
......@@ -31,7 +31,7 @@
#include "vtkDefaultPainter.h"
vtkStandardNewMacro(vtkCompositePolyDataMapper2);
vtkCxxRevisionMacro(vtkCompositePolyDataMapper2, "1.2");
vtkCxxRevisionMacro(vtkCompositePolyDataMapper2, "1.3");
//----------------------------------------------------------------------------
vtkCompositePolyDataMapper2::vtkCompositePolyDataMapper2()
{
......@@ -107,7 +107,7 @@ void vtkCompositePolyDataMapper2::RenderPiece(vtkRenderer* ren, vtkActor* act)
{
this->Painter->SetInput(inputDO);
}
this->Painter->Render(ren, act, 0xff);
this->Painter->Render(ren, act, 0xff,this->ForceCompileOnly);
this->TimeToDraw = this->Painter->GetTimeToDraw();
}
......
......@@ -28,7 +28,7 @@
#include "vtkScalarsToColorsPainter.h"
vtkStandardNewMacro(vtkDefaultPainter);
vtkCxxRevisionMacro(vtkDefaultPainter, "1.6");
vtkCxxRevisionMacro(vtkDefaultPainter, "1.7");
vtkCxxSetObjectMacro(vtkDefaultPainter, DefaultPainterDelegate, vtkPainter);
vtkCxxSetObjectMacro(vtkDefaultPainter, ScalarsToColorsPainter,
vtkScalarsToColorsPainter);
......@@ -191,14 +191,14 @@ void vtkDefaultPainter::BuildPainterChain()
}
//-----------------------------------------------------------------------------
void vtkDefaultPainter::Render(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags)
unsigned long typeflags, bool forceCompileOnly)
{
if (this->ChainBuildTime < this->MTime)
{
this->BuildPainterChain();
this->ChainBuildTime.Modified();
}
this->Superclass::Render(renderer, actor, typeflags);
this->Superclass::Render(renderer, actor, typeflags,forceCompileOnly);
}
//-----------------------------------------------------------------------------
......
......@@ -99,7 +99,7 @@ public:
// Building of the chain does not depend on input polydata,
// hence it does not check if the input has changed at all.
virtual void Render(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags);
unsigned long typeflags, bool forceCompileOnly);
// Description:
// Release any graphics resources that are being consumed by this painter.
......
......@@ -22,8 +22,9 @@
// Needed when we don't use the vtkStandardNewMacro.
vtkInstantiatorNewMacro(vtkDisplayListPainter);
vtkCxxRevisionMacro(vtkDisplayListPainter, "1.3");
vtkCxxRevisionMacro(vtkDisplayListPainter, "1.4");
vtkInformationKeyMacro(vtkDisplayListPainter, IMMEDIATE_MODE_RENDERING, Integer);
//----------------------------------------------------------------------------
vtkDisplayListPainter::vtkDisplayListPainter()
{
......@@ -49,6 +50,7 @@ void vtkDisplayListPainter::ProcessInformation(vtkInformation* info)
{
this->SetImmediateModeRendering(info->Get(IMMEDIATE_MODE_RENDERING()));
}
this->Superclass::ProcessInformation(info);
}
......
......@@ -59,6 +59,7 @@ protected:
vtkSetMacro(ImmediateModeRendering,int);
int ImmediateModeRendering;
private:
vtkDisplayListPainter(const vtkDisplayListPainter&); // Not implemented.
void operator=(const vtkDisplayListPainter&); // Not implemented.
......
......@@ -37,7 +37,7 @@
#endif
//-----------------------------------------------------------------------------
vtkCxxRevisionMacro(vtkIdentColoredPainter, "1.24");
vtkCxxRevisionMacro(vtkIdentColoredPainter, "1.25");
vtkStandardNewMacro(vtkIdentColoredPainter);
//-----------------------------------------------------------------------------
......@@ -258,7 +258,8 @@ void vtkIdentColoredPainter::GetCurrentColor(unsigned char *RGB)
//-----------------------------------------------------------------------------
void vtkIdentColoredPainter::RenderInternal(vtkRenderer* renderer,
vtkActor* actor,
unsigned long typeflags)
unsigned long typeflags,
bool forceCompileOnly)
{
if (typeflags == 0)
{
......@@ -342,7 +343,8 @@ void vtkIdentColoredPainter::RenderInternal(vtkRenderer* renderer,
// let the superclass pass on the request to delegate painter.
// Ofcouse, more than likely, this call will never have a delegate,
// but anyways.
this->Superclass::RenderInternal(renderer, actor, typeflags);
this->Superclass::RenderInternal(renderer, actor, typeflags,
forceCompileOnly);
}
//-----------------------------------------------------------------------------
......
......@@ -91,7 +91,7 @@ protected:
~vtkIdentColoredPainter();
virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags);
unsigned long typeflags,bool forceCompileOnly);
void DrawCells(int mode, vtkCellArray *connectivity,
vtkIdType startCellId, vtkRenderer *renderer);
......
......@@ -27,7 +27,7 @@
#include "vtkUnsignedCharArray.h"
vtkStandardNewMacro(vtkLinesPainter);
vtkCxxRevisionMacro(vtkLinesPainter, "1.5");
vtkCxxRevisionMacro(vtkLinesPainter, "1.6");
//-----------------------------------------------------------------------------
vtkLinesPainter::vtkLinesPainter()
{
......@@ -72,7 +72,8 @@ vtkLinesPainter::~vtkLinesPainter()
}
//-----------------------------------------------------------------------------
void vtkLinesPainter::RenderInternal(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags)
unsigned long typeflags,
bool forceCompileOnly)
{
if (typeflags == vtkPainter::POLYS)
{
......@@ -82,7 +83,7 @@ void vtkLinesPainter::RenderInternal(vtkRenderer* renderer, vtkActor* actor,
{
this->RenderPolys = 0;
}
this->Superclass::RenderInternal(renderer, actor, typeflags);
this->Superclass::RenderInternal(renderer, actor, typeflags,forceCompileOnly);
}
//-----------------------------------------------------------------------------
......
......@@ -44,7 +44,7 @@ protected:
// Overriden to set RenderPolys flag. When set, polys are rendered
// as line loops.
virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags);
unsigned long typeflags, bool forceCompileOnly);
// Description:
// The actual rendering happens here. This method is called only when
......
......@@ -22,7 +22,7 @@
#include "vtkPointData.h"
#include "vtkMath.h"
vtkCxxRevisionMacro(vtkMapper, "1.123");
vtkCxxRevisionMacro(vtkMapper, "1.124");
// Initialize static member that controls global immediate mode rendering
static int vtkMapperGlobalImmediateModeRendering = 0;
......@@ -64,6 +64,8 @@ vtkMapper::vtkMapper()
this->InterpolateScalarsBeforeMapping = 0;
this->ColorCoordinates = 0;
this->ColorTextureMap = 0;
this->ForceCompileOnly=0;
}
vtkMapper::~vtkMapper()
......@@ -116,6 +118,16 @@ vtkDataSet *vtkMapper::GetInput()
this->GetExecutive()->GetInputData(0, 0));
}
void vtkMapper::SetForceCompileOnly(int value)
{
if(this->ForceCompileOnly!=value)
{
this->ForceCompileOnly=value;
// make sure we don't call this->Modified();
// this->Modified();
}
}
void vtkMapper::SetGlobalImmediateModeRendering(int val)
{
if (val == vtkMapperGlobalImmediateModeRendering)
......@@ -671,6 +683,10 @@ void vtkMapper::PrintSelf(ostream& os, vtkIndent indent)
os << indent << "Immediate Mode Rendering: "
<< (this->ImmediateModeRendering ? "On\n" : "Off\n");
os << indent << "Force compile only for display lists: "
<< (this->ForceCompileOnly ? "On\n" : "Off\n");
os << indent << "Global Immediate Mode Rendering: " <<
(vtkMapperGlobalImmediateModeRendering ? "On\n" : "Off\n");
......
......@@ -196,6 +196,19 @@ public:
{vtkMapper::SetGlobalImmediateModeRendering(0);};
static int GetGlobalImmediateModeRendering();
//BTX
// Description:
// Force compile only mode in case display lists are used
// (ImmediateModeRendering is false). If ImmediateModeRendering is true,
// no rendering happens. Changing the value of this flag does not change
// modified time of the mapper. Initial value is false.
// This can be used by another rendering class which also uses display lists
// (call of display lists can be nested but not their creation.)
// There is no good reason to expose it to wrappers.
vtkGetMacro(ForceCompileOnly,int);
void SetForceCompileOnly(int value);
//ETX
// Description:
// Control how the filter works with scalar point data and cell attribute
// data. By default (ScalarModeToDefault), the filter will use point data,
......@@ -384,6 +397,8 @@ protected:
int ArrayAccessMode;
int Static;
int ForceCompileOnly;
private:
vtkMapper(const vtkMapper&); // Not implemented.
......
......@@ -27,7 +27,7 @@
#ifndef VTK_IMPLEMENT_MESA_CXX
vtkStandardNewMacro(vtkOpenGLClipPlanesPainter);
vtkCxxRevisionMacro(vtkOpenGLClipPlanesPainter, "1.5");
vtkCxxRevisionMacro(vtkOpenGLClipPlanesPainter, "1.6");
#endif
//-----------------------------------------------------------------------------
vtkOpenGLClipPlanesPainter::vtkOpenGLClipPlanesPainter()
......@@ -40,8 +40,10 @@ vtkOpenGLClipPlanesPainter::~vtkOpenGLClipPlanesPainter()
}
//-----------------------------------------------------------------------------
void vtkOpenGLClipPlanesPainter::RenderInternal(vtkRenderer* renderer,
vtkActor* actor, unsigned long typeflags)
void vtkOpenGLClipPlanesPainter::RenderInternal(vtkRenderer *renderer,
vtkActor *actor,
unsigned long typeflags,
bool forceCompileOnly)
{
vtkPlaneCollection *clipPlanes;
vtkPlane *plane;
......@@ -103,7 +105,7 @@ void vtkOpenGLClipPlanesPainter::RenderInternal(vtkRenderer* renderer,
actorMatrix->Delete();
}
this->Superclass::RenderInternal(renderer, actor, typeflags);
this->Superclass::RenderInternal(renderer, actor, typeflags,forceCompileOnly);
for (i = 0; i < numClipPlanes; i++)
{
......
......@@ -41,7 +41,7 @@ protected:
// Uses the clipping planes to set up clipping regions.
// typeflags are ignored by this painter.
virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags);
unsigned long typeflags, bool forceCompileOnly);
private:
vtkOpenGLClipPlanesPainter(const vtkOpenGLClipPlanesPainter&); // Not implemented.
void operator=(const vtkOpenGLClipPlanesPainter&); // Not implemented.
......
......@@ -26,7 +26,7 @@
#ifndef VTK_IMPLEMENT_MESA_CXX
vtkStandardNewMacro(vtkOpenGLCoincidentTopologyResolutionPainter);
vtkCxxRevisionMacro(vtkOpenGLCoincidentTopologyResolutionPainter,
"1.5");
"1.6");
#endif
//-----------------------------------------------------------------------------
vtkOpenGLCoincidentTopologyResolutionPainter::
......@@ -43,7 +43,10 @@ vtkOpenGLCoincidentTopologyResolutionPainter::
//-----------------------------------------------------------------------------
void vtkOpenGLCoincidentTopologyResolutionPainter::RenderInternal(
vtkRenderer* renderer, vtkActor* actor, unsigned long typeflags)
vtkRenderer *renderer,
vtkActor *actor,
unsigned long typeflags,
bool forceCompileOnly)
{
int resolve=0, zResolve=0;
double zRes = 0.0;
......@@ -74,24 +77,26 @@ void vtkOpenGLCoincidentTopologyResolutionPainter::RenderInternal(
if (!zResolve)
{
this->Superclass::RenderInternal(renderer, actor, typeflags);
this->Superclass::RenderInternal(renderer, actor, typeflags,
forceCompileOnly);
}
else
{
if (typeflags & vtkPainter::VERTS)
{
this->Superclass::RenderInternal(renderer, actor , vtkPainter::VERTS);
this->Superclass::RenderInternal(renderer, actor , vtkPainter::VERTS,
forceCompileOnly);
}
if (typeflags & vtkPainter::LINES || typeflags & vtkPainter::POLYS)
{
glDepthRange(zRes, 1.);
this->Superclass::RenderInternal(renderer, actor, typeflags
& (vtkPainter::LINES | vtkPainter::POLYS));
& (vtkPainter::LINES | vtkPainter::POLYS),forceCompileOnly);
}
if (typeflags & vtkPainter::STRIPS)
{
glDepthRange(2*zRes, 1.);
this->Superclass::RenderInternal(renderer, actor , vtkPainter::STRIPS);
this->Superclass::RenderInternal(renderer, actor , vtkPainter::STRIPS,forceCompileOnly);
}
}
......
......@@ -41,7 +41,7 @@ protected:
// DelegatePainter is in sync with this painter i.e. UpdatePainter()
// has been called.
virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags);
unsigned long typeflags, bool forceCompileOnly);
private:
vtkOpenGLCoincidentTopologyResolutionPainter(
const vtkOpenGLCoincidentTopologyResolutionPainter&); // Not implemented.
......
......@@ -31,7 +31,7 @@
#ifndef VTK_IMPLEMENT_MESA_CXX
vtkStandardNewMacro(vtkOpenGLDisplayListPainter);
vtkCxxRevisionMacro(vtkOpenGLDisplayListPainter, "1.6");
vtkCxxRevisionMacro(vtkOpenGLDisplayListPainter, "1.7");
#endif
//-----------------------------------------------------------------------------
vtkOpenGLDisplayListPainter::vtkOpenGLDisplayListPainter()
......@@ -68,14 +68,20 @@ void vtkOpenGLDisplayListPainter::ReleaseList()
}
//-----------------------------------------------------------------------------
void vtkOpenGLDisplayListPainter::RenderInternal(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags)
void vtkOpenGLDisplayListPainter::RenderInternal(vtkRenderer *renderer,
vtkActor *actor,
unsigned long typeflags,
bool forceCompileOnly)
{
if (this->ImmediateModeRendering)
{
// don't use display lists at all.
this->ReleaseGraphicsResources(renderer->GetRenderWindow());
this->Superclass::RenderInternal(renderer, actor, typeflags);
if(!forceCompileOnly)
{
this->Superclass::RenderInternal(renderer, actor, typeflags,
forceCompileOnly);
}
return;
}
......@@ -94,7 +100,8 @@ void vtkOpenGLDisplayListPainter::RenderInternal(vtkRenderer* renderer, vtkActor
this->DisplayListId = glGenLists(1);
glNewList(this->DisplayListId, GL_COMPILE);
// generate the display list.
this->Superclass::RenderInternal(renderer, actor, typeflags);
this->Superclass::RenderInternal(renderer, actor, typeflags,
forceCompileOnly);
glEndList();
this->BuildTime.Modified();
......@@ -102,17 +109,19 @@ void vtkOpenGLDisplayListPainter::RenderInternal(vtkRenderer* renderer, vtkActor
this->LastUsedTypeFlags = typeflags;
}
// Time the actual drawing.
this->Timer->StartTimer();
// render the display list.
// if nothing has changed we use an old display list else
// we use the newly generated list.
glCallList(this->DisplayListId);
// glFinish(); // To compute time correctly, we need to wait
// till OpenGL finishes.
this->Timer->StopTimer();
this->TimeToDraw += this->Timer->GetElapsedTime();
if(!forceCompileOnly)
{
// Time the actual drawing.
this->Timer->StartTimer();
// render the display list.
// if nothing has changed we use an old display list else
// we use the newly generated list.
glCallList(this->DisplayListId);
// glFinish(); // To compute time correctly, we need to wait
// till OpenGL finishes.
this->Timer->StopTimer();
this->TimeToDraw += this->Timer->GetElapsedTime();
}
}
//-----------------------------------------------------------------------------
......
......@@ -47,7 +47,8 @@ protected:
// If not using ImmediateModeRendering, this will build a display list,
// if outdated and use the display list.
virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags);
unsigned long typeflags,
bool forceCompileOnly);
unsigned long LastUsedTypeFlags;
private:
......
......@@ -28,7 +28,7 @@
#ifndef VTK_IMPLEMENT_MESA_CXX
vtkStandardNewMacro(vtkOpenGLLightingPainter);
vtkCxxRevisionMacro(vtkOpenGLLightingPainter, "1.4");
vtkCxxRevisionMacro(vtkOpenGLLightingPainter, "1.5");
#endif
//-----------------------------------------------------------------------------
......@@ -58,8 +58,10 @@ vtkOpenGLLightingPainter::~vtkOpenGLLightingPainter()
}
//-----------------------------------------------------------------------------
void vtkOpenGLLightingPainter::RenderInternal(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags)
void vtkOpenGLLightingPainter::RenderInternal(vtkRenderer *renderer,
vtkActor *actor,
unsigned long typeflags,
bool forceCompileOnly)
{
vtkPolyData* input = this->GetInputAsPolyData();
vtkProperty* prop = actor->GetProperty();
......@@ -118,7 +120,8 @@ void vtkOpenGLLightingPainter::RenderInternal(vtkRenderer* renderer, vtkActor* a
static_cast<double>(disabled_cells) / total_cells;
glDisable(GL_LIGHTING);
this->Superclass::RenderInternal(renderer, actor, disable_flags);
this->Superclass::RenderInternal(renderer, actor, disable_flags,
forceCompileOnly);
time_to_draw += this->DelegatePainter?
this->DelegatePainter->GetTimeToDraw() : 0;
......@@ -133,7 +136,8 @@ void vtkOpenGLLightingPainter::RenderInternal(vtkRenderer* renderer, vtkActor* a
enable_flags);
this->ProgressScaleFactor =
static_cast<double>(enabled_cells) / total_cells;
this->Superclass::RenderInternal(renderer, actor, enable_flags);
this->Superclass::RenderInternal(renderer, actor, enable_flags,
forceCompileOnly);
time_to_draw += this->DelegatePainter?
this->DelegatePainter->GetTimeToDraw() : 0;
......
......@@ -50,8 +50,10 @@ protected:
// Description:
// Setups lighting state before calling render on delegate
// painter.
virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags);
virtual void RenderInternal(vtkRenderer *renderer,
vtkActor *actor,
unsigned long typeflags,
bool forceCompileOnly);
private:
vtkOpenGLLightingPainter(const vtkOpenGLLightingPainter&); // Not implemented.
......
......@@ -28,7 +28,7 @@
#ifndef VTK_IMPLEMENT_MESA_CXX
vtkStandardNewMacro(vtkOpenGLRepresentationPainter);
vtkCxxRevisionMacro(vtkOpenGLRepresentationPainter, "1.7");
vtkCxxRevisionMacro(vtkOpenGLRepresentationPainter, "1.8");
#endif
//-----------------------------------------------------------------------------
......@@ -42,8 +42,10 @@ vtkOpenGLRepresentationPainter::~vtkOpenGLRepresentationPainter()
}
//-----------------------------------------------------------------------------
void vtkOpenGLRepresentationPainter::RenderInternal(vtkRenderer* renderer,
vtkActor* actor, unsigned long typeflags)
void vtkOpenGLRepresentationPainter::RenderInternal(vtkRenderer *renderer,
vtkActor *actor,
unsigned long typeflags,
bool forceCompileOnly)
{
vtkProperty* prop = actor->GetProperty();
int rep = prop->GetRepresentation();
......@@ -74,7 +76,8 @@ void vtkOpenGLRepresentationPainter::RenderInternal(vtkRenderer* renderer,
break;
}
this->Superclass::RenderInternal(renderer, actor, typeflags);
this->Superclass::RenderInternal(renderer, actor, typeflags,
forceCompileOnly);
this->TimeToDraw += this->DelegatePainter?
this->DelegatePainter->GetTimeToDraw() : 0;
if (reset_needed)
......@@ -103,7 +106,8 @@ void vtkOpenGLRepresentationPainter::RenderInternal(vtkRenderer* renderer,
glDisable(GL_TEXTURE_2D);
this->Information->Set(vtkPolyDataPainter::DISABLE_SCALAR_COLOR(), 1);
this->Superclass::RenderInternal(renderer, actor, typeflags);
this->Superclass::RenderInternal(renderer, actor, typeflags,
forceCompileOnly);
this->TimeToDraw += this->DelegatePainter?
this->DelegatePainter->GetTimeToDraw() : 0;
this->Information->Remove(vtkPolyDataPainter::DISABLE_SCALAR_COLOR());
......
......@@ -50,7 +50,7 @@ protected:
// Description:
// Changes the polygon mode according to the representation.
void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags);
unsigned long typeflags,bool forceCompileOnly);
private:
vtkOpenGLRepresentationPainter(const vtkOpenGLRepresentationPainter&); // Not implemented.
void operator=(const vtkOpenGLRepresentationPainter&); // Not implemented.
......
......@@ -37,7 +37,7 @@
#ifndef VTK_IMPLEMENT_MESA_CXX
vtkStandardNewMacro(vtkOpenGLScalarsToColorsPainter);
vtkCxxRevisionMacro(vtkOpenGLScalarsToColorsPainter, "1.6");
vtkCxxRevisionMacro(vtkOpenGLScalarsToColorsPainter, "1.7");
#endif
//-----------------------------------------------------------------------------
vtkOpenGLScalarsToColorsPainter::vtkOpenGLScalarsToColorsPainter()
......@@ -81,8 +81,10 @@ int vtkOpenGLScalarsToColorsPainter::GetPremultiplyColorsWithAlpha(
}
//-----------------------------------------------------------------------------
void vtkOpenGLScalarsToColorsPainter::RenderInternal(vtkRenderer* renderer,
vtkActor* actor, unsigned long typeflags)
void vtkOpenGLScalarsToColorsPainter::RenderInternal(vtkRenderer *renderer,
vtkActor *actor,
unsigned long typeflags,
bool forceCompileOnly)
{
vtkProperty* prop = actor->GetProperty();
......@@ -164,7 +166,7 @@ void vtkOpenGLScalarsToColorsPainter::RenderInternal(vtkRenderer* renderer,
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
}
this->Superclass::RenderInternal(renderer, actor, typeflags);
this->Superclass::RenderInternal(renderer, actor, typeflags,forceCompileOnly);
if (pre_multiplied_by_alpha)
{
......
......@@ -54,7 +54,7 @@ protected:
// Subclasses may override this method. Default implementation propagates
// the call to Deletegate Painter, in any.
virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags);
unsigned long typeflags,bool forceCompileOnly);
private:
vtkOpenGLScalarsToColorsPainter(const vtkOpenGLScalarsToColorsPainter&); // Not implemented.
......
......@@ -37,7 +37,7 @@
#include "vtkRenderWindow.h"
#include "vtkTimerLog.h"
vtkCxxRevisionMacro(vtkPainter, "1.6");
vtkCxxRevisionMacro(vtkPainter, "1.7");
vtkCxxSetObjectMacro(vtkPainter, Input, vtkDataObject);
vtkCxxSetObjectMacro(vtkPainter, Information, vtkInformation);
vtkInformationKeyMacro(vtkPainter, STATIC_DATA, Integer);
......@@ -190,7 +190,7 @@ void vtkPainter::ReportReferences(vtkGarbageCollector *collector)
//-----------------------------------------------------------------------------
void vtkPainter::Render(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags)
unsigned long typeflags, bool forceCompileOnly)
{
this->TimeToDraw = 0.0;
if (renderer->GetRenderWindow()->CheckAbortStatus())
......@@ -210,17 +210,17 @@ void vtkPainter::Render(vtkRenderer* renderer, vtkActor* actor,
}
this->PrepareForRendering(renderer, actor);
this->RenderInternal(renderer, actor, typeflags);
this->RenderInternal(renderer, actor, typeflags,forceCompileOnly);
}
//-----------------------------------------------------------------------------
void vtkPainter::RenderInternal(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags)