Commit abf59cdb authored by Mathieu Westphal's avatar Mathieu Westphal
Browse files

Scalar bar features

1. Add finer Annotations control
Annotations in scalar bar now have a it's own Text Property, allowing change to font, color, size...

2. Add positibility to dislay Above/below ranges
Scalar now have the possibility to display a dwatch for above and below value,
to be used in conjonction with vtkLookupTable Above and Below feature

3. Allow to use unconstrained font Size for label annotations and titles
Title and other scalar bar texts used to be constrained by the scalar size
by using this feature, it is now possible to have text of any size without resctriction
parent 7416f8dc
Pipeline #7758 passed with stage
......@@ -100,6 +100,7 @@ int TestGL2PSScalarBar( int argc, char *argv[] )
scalarBar1->SetTextPositionToPrecedeScalarBar();
scalarBar1->GetTitleTextProperty()->SetColor( 0., 0., 1. );
scalarBar1->GetLabelTextProperty()->SetColor( 0., 0., 1. );
scalarBar1->GetAnnotationTextProperty()->SetColor( 0., 0., 1. );
scalarBar1->SetDrawFrame( 1 );
scalarBar1->GetFrameProperty()->SetColor( 0., 0., 0. );
scalarBar1->SetDrawBackground( 1 );
......
......@@ -22,6 +22,7 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
TestPieChartActor.cxx
TestPolarAxes.cxx
TestScalarBar.cxx
TestScalarBarAboveBelow.cxx
TestSpiderPlotActor.cxx
TestCubeAxesOrientedBoundingBox.cxx
TestCubeAxesIntersectionPoint.cxx
......
......@@ -98,6 +98,7 @@ int TestScalarBar( int argc, char *argv[] )
scalarBar1->SetTextPositionToPrecedeScalarBar();
scalarBar1->GetTitleTextProperty()->SetColor( 0., 0., 1. );
scalarBar1->GetLabelTextProperty()->SetColor( 0., 0., 1. );
scalarBar1->GetAnnotationTextProperty()->SetColor( 0., 0., 1. );
scalarBar1->SetDrawFrame( 1 );
scalarBar1->GetFrameProperty()->SetColor( 0., 0., 0. );
scalarBar1->SetDrawBackground( 1 );
......
/*=========================================================================
Program: Visualization Toolkit
Module: TestScalarBarAboveBelow.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkCellData.h"
#include "vtkDoubleArray.h"
#include "vtkLookupTable.h"
#include "vtkNew.h"
#include "vtkPlaneSource.h"
#include "vtkPolyDataMapper.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderer.h"
#include "vtkScalarBarActor.h"
int TestScalarBarAboveBelow(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
{
int resolution = 3;
vtkNew<vtkPlaneSource> plane;
plane->SetXResolution(resolution);
plane->SetYResolution(resolution);
vtkNew<vtkDoubleArray> cellData;
for (int i = 0; i < resolution * resolution; i++)
{
cellData->InsertNextValue(i);
}
plane->Update(); // Force an update so we can set cell data
plane->GetOutput()->GetCellData()->SetScalars(cellData.Get());
vtkNew<vtkPolyDataMapper> mapper;
mapper->SetInputConnection(plane->GetOutputPort());
mapper->SetScalarRange(1, 7);
vtkNew<vtkActor> actor;
actor->SetMapper(mapper.Get());
vtkScalarsToColors* stc = mapper->GetLookupTable();
vtkLookupTable* lut = vtkLookupTable::SafeDownCast(stc);
lut->SetUseBelowRangeColor(true);
lut->SetUseAboveRangeColor(true);
lut->SetNumberOfColors(7);
vtkNew<vtkScalarBarActor> scalarBar;
scalarBar->SetLookupTable(stc);
scalarBar->SetDrawBelowRangeSwatch(true);
scalarBar->SetDrawAboveRangeSwatch(true);
vtkNew<vtkScalarBarActor> scalarBar2;
scalarBar2->SetLookupTable(stc);
scalarBar2->SetDrawBelowRangeSwatch(true);
scalarBar2->SetOrientationToHorizontal();
scalarBar2->SetWidth(0.5);
scalarBar2->SetHeight(0.15);
scalarBar2->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
scalarBar2->GetPositionCoordinate()->SetValue(.05, .8);
vtkNew<vtkScalarBarActor> scalarBar3;
scalarBar3->SetLookupTable(stc);
scalarBar3->SetDrawAboveRangeSwatch(true);
scalarBar3->SetOrientationToHorizontal();
scalarBar3->SetWidth(0.5);
scalarBar3->SetHeight(0.15);
scalarBar3->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
scalarBar3->GetPositionCoordinate()->SetValue(.05, .2);
vtkNew<vtkRenderer> renderer;
vtkNew<vtkRenderWindow> renderWindow;
renderWindow->AddRenderer(renderer.Get());
vtkNew<vtkRenderWindowInteractor> renderWindowInteractor;
renderWindowInteractor->SetRenderWindow(renderWindow.Get());
renderer->AddActor(actor.Get());
renderer->AddActor(scalarBar.Get());
renderer->AddActor(scalarBar2.Get());
renderer->AddActor(scalarBar3.Get());
renderer->SetBackground(.5, .5, .5);
renderWindow->SetMultiSamples(0);
renderWindow->Render();
renderWindowInteractor->Start();
return EXIT_SUCCESS;
}
243828cd3f3c307e1ce2a652ffe163e7
4026c990e1f710d2b54e7c89515948ee
......@@ -18,17 +18,21 @@
#include "vtkCellArray.h"
#include "vtkCellData.h"
#include "vtkColor.h"
#include "vtkColorTransferFunction.h"
#include "vtkCoordinate.h"
#include "vtkFloatArray.h"
#include "vtkPointData.h"
#include "vtkImageData.h"
#include "vtkLookupTable.h"
#include "vtkMath.h"
#include "vtkMathTextUtilities.h"
#include "vtkNew.h"
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
#include "vtkPolyData.h"
#include "vtkPolyDataMapper2D.h"
#include "vtkProperty2D.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderer.h"
#include "vtkScalarsToColors.h"
#include "vtkSmartPointer.h"
#include "vtkTextActor.h"
......@@ -37,7 +41,6 @@
#include "vtkTexturedActor2D.h"
#include "vtkViewport.h"
#include "vtkWindow.h"
#include "vtkMathTextUtilities.h"
#include <vector>
#include <set>
......@@ -55,11 +58,12 @@
vtkStandardNewMacro(vtkScalarBarActor);
vtkCxxSetObjectMacro(vtkScalarBarActor,LookupTable,vtkScalarsToColors);
vtkCxxSetObjectMacro(vtkScalarBarActor,LabelTextProperty,vtkTextProperty);
vtkCxxSetObjectMacro(vtkScalarBarActor,TitleTextProperty,vtkTextProperty);
vtkCxxSetObjectMacro(vtkScalarBarActor,BackgroundProperty,vtkProperty2D);
vtkCxxSetObjectMacro(vtkScalarBarActor,FrameProperty,vtkProperty2D);
vtkCxxSetObjectMacro(vtkScalarBarActor, LookupTable, vtkScalarsToColors);
vtkCxxSetObjectMacro(vtkScalarBarActor, AnnotationTextProperty, vtkTextProperty);
vtkCxxSetObjectMacro(vtkScalarBarActor, LabelTextProperty, vtkTextProperty);
vtkCxxSetObjectMacro(vtkScalarBarActor, TitleTextProperty, vtkTextProperty);
vtkCxxSetObjectMacro(vtkScalarBarActor, BackgroundProperty, vtkProperty2D);
vtkCxxSetObjectMacro(vtkScalarBarActor, FrameProperty, vtkProperty2D);
//----------------------------------------------------------------------------
// Instantiate object with 64 maximum colors; 5 labels; %%-#6.3g label
......@@ -72,7 +76,7 @@ vtkScalarBarActor::vtkScalarBarActor()
this->Position2Coordinate->SetValue(0.17, 0.8);
this->PositionCoordinate->SetCoordinateSystemToNormalizedViewport();
this->PositionCoordinate->SetValue(0.82,0.1);
this->PositionCoordinate->SetValue(0.82, 0.1);
this->TextPad = 1;
this->TitleRatio = 0.5;
......@@ -92,11 +96,18 @@ vtkScalarBarActor::vtkScalarBarActor()
this->LabelTextProperty->SetShadow(1);
this->LabelTextProperty->SetFontFamilyToArial();
this->AnnotationTextProperty = vtkTextProperty::New();
this->AnnotationTextProperty->SetFontSize(12);
this->AnnotationTextProperty->SetBold(1);
this->AnnotationTextProperty->SetItalic(1);
this->AnnotationTextProperty->SetShadow(1);
this->AnnotationTextProperty->SetFontFamilyToArial();
this->TitleTextProperty = vtkTextProperty::New();
this->TitleTextProperty->ShallowCopy(this->LabelTextProperty);
this->LabelFormat = new char[8];
sprintf(this->LabelFormat,"%s","%-#6.3g");
sprintf(this->LabelFormat, "%s", "%-#6.3g");
this->TitleActor = vtkTextActor::New();
this->TitleActor->GetPositionCoordinate()->
......@@ -128,6 +139,28 @@ vtkScalarBarActor::vtkScalarBarActor()
this->P->NanSwatchActor->GetPositionCoordinate()->
SetReferenceCoordinate(this->PositionCoordinate);
this->DrawBelowRangeSwatch = false;
this->BelowRangeAnnotation = 0;
this->SetBelowRangeAnnotation("Below");
this->P->BelowRangeSwatch = vtkPolyData::New();
this->P->BelowRangeSwatchMapper = vtkPolyDataMapper2D::New();
this->P->BelowRangeSwatchActor = vtkActor2D::New();
this->P->BelowRangeSwatchMapper->SetInputData(this->P->BelowRangeSwatch);
this->P->BelowRangeSwatchActor->SetMapper(this->P->BelowRangeSwatchMapper);
this->P->BelowRangeSwatchActor->GetPositionCoordinate()->
SetReferenceCoordinate(this->PositionCoordinate);
this->DrawAboveRangeSwatch = false;
this->AboveRangeAnnotation = 0;
this->SetAboveRangeAnnotation("Above");
this->P->AboveRangeSwatch = vtkPolyData::New();
this->P->AboveRangeSwatchMapper = vtkPolyDataMapper2D::New();
this->P->AboveRangeSwatchActor = vtkActor2D::New();
this->P->AboveRangeSwatchMapper->SetInputData(this->P->AboveRangeSwatch);
this->P->AboveRangeSwatchActor->SetMapper(this->P->AboveRangeSwatchMapper);
this->P->AboveRangeSwatchActor->GetPositionCoordinate()->
SetReferenceCoordinate(this->PositionCoordinate);
this->AnnotationLeaderPadding = 8.;
this->P->AnnotationBoxes = vtkPolyData::New();
this->P->AnnotationBoxesMapper = vtkPolyDataMapper2D::New();
......@@ -165,10 +198,10 @@ vtkScalarBarActor::vtkScalarBarActor()
vtkFloatArray* tc = vtkFloatArray::New();
tc->SetNumberOfComponents(2);
tc->SetNumberOfTuples(4);
tc->InsertComponent(0,0, 0.0);
tc->InsertComponent(0,1, 0.0);
tc->InsertComponent(1,1, 0.0);
tc->InsertComponent(3,0, 0.0);
tc->InsertComponent(0, 0, 0.0);
tc->InsertComponent(0, 1, 0.0);
tc->InsertComponent(1, 1, 0.0);
tc->InsertComponent(3, 0, 0.0);
this->TexturePolyData->GetPointData()->SetTCoords(tc);
tc->Delete();
......@@ -198,13 +231,13 @@ vtkScalarBarActor::vtkScalarBarActor()
static_cast<unsigned char*>(image->GetScalarPointer(0, y, 0));
for (unsigned int x = 0; x < dim; x++)
{
*ptr = ((x == y) || (x == (dim-y-1))) ? 255 : 0;
*ptr = ((x == y) || (x == (dim - y - 1))) ? 255 : 0;
++ptr;
}
}
this->Texture = vtkTexture::New();
this->Texture->SetInputData( image );
this->Texture->SetInputData(image);
this->Texture->RepeatOn();
this->TextureActor->SetTexture(this->Texture);
image->Delete();
......@@ -241,8 +274,9 @@ vtkScalarBarActor::vtkScalarBarActor()
this->FrameActor->GetPositionCoordinate()
->SetReferenceCoordinate(this->PositionCoordinate);
this->DrawColorBar = true;
this->DrawTickLabels = true;
this->DrawColorBar = 1;
this->DrawTickLabels = 1;
this->UnconstrainedFontSize = false;
}
//----------------------------------------------------------------------------
......@@ -256,19 +290,21 @@ void vtkScalarBarActor::ReleaseGraphicsResources(vtkWindow* win)
{
vtkScalarBarActorInternal::ActorVector::iterator it;
for (
it = this->P->TextActors.begin();
it != this->P->TextActors.end();
++it)
it = this->P->TextActors.begin();
it != this->P->TextActors.end();
++it)
{
(*it)->ReleaseGraphicsResources(win);
}
}
for (vtkScalarBarActorInternal::ActorVector::size_type i = 0; i < this->P->AnnotationLabels.size(); ++ i )
for (size_t i = 0; i < this->P->AnnotationLabels.size(); ++i)
{
this->P->AnnotationLabels[i]->ReleaseGraphicsResources(win);
}
this->ScalarBarActor->ReleaseGraphicsResources(win);
this->P->NanSwatchActor->ReleaseGraphicsResources(win);
this->P->AboveRangeSwatchActor->ReleaseGraphicsResources(win);
this->P->BelowRangeSwatchActor->ReleaseGraphicsResources(win);
this->P->AnnotationBoxesActor->ReleaseGraphicsResources(win);
this->P->AnnotationLeadersActor->ReleaseGraphicsResources(win);
this->BackgroundActor->ReleaseGraphicsResources(win);
......@@ -299,14 +335,22 @@ vtkScalarBarActor::~vtkScalarBarActor()
this->TitleActor->Delete();
this->SetNanAnnotation(NULL);
this->SetBelowRangeAnnotation(NULL);
this->SetAboveRangeAnnotation(NULL);
this->ScalarBar->Delete();
this->ScalarBarMapper->Delete();
this->ScalarBarActor->Delete();
this->P->NanSwatch->Delete();
this->P->BelowRangeSwatch->Delete();
this->P->AboveRangeSwatch->Delete();
this->P->NanSwatchMapper->Delete();
this->P->AboveRangeSwatchMapper->Delete();
this->P->BelowRangeSwatchMapper->Delete();
this->P->NanSwatchActor->Delete();
this->P->AboveRangeSwatchActor->Delete();
this->P->BelowRangeSwatchActor->Delete();
this->P->AnnotationBoxes->Delete();
this->P->AnnotationBoxesMapper->Delete();
......@@ -323,6 +367,7 @@ vtkScalarBarActor::~vtkScalarBarActor()
this->ComponentTitle = NULL;
this->SetLookupTable(NULL);
this->SetAnnotationTextProperty(NULL);
this->SetLabelTextProperty(NULL);
this->SetTitleTextProperty(NULL);
this->Texture->Delete();
......@@ -401,6 +446,18 @@ int vtkScalarBarActor::RenderOverlay(vtkViewport* viewport)
this->P->NanSwatchActor->RenderOverlay(viewport);
}
if (this->DrawBelowRangeSwatch)
{
renderedSomething +=
this->P->BelowRangeSwatchActor->RenderOverlay(viewport);
}
if (this->DrawAboveRangeSwatch)
{
renderedSomething +=
this->P->AboveRangeSwatchActor->RenderOverlay(viewport);
}
if (this->DrawFrame)
{
renderedSomething += this->FrameActor->RenderOverlay(viewport);
......@@ -416,11 +473,11 @@ int vtkScalarBarActor::RenderOverlay(vtkViewport* viewport)
if (!this->P->AnnotationLabels.empty())
{
renderedSomething +=
this->P->AnnotationLeadersActor->RenderOverlay( viewport );
for (vtkScalarBarActorInternal::ActorVector::size_type i = 0; i < this->P->AnnotationLabels.size(); ++ i )
this->P->AnnotationLeadersActor->RenderOverlay(viewport);
for (size_t i = 0; i < this->P->AnnotationLabels.size(); ++i)
{
renderedSomething +=
this->P->AnnotationLabels[i]->RenderOverlay( viewport );
this->P->AnnotationLabels[i]->RenderOverlay(viewport);
}
}
}
......@@ -436,19 +493,25 @@ int vtkScalarBarActor::RenderOpaqueGeometry(vtkViewport* viewport)
if (!this->LookupTable)
{
vtkWarningMacro(<<"Need a mapper to render a scalar bar");
vtkWarningMacro(<< "Need a mapper to render a scalar bar");
return 0;
}
if (!this->TitleTextProperty)
{
vtkErrorMacro(<<"Need title text property to render a scalar bar");
vtkErrorMacro(<< "Need title text property to render a scalar bar");
return 0;
}
if (!this->LabelTextProperty)
{
vtkErrorMacro(<<"Need label text property to render a scalar bar");
vtkErrorMacro(<< "Need label text property to render a scalar bar");
return 0;
}
if (!this->AnnotationTextProperty)
{
vtkErrorMacro(<< "Need annotation text property to render a scalar bar");
return 0;
}
......@@ -456,7 +519,7 @@ int vtkScalarBarActor::RenderOpaqueGeometry(vtkViewport* viewport)
int positionsHaveChanged = 0;
if (viewport->GetMTime() > this->BuildTime ||
(viewport->GetVTKWindow() &&
viewport->GetVTKWindow()->GetMTime() > this->BuildTime))
viewport->GetVTKWindow()->GetMTime() > this->BuildTime))
{
// if the viewport has changed we may - or may not need
// to rebuild, it depends on if the projected coords chage
......@@ -472,9 +535,9 @@ int vtkScalarBarActor::RenderOpaqueGeometry(vtkViewport* viewport)
// Check if we have bounds on the maximum size
size[0] = size[0] > this->MaximumWidthInPixels
? this->MaximumWidthInPixels : size[0];
? this->MaximumWidthInPixels : size[0];
size[1] = size[1] > this->MaximumHeightInPixels
? this->MaximumHeightInPixels : size[1];
? this->MaximumHeightInPixels : size[1];
if (this->LastSize[0] != size[0] ||
this->LastSize[1] != size[1] ||
......@@ -489,6 +552,7 @@ int vtkScalarBarActor::RenderOpaqueGeometry(vtkViewport* viewport)
if (positionsHaveChanged ||
this->GetMTime() > this->BuildTime ||
this->LookupTable->GetMTime() > this->BuildTime ||
this->AnnotationTextProperty->GetMTime() > this->BuildTime ||
this->LabelTextProperty->GetMTime() > this->BuildTime ||
this->TitleTextProperty->GetMTime() > this->BuildTime ||
this->BackgroundProperty->GetMTime() > this->BuildTime ||
......@@ -506,7 +570,7 @@ int vtkScalarBarActor::RenderOpaqueGeometry(vtkViewport* viewport)
}
// Draw either the scalar bar (non-indexed mode) or
// the annotated value boxes (indexed mode).
if ( ! this->LookupTable->GetIndexedLookup() )
if (!this->LookupTable->GetIndexedLookup())
{
if (this->DrawColorBar)
{
......@@ -515,9 +579,9 @@ int vtkScalarBarActor::RenderOpaqueGeometry(vtkViewport* viewport)
}
vtkScalarBarActorInternal::ActorVector::iterator ait;
for (
ait = this->P->TextActors.begin();
ait != this->P->TextActors.end();
++ait)
ait = this->P->TextActors.begin();
ait != this->P->TextActors.end();
++ait)
{
renderedSomething += (*ait)->RenderOpaqueGeometry(viewport);
}
......@@ -527,7 +591,7 @@ int vtkScalarBarActor::RenderOpaqueGeometry(vtkViewport* viewport)
if (this->DrawColorBar)
{
renderedSomething +=
this->P->AnnotationBoxesActor->RenderOpaqueGeometry( viewport );
this->P->AnnotationBoxesActor->RenderOpaqueGeometry(viewport);
}
}
......@@ -537,17 +601,29 @@ int vtkScalarBarActor::RenderOpaqueGeometry(vtkViewport* viewport)
this->P->NanSwatchActor->RenderOpaqueGeometry(viewport);
}
if (this->DrawBelowRangeSwatch)
{
renderedSomething +=
this->P->BelowRangeSwatchActor->RenderOpaqueGeometry(viewport);
}
if (this->DrawAboveRangeSwatch)
{
renderedSomething +=
this->P->AboveRangeSwatchActor->RenderOpaqueGeometry(viewport);
}
// Draw the annotation leaders and labels
if ( this->DrawAnnotations )
if (this->DrawAnnotations)
{
if (!this->P->AnnotationLabels.empty())
{
renderedSomething +=
this->P->AnnotationLeadersActor->RenderOpaqueGeometry( viewport );
for (vtkScalarBarActorInternal::ActorVector::size_type i = 0; i < this->P->AnnotationLabels.size(); ++ i )
this->P->AnnotationLeadersActor->RenderOpaqueGeometry(viewport);
for (size_t i = 0; i < this->P->AnnotationLabels.size(); ++i)
{
renderedSomething +=
this->P->AnnotationLabels[i]->RenderOpaqueGeometry( viewport );
this->P->AnnotationLabels[i]->RenderOpaqueGeometry(viewport);
}
}
}
......@@ -571,12 +647,12 @@ int vtkScalarBarActor::HasTranslucentPolygonalGeometry()
//----------------------------------------------------------------------------
void vtkScalarBarActor::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
this->Superclass::PrintSelf(os, indent);
if ( this->LookupTable )
if (this->LookupTable)
{
os << indent << "Lookup Table:\n";
this->LookupTable->PrintSelf(os,indent.GetNextIndent());
this->LookupTable->PrintSelf(os, indent.GetNextIndent());
}
else
{
......@@ -586,7 +662,7 @@ void vtkScalarBarActor::PrintSelf(ostream& os, vtkIndent indent)
if (this->TitleTextProperty)
{
os << indent << "Title Text Property:\n";
this->TitleTextProperty->PrintSelf(os,indent.GetNextIndent());
this->TitleTextProperty->PrintSelf(os, indent.GetNextIndent());
}
else
{
......@@ -596,23 +672,33 @@ void vtkScalarBarActor::PrintSelf(ostream& os, vtkIndent indent)
if (this->LabelTextProperty)
{
os << indent << "Label Text Property:\n";
this->LabelTextProperty->PrintSelf(os,indent.GetNextIndent());
this->LabelTextProperty->PrintSelf(os, indent.GetNextIndent());
}
else
{
os << indent << "Label Text Property: (none)\n";
}
if (this->AnnotationTextProperty)
{
os << indent << "Annotation Text Property:\n";
this->AnnotationTextProperty->PrintSelf(os, indent.GetNextIndent());
}
else
{
os << indent << "Annotation Text Property: (none)\n";
}
os << indent << "Title: " << (this->Title ? this->Title : "(none)") << "\n";
os << indent << "ComponentTitle: "
<< (this->ComponentTitle ? this->ComponentTitle : "(none)") << "\n";
os << indent << "Maximum Number Of Colors: "
<< this->MaximumNumberOfColors << "\n";
<< this->MaximumNumberOfColors << "\n";
os << indent << "Number Of Labels: " << this->NumberOfLabels << "\n";
os << indent << "Number Of Labels Built: " << this->NumberOfLabelsBuilt << "\n";
os << indent << "Orientation: ";
if ( this->Orientation == VTK_ORIENT_HORIZONTAL )
if (this->Orientation == VTK_ORIENT_HORIZONTAL)
{
os << "Horizontal\n";
}
......@@ -639,9 +725,9 @@ void vtkScalarBarActor::PrintSelf(ostream& os, vtkIndent indent)
}
os << indent << "MaximumWidthInPixels: "
<< this->MaximumWidthInPixels << endl;
<< this->MaximumWidthInPixels << endl;
os << indent << "MaximumHeightInPixels: "
<< this->MaximumHeightInPixels << endl;
<< this->MaximumHeightInPixels << endl;
os << indent << "DrawAnnotations: "
<< this->DrawAnnotations << endl;
......@@ -656,24 +742,35 @@ void vtkScalarBarActor::PrintSelf(ostream& os, vtkIndent indent)
os << indent << "VerticalTitleSeparation: "
<< VerticalTitleSeparation << endl;
os << indent << "DrawBelowRangeSwatch: "
<< this->DrawBelowRangeSwatch << endl;
os << indent << "BelowRangeAnnotation: "
<< (this->BelowRangeAnnotation ? this->BelowRangeAnnotation : "(none)") << endl;
os << indent << "DrawAboveRangeSwatch: "
<< this->DrawAboveRangeSwatch << endl;
os << indent << "AboveRangeAnnotation: "
<< (this->AboveRangeAnnotation ? this->AboveRangeAnnotation : "(none)") << endl;
os << indent << "DrawBackground: " << this->DrawBackground << "\n";
os << indent << "Background Property:\n";
this->BackgroundProperty->PrintSelf(os,indent.GetNextIndent());
this->BackgroundProperty->PrintSelf(os, indent.GetNextIndent());
os << indent << "DrawFrame: " << this->DrawFrame << "\n";
os << indent << "Frame Property:\n";
this->FrameProperty->PrintSelf(os,indent.GetNextIndent());
this->FrameProperty->PrintSelf(os, indent.GetNextIndent());
}
//----------------------------------------------------------------------------
void vtkScalarBarActor::ShallowCopy(vtkProp* prop)
{
vtkScalarBarActor* a = vtkScalarBarActor::SafeDownCast(prop);
if ( a != NULL )
if (a != NULL)
{