Commit 38ac8490 authored by David C. Lonie's avatar David C. Lonie
Browse files

Add a DrawColorBar property to vtkScalarBar.

This is used in paraview while exporting a scene with GL2PS.

Change-Id: I5ecd89dc5585a28323a521ca6cd4efd89a473314
parent dd736dc2
......@@ -318,7 +318,7 @@ int vtkScalarBarActor::RenderOverlay(vtkViewport *viewport)
renderedSomething += this->FrameActor->RenderOverlay(viewport);
}
if (this->UseOpacity)
if (this->UseOpacity && this->DrawColorBar)
{
this->Texture->Render(vtkRenderer::SafeDownCast(viewport));
renderedSomething += this->TextureActor->RenderOverlay(viewport);
......@@ -333,7 +333,10 @@ int vtkScalarBarActor::RenderOverlay(vtkViewport *viewport)
// Draw either the scalar bar (non-indexed mode) or the annotated value boxes (indexed mode).
if ( ! this->LookupTable->GetIndexedLookup() )
{
this->ScalarBarActor->RenderOverlay(viewport);
if (this->DrawColorBar)
{
this->ScalarBarActor->RenderOverlay(viewport);
}
if( this->TextActors == NULL)
{
......@@ -346,7 +349,7 @@ int vtkScalarBarActor::RenderOverlay(vtkViewport *viewport)
renderedSomething += this->TextActors[i]->RenderOverlay(viewport);
}
}
else
else if (this->DrawColorBar)
{
this->AnnotationBoxesActor->RenderOverlay(viewport);
}
......@@ -905,7 +908,10 @@ int vtkScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
// Draw either the scalar bar (non-indexed mode) or the annotated value boxes (indexed mode).
if ( ! this->LookupTable->GetIndexedLookup() )
{
this->ScalarBarActor->RenderOpaqueGeometry(viewport);
if (this->DrawColorBar)
{
this->ScalarBarActor->RenderOpaqueGeometry(viewport);
}
for (i=0; i<this->NumberOfLabels; i++)
{
renderedSomething += this->TextActors[i]->RenderOpaqueGeometry(viewport);
......@@ -913,7 +919,10 @@ int vtkScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
}
else
{
this->AnnotationBoxesActor->RenderOpaqueGeometry( viewport );
if (this->DrawColorBar)
{
this->AnnotationBoxesActor->RenderOpaqueGeometry( viewport );
}
if ( this->DrawAnnotations )
{
if ( this->NumberOfAnnotationLabelsBuilt )
......
......@@ -229,6 +229,13 @@ public:
vtkGetMacro( DrawFrame, int );
vtkBooleanMacro( DrawFrame, int );
// Description:
// Set/Get whether the color bar should be drawn. If off, only the tickmarks
// and text will be drawn. Default is on.
vtkSetMacro( DrawColorBar, bool );
vtkGetMacro( DrawColorBar, bool );
vtkBooleanMacro( DrawColorBar, bool );
// Description:
// Set/Get the background property.
virtual void SetBackgroundProperty(vtkProperty2D *p);
......@@ -302,6 +309,7 @@ protected:
int DrawBackground; // off by default
int DrawFrame; // off by default
bool DrawColorBar; // on by default
vtkPolyData *Background;
vtkPolyDataMapper2D *BackgroundMapper;
......
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