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[] ) ...@@ -100,6 +100,7 @@ int TestGL2PSScalarBar( int argc, char *argv[] )
scalarBar1->SetTextPositionToPrecedeScalarBar(); scalarBar1->SetTextPositionToPrecedeScalarBar();
scalarBar1->GetTitleTextProperty()->SetColor( 0., 0., 1. ); scalarBar1->GetTitleTextProperty()->SetColor( 0., 0., 1. );
scalarBar1->GetLabelTextProperty()->SetColor( 0., 0., 1. ); scalarBar1->GetLabelTextProperty()->SetColor( 0., 0., 1. );
scalarBar1->GetAnnotationTextProperty()->SetColor( 0., 0., 1. );
scalarBar1->SetDrawFrame( 1 ); scalarBar1->SetDrawFrame( 1 );
scalarBar1->GetFrameProperty()->SetColor( 0., 0., 0. ); scalarBar1->GetFrameProperty()->SetColor( 0., 0., 0. );
scalarBar1->SetDrawBackground( 1 ); scalarBar1->SetDrawBackground( 1 );
......
...@@ -22,6 +22,7 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests ...@@ -22,6 +22,7 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
TestPieChartActor.cxx TestPieChartActor.cxx
TestPolarAxes.cxx TestPolarAxes.cxx
TestScalarBar.cxx TestScalarBar.cxx
TestScalarBarAboveBelow.cxx
TestSpiderPlotActor.cxx TestSpiderPlotActor.cxx
TestCubeAxesOrientedBoundingBox.cxx TestCubeAxesOrientedBoundingBox.cxx
TestCubeAxesIntersectionPoint.cxx TestCubeAxesIntersectionPoint.cxx
......
...@@ -98,6 +98,7 @@ int TestScalarBar( int argc, char *argv[] ) ...@@ -98,6 +98,7 @@ int TestScalarBar( int argc, char *argv[] )
scalarBar1->SetTextPositionToPrecedeScalarBar(); scalarBar1->SetTextPositionToPrecedeScalarBar();
scalarBar1->GetTitleTextProperty()->SetColor( 0., 0., 1. ); scalarBar1->GetTitleTextProperty()->SetColor( 0., 0., 1. );
scalarBar1->GetLabelTextProperty()->SetColor( 0., 0., 1. ); scalarBar1->GetLabelTextProperty()->SetColor( 0., 0., 1. );
scalarBar1->GetAnnotationTextProperty()->SetColor( 0., 0., 1. );
scalarBar1->SetDrawFrame( 1 ); scalarBar1->SetDrawFrame( 1 );
scalarBar1->GetFrameProperty()->SetColor( 0., 0., 0. ); scalarBar1->GetFrameProperty()->SetColor( 0., 0., 0. );
scalarBar1->SetDrawBackground( 1 ); 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
This diff is collapsed.
...@@ -74,7 +74,7 @@ class vtkTexturedActor2D; ...@@ -74,7 +74,7 @@ class vtkTexturedActor2D;
class VTKRENDERINGANNOTATION_EXPORT vtkScalarBarActor : public vtkActor2D class VTKRENDERINGANNOTATION_EXPORT vtkScalarBarActor : public vtkActor2D
{ {
public: public:
vtkTypeMacro(vtkScalarBarActor,vtkActor2D); vtkTypeMacro(vtkScalarBarActor, vtkActor2D);
void PrintSelf(ostream& os, vtkIndent indent); void PrintSelf(ostream& os, vtkIndent indent);
// Description: // Description:
...@@ -111,7 +111,7 @@ public: ...@@ -111,7 +111,7 @@ public:
// and any annotated values. // and any annotated values.
// Annotated values are rendered using vtkTextActor. // Annotated values are rendered using vtkTextActor.
virtual void SetLookupTable(vtkScalarsToColors*); virtual void SetLookupTable(vtkScalarsToColors*);
vtkGetObjectMacro(LookupTable,vtkScalarsToColors); vtkGetObjectMacro(LookupTable, vtkScalarsToColors);
// Description: // Description:
// Should be display the opacity as well. This is displayed by changing // Should be display the opacity as well. This is displayed by changing
...@@ -119,9 +119,9 @@ public: ...@@ -119,9 +119,9 @@ public:
// given color. For clarity, a texture grid is placed in the background // given color. For clarity, a texture grid is placed in the background
// if Opacity is ON. You might also want to play with SetTextureGridWith // if Opacity is ON. You might also want to play with SetTextureGridWith
// in that case. [Default: off] // in that case. [Default: off]
vtkSetMacro( UseOpacity, int ); vtkSetMacro(UseOpacity, int);
vtkGetMacro( UseOpacity, int ); vtkGetMacro(UseOpacity, int);
vtkBooleanMacro( UseOpacity, int ); vtkBooleanMacro(UseOpacity, int);
// Description: // Description:
// Set/Get the maximum number of scalar bar segments to show. This may // Set/Get the maximum number of scalar bar segments to show. This may
...@@ -137,7 +137,7 @@ public: ...@@ -137,7 +137,7 @@ public:
// Description: // Description:
// Control the orientation of the scalar bar. // Control the orientation of the scalar bar.
vtkSetClampMacro(Orientation,int,VTK_ORIENT_HORIZONTAL, VTK_ORIENT_VERTICAL); vtkSetClampMacro(Orientation, int, VTK_ORIENT_HORIZONTAL, VTK_ORIENT_VERTICAL);
vtkGetMacro(Orientation, int); vtkGetMacro(Orientation, int);
void SetOrientationToHorizontal() void SetOrientationToHorizontal()
{this->SetOrientation(VTK_ORIENT_HORIZONTAL);} {this->SetOrientation(VTK_ORIENT_HORIZONTAL);}
...@@ -146,12 +146,17 @@ public: ...@@ -146,12 +146,17 @@ public:
// Description: // Description:
// Set/Get the title text property. // Set/Get the title text property.
virtual void SetTitleTextProperty(vtkTextProperty* p); virtual void SetTitleTextProperty(vtkTextProperty* p);
vtkGetObjectMacro(TitleTextProperty,vtkTextProperty); vtkGetObjectMacro(TitleTextProperty, vtkTextProperty);
// Description: // Description:
// Set/Get the labels text property. // Set/Get the labels text property.
virtual void SetLabelTextProperty(vtkTextProperty* p); virtual void SetLabelTextProperty(vtkTextProperty* p);
vtkGetObjectMacro(LabelTextProperty,vtkTextProperty); vtkGetObjectMacro(LabelTextProperty, vtkTextProperty);
// Description:
// Set/Get the annotation text property.
virtual void SetAnnotationTextProperty(vtkTextProperty* p);
vtkGetObjectMacro(AnnotationTextProperty, vtkTextProperty);
// Description: // Description:
// Set/Get the format with which to print the labels on the scalar // Set/Get the format with which to print the labels on the scalar
...@@ -175,12 +180,12 @@ public: ...@@ -175,12 +180,12 @@ public:
// Description: // Description:
// Set the width of the texture grid. Used only if UseOpacity is ON. // Set the width of the texture grid. Used only if UseOpacity is ON.
vtkSetMacro( TextureGridWidth, double ); vtkSetMacro(TextureGridWidth, double);
vtkGetMacro( TextureGridWidth, double ); vtkGetMacro(TextureGridWidth, double);
// Description: // Description:
// Get the texture actor.. you may want to change some properties on it // Get the texture actor.. you may want to change some properties on it
vtkGetObjectMacro( TextureActor, vtkTexturedActor2D ); vtkGetObjectMacro(TextureActor, vtkTexturedActor2D);
//BTX //BTX
enum { PrecedeScalarBar = 0, SucceedScalarBar }; enum { PrecedeScalarBar = 0, SucceedScalarBar };
...@@ -193,12 +198,12 @@ public: ...@@ -193,12 +198,12 @@ public:
// Thus, succeed implies the that the text is above scalar bar if // Thus, succeed implies the that the text is above scalar bar if
// the orientation is horizontal or right of scalar bar if the orientation // the orientation is horizontal or right of scalar bar if the orientation
// is vertical. Precede is the opposite. // is vertical. Precede is the opposite.
vtkSetClampMacro( TextPosition, int, PrecedeScalarBar, SucceedScalarBar); vtkSetClampMacro(TextPosition, int, PrecedeScalarBar, SucceedScalarBar);
vtkGetMacro( TextPosition, int ); vtkGetMacro(TextPosition, int);
virtual void SetTextPositionToPrecedeScalarBar() virtual void SetTextPositionToPrecedeScalarBar()
{ this->SetTextPosition( vtkScalarBarActor::PrecedeScalarBar ); } { this->SetTextPosition(vtkScalarBarActor::PrecedeScalarBar); }
virtual void SetTextPositionToSucceedScalarBar() virtual void SetTextPositionToSucceedScalarBar()
{ this->SetTextPosition( vtkScalarBarActor::SucceedScalarBar ); } { this->SetTextPosition(vtkScalarBarActor::SucceedScalarBar); }
// Description: // Description:
// Set/Get the maximum width and height in pixels. Specifying the size as // Set/Get the maximum width and height in pixels. Specifying the size as
...@@ -206,10 +211,10 @@ public: ...@@ -206,10 +211,10 @@ public:
// the size of the actor too much. These methods allow the user to set // the size of the actor too much. These methods allow the user to set
// bounds on the maximum size of the scalar bar in pixels along any // bounds on the maximum size of the scalar bar in pixels along any
// direction. Defaults to unbounded. // direction. Defaults to unbounded.
vtkSetMacro( MaximumWidthInPixels, int ); vtkSetMacro(MaximumWidthInPixels, int);
vtkGetMacro( MaximumWidthInPixels, int ); vtkGetMacro(MaximumWidthInPixels, int);
vtkSetMacro( MaximumHeightInPixels, int ); vtkSetMacro(MaximumHeightInPixels, int);
vtkGetMacro( MaximumHeightInPixels, int ); vtkGetMacro(MaximumHeightInPixels, int);
// Description: // Description:
// Set/get the padding between the scalar bar and the text annotations. // Set/get the padding between the scalar bar and the text annotations.
...@@ -234,6 +239,31 @@ public: ...@@ -234,6 +239,31 @@ public:
vtkGetMacro(DrawNanAnnotation, int); vtkGetMacro(DrawNanAnnotation, int);
vtkBooleanMacro(DrawNanAnnotation, int); vtkBooleanMacro(DrawNanAnnotation, int);
// Description:
// Set/get whether the Below range swatch should be rendered or not.
// This only affects rendering when \a DrawAnnotations is true.
// The default is false.
vtkSetMacro(DrawBelowRangeSwatch, bool);
vtkGetMacro(DrawBelowRangeSwatch, bool);
vtkBooleanMacro(DrawBelowRangeSwatch, bool);
// Description:
// Set/get the annotation text for "Below Range" values.
vtkSetStringMacro(BelowRangeAnnotation);
vtkGetStringMacro(BelowRangeAnnotation);
// Description:
// Set/get whether the Above range swatch should be rendered or not.
// This only affects rendering when \a DrawAnnotations is true.
// The default is false.
vtkSetMacro(DrawAboveRangeSwatch, bool);
vtkGetMacro(DrawAboveRangeSwatch, bool);
vtkBooleanMacro(DrawAboveRangeSwatch, bool);
// Description:
// Set/get the annotation text for "Above Range Swatch" values.
vtkSetStringMacro(AboveRangeAnnotation);
vtkGetStringMacro(AboveRangeAnnotation);
// Description: // Description:
// Set/get how leader lines connecting annotations to values should be colored. // Set/get how leader lines connecting annotations to values should be colored.
// //
...@@ -257,8 +287,9 @@ public: ...@@ -257,8 +287,9 @@ public:
// If non-zero, the vtkTextActor instances used to render annotation // If non-zero, the vtkTextActor instances used to render annotation
// labels will have their TextScaleMode set to viewport-based scaling, // labels will have their TextScaleMode set to viewport-based scaling,
// which nonlinearly scales font size with the viewport size. // which nonlinearly scales font size with the viewport size.
vtkSetMacro(AnnotationTextScaling,int); vtkSetMacro(AnnotationTextScaling, int);
vtkGetMacro(AnnotationTextScaling,int); vtkGetMacro(AnnotationTextScaling, int);
vtkBooleanMacro(AnnotationTextScaling, int);
// Description: // Description:
// Set/Get whether a background should be drawn around the scalar bar. // Set/Get whether a background should be drawn around the scalar bar.
...@@ -290,39 +321,47 @@ public: ...@@ -290,39 +321,47 @@ public:
// Description: // Description:
// Set/Get the background property. // Set/Get the background property.
virtual void SetBackgroundProperty(vtkProperty2D* p); virtual void SetBackgroundProperty(vtkProperty2D* p);
vtkGetObjectMacro(BackgroundProperty,vtkProperty2D); vtkGetObjectMacro(BackgroundProperty, vtkProperty2D);
// Description: // Description:
// Set/Get the frame property. // Set/Get the frame property.
virtual void SetFrameProperty(vtkProperty2D* p); virtual void SetFrameProperty(vtkProperty2D* p);
vtkGetObjectMacro(FrameProperty,vtkProperty2D); vtkGetObjectMacro(FrameProperty, vtkProperty2D);
// Description: // Description:
// Set/get the amount of padding around text boxes. // Set/get the amount of padding around text boxes.
// The default is 1 pixel. // The default is 1 pixel.
vtkGetMacro(TextPad,int); vtkGetMacro(TextPad, int);
vtkSetMacro(TextPad,int); vtkSetMacro(TextPad, int);
// Description: // Description:
// Set/get the margin in pixels, between the title and the bar, // Set/get the margin in pixels, between the title and the bar,
// when the \a Orientation is vertical. // when the \a Orientation is vertical.
// The default is 0 pixels. // The default is 0 pixels.
vtkGetMacro(VerticalTitleSeparation,int); vtkGetMacro(VerticalTitleSeparation, int);
vtkSetMacro(VerticalTitleSeparation,int); vtkSetMacro(VerticalTitleSeparation, int);
// Description: // Description:
// Set/get the thickness of the color bar relative to the widget frame. // Set/get the thickness of the color bar relative to the widget frame.
// The default is 0.375 and must always be in the range ]0, 1[. // The default is 0.375 and must always be in the range ]0, 1[.
vtkGetMacro(BarRatio,double); vtkGetMacro(BarRatio, double);
vtkSetClampMacro(BarRatio,double,0.,1.); vtkSetClampMacro(BarRatio, double, 0., 1.);
// Description: // Description:
// Set/get the ratio of the title height to the tick label height // Set/get the ratio of the title height to the tick label height
// (used only when the \a Orientation is horizontal). // (used only when the \a Orientation is horizontal).
// The default is 0.5, which attempts to make the labels and title // The default is 0.5, which attempts to make the labels and title
// the same size. This must be a number in the range ]0, 1[. // the same size. This must be a number in the range ]0, 1[.
vtkGetMacro(TitleRatio,double); vtkGetMacro(TitleRatio, double);
vtkSetClampMacro(TitleRatio,double,0.,1.); vtkSetClampMacro(TitleRatio, double, 0., 1.);
// Description:
// Set/Get whether the font size of title and labels is unconstrained. Default is off.
// When it is constrained, the size of the scalar bar will constrained the font size
// When it is not, the size of the font will always be respected
vtkSetMacro(UnconstrainedFontSize, bool);
vtkGetMacro(UnconstrainedFontSize, bool);
vtkBooleanMacro(UnconstrainedFontSize, bool);
protected: protected:
vtkScalarBarActor(); vtkScalarBarActor();
...@@ -377,12 +416,34 @@ protected: ...@@ -377,12 +416,34 @@ protected:
virtual void ComputeScalarBarThickness(); virtual void ComputeScalarBarThickness();
// Description: // Description:
// Determine the size of the NaN swatch if it is to be rendered. // Compute a correct SwatchPad
// virtual void ComputeSwatchPad();
// This method must set this->P->NanSwatchSize and this->P->NanBox. // This method must set this->P->NanSwatchSize and this->P->NanBox.
// It may depend on layout performed by ComputeScalarBarThickness. // It may depend on layout performed by ComputeScalarBarThickness.
virtual void LayoutNanSwatch(); virtual void LayoutNanSwatch();
// Description:
// Determine the size of the Below Range if it is to be rendered.
//
// This method must set this->P->BelowSwatchSize and this->P->BelowBox.
// It may depend on layout performed by ComputeScalarBarThickness.
virtual void LayoutBelowRangeSwatch();
// Description:
// Determine the size of the Above Range if it is to be rendered.
//
// This method must set this->P->AboveBox.
// It may depend on layout performed by ComputeScalarBarThickness.
virtual void LayoutAboveRangeSwatch();
// Description:
// Determine the position of the Above Range if it is to be rendered.
//
// This method must set this->P->AboveRangeSize.
// It may depend on layout performed by ComputeScalarBarLength.
virtual void LayoutAboveRangeSwatchPosn();
// Description: // Description:
// Set the title actor's input to the latest title (and subtitle) text. // Set the title actor's input to the latest title (and subtitle) text.
virtual void PrepareTitleText(); virtual void PrepareTitleText();
...@@ -398,6 +459,11 @@ protected: ...@@ -398,6 +459,11 @@ protected:
// than the title box. // than the title box.
virtual void LayoutTitle(); virtual void LayoutTitle();
// Description:
// This method sets the title and tick-box size and position
// for the UnconstrainedFontSize mode.
virtual void LayoutForUnconstrainedFont();
// Description: // Description:
// Determine how long the scalar bar should be (on an axis parallel // Determine how long the scalar bar should be (on an axis parallel
// to the direction in which scalar values vary). // to the direction in which scalar values vary).
...@@ -456,6 +522,11 @@ protected: ...@@ -456,6 +522,11 @@ protected:
// This may change in the future. // This may change in the future.
virtual void ConfigureNanSwatch(); virtual void ConfigureNanSwatch();
// Description:
// Generate/configure the above/below range swatch using the laid-out
// geometry.
virtual void ConfigureAboveBelowRangeSwatch(bool above);
// Description: // Description:
// Subclasses may override this method to alter this->P->Labels, allowing // Subclasses may override this method to alter this->P->Labels, allowing
// the addition and removal of annotations. The member maps viewport coordinates // the addition and removal of annotations. The member maps viewport coordinates
...@@ -510,6 +581,8 @@ protected: ...@@ -510,6 +581,8 @@ protected:
double TextureGridWidth; double TextureGridWidth;
int TextPosition; int TextPosition;
char* NanAnnotation; char* NanAnnotation;
char* BelowRangeAnnotation;
char* AboveRangeAnnotation;
double AnnotationLeaderPadding; double AnnotationLeaderPadding;
int MaximumWidthInPixels; int MaximumWidthInPixels;
int MaximumHeightInPixels; int MaximumHeightInPixels;
...@@ -517,6 +590,10 @@ protected: ...@@ -517,6 +590,10 @@ protected:
int VerticalTitleSeparation; int VerticalTitleSeparation;
double BarRatio; double BarRatio;
double TitleRatio; double TitleRatio;
bool UnconstrainedFontSize; // off by default
bool DrawBelowRangeSwatch;
bool DrawAboveRangeSwatch;
//@} //@}
/// Internal state used for rendering /// Internal state used for rendering
...@@ -530,7 +607,8 @@ protected: ...@@ -530,7 +607,8 @@ protected:
vtkScalarsToColors* LookupTable; //!< The object this actor illustrates vtkScalarsToColors* LookupTable; //!< The object this actor illustrates
vtkTextProperty* TitleTextProperty; //!< Font for the legend title. vtkTextProperty* TitleTextProperty; //!< Font for the legend title.
vtkTextProperty* LabelTextProperty; //!< Font for tick+annotation labels. vtkTextProperty* LabelTextProperty; //!< Font for tick labels.
vtkTextProperty* AnnotationTextProperty; //!< Font for annotation labels.
vtkTextActor* TitleActor; //!< The legend title text renderer. vtkTextActor* TitleActor; //!< The legend title text renderer.
vtkPolyData* ScalarBar; //!< Polygon(s) colored by \a LookupTable. vtkPolyData* ScalarBar; //!< Polygon(s) colored by \a LookupTable.
...@@ -554,6 +632,5 @@ private: ...@@ -554,6 +632,5 @@ private:
void operator=(const vtkScalarBarActor&); // Not implemented. void operator=(const vtkScalarBarActor&); // Not implemented.
}; };
#endif #endif
...@@ -37,7 +37,7 @@ public: ...@@ -37,7 +37,7 @@ public:
struct vtkScalarBarBox struct vtkScalarBarBox
{ {
/// The position of the box in viewport (pixel) coordinates. /// The position of the box in viewport (pixel) coordinates.
vtkTuple<int,2> Posn; vtkTuple<int, 2> Posn;
/**\brief Size of the box, stored as (thickness, length) not (width, height). /**\brief Size of the box, stored as (thickness, length) not (width, height).
* *
...@@ -46,7 +46,7 @@ struct vtkScalarBarBox ...@@ -46,7 +46,7 @@ struct vtkScalarBarBox
* Length is a measure of the box size parallel to the long axis of the scalar bar. * Length is a measure of the box size parallel to the long axis of the scalar bar.
* When the scalar bar orientation is horizontal, length measures width. * When the scalar bar orientation is horizontal, length measures width.
*/ */
vtkTuple<int,2> Size; vtkTuple<int, 2> Size;
}; };
/// Internal state for the scalar bar actor shared with subclasses. /// Internal state for the scalar bar actor shared with subclasses.
...@@ -68,6 +68,14 @@ public: ...@@ -68,6 +68,14 @@ public:
this->NanSwatch = 0; this->NanSwatch = 0;
this->NanSwatchMapper = 0; this->NanSwatchMapper = 0;
this->NanSwatchActor = 0; this->NanSwatchActor = 0;
this->BelowRangeSwatch = 0;
this->BelowRangeSwatchMapper = 0;
this->BelowRangeSwatchActor = 0;
this->AboveRangeSwatch = 0;
this->AboveRangeSwatchMapper = 0;
this->AboveRangeSwatchActor = 0;
} }
// Define types for smart vectors containing various base classes. // Define types for smart vectors containing various base classes.
...@@ -87,6 +95,12 @@ public: ...@@ -87,6 +95,12 @@ public: