11 #include "vtkCoordinate.h"
13 #include "vtkScalarBarActor.h"
14 #include "vtkSmartPointer.h"
18 class vtkColorTransferFunctionItem;
19 class vtkContextActor;
22 class vtkContextScene;
26 class vtkScalarsToColors;
27 class vtkScalarBarItem;
28 class vtkTextProperty;
32 :
public vtkScalarBarActor {
35 void PrintSelf(ostream& os, vtkIndent indent)
override;
43 vtkGetMacro(TitleJustification,
int);
44 vtkSetClampMacro(TitleJustification,
int, VTK_TEXT_LEFT, VTK_TEXT_RIGHT);
52 vtkSetMacro(ForceHorizontalTitle,
bool);
53 vtkGetMacro(ForceHorizontalTitle,
bool);
54 vtkBooleanMacro(ForceHorizontalTitle,
bool);
57 enum { PrecedeScalarBar = 0, SucceedScalarBar };
71 vtkSetClampMacro(ScalarBarThickness,
int, 0, VTK_INT_MAX);
72 vtkGetMacro(ScalarBarThickness,
int);
84 vtkSetClampMacro(ScalarBarLength,
double, 0, 1);
85 vtkGetMacro(ScalarBarLength,
double);
93 vtkSetMacro(ReverseLegend,
bool);
94 vtkGetMacro(ReverseLegend,
bool);
95 vtkBooleanMacro(ReverseLegend,
bool);
104 vtkGetMacro(AutomaticLabelFormat,
int);
105 vtkSetMacro(AutomaticLabelFormat,
int);
106 vtkBooleanMacro(AutomaticLabelFormat,
int);
114 vtkSetMacro(AddRangeLabels,
int);
115 vtkGetMacro(AddRangeLabels,
int);
123 vtkSetMacro(AutomaticAnnotations,
int);
124 vtkGetMacro(AutomaticAnnotations,
int);
125 vtkBooleanMacro(AutomaticAnnotations,
int);
133 vtkGetMacro(AddRangeAnnotations,
int);
134 vtkSetMacro(AddRangeAnnotations,
int);
135 vtkBooleanMacro(AddRangeAnnotations,
int);
142 vtkGetMacro(OutlineScalarBar,
int);
143 vtkSetMacro(OutlineScalarBar,
int);
144 vtkBooleanMacro(OutlineScalarBar,
int);
151 vtkSetMacro(DrawTickMarks,
bool);
152 vtkGetMacro(DrawTickMarks,
bool);
159 vtkSetStringMacro(RangeLabelFormat);
160 vtkGetStringMacro(RangeLabelFormat);
167 void SetUseCustomLabels(
bool useLabels);
168 vtkGetMacro(UseCustomLabels,
bool);
176 vtkSetMacro(NumberOfTicks,
int);
177 vtkGetMacro(NumberOfTicks,
int);
183 void SetNumberOfCustomLabels(vtkIdType numLabels);
184 vtkIdType GetNumberOfCustomLabels();
190 void SetCustomLabel(vtkIdType index,
double value);
195 int RenderOverlay(vtkViewport* viewport)
override;
200 int RenderOpaqueGeometry(vtkViewport* viewport)
override;
207 void ReleaseGraphicsResources(vtkWindow* window)
override;
212 virtual bool Paint(vtkContext2D* painter);
218 vtkRectf GetBoundingRect();
226 int GetEstimatedNumberOfAnnotations();
236 vtkContextActor* ActorDelegate;
238 int TitleJustification;
244 bool ForceHorizontalTitle;
249 int ScalarBarThickness;
254 double ScalarBarLength;
258 int AutomaticLabelFormat;
261 int AutomaticAnnotations;
262 int AddRangeAnnotations;
263 char* RangeLabelFormat;
268 int OutlineScalarBar;
281 bool UseCustomLabels;
297 class vtkScalarBarItem;
298 vtkScalarBarItem* ScalarBarItem;
303 vtkViewport* CurrentViewport;
314 void UpdateScalarBarTexture(vtkImageData*
image);
321 void GetSize(
double size[2], vtkContext2D* painter);
328 vtkRectf GetColorBarRect(
double size[2]);
334 vtkRectf GetFullColorBarRect(
double size[2]);
339 vtkRectf GetAboveRangeColorRect(
double size[2]);
344 vtkRectf GetBelowRangeColorRect(
double size[2]);
346 vtkRectf GetOutOfRangeColorRectInternal(
352 vtkRectf GetNaNColorRect(
double size[2]);
357 void UpdateTextProperties();
362 void PaintColorBar(vtkContext2D* painter,
double size[2]);
367 void PaintAxis(vtkContext2D* painter,
double size[2]);
372 void PaintTitle(vtkContext2D* painter,
double size[2]);
374 class vtkAnnotationMap;
381 void PaintAnnotations(vtkContext2D* painter,
383 const vtkAnnotationMap& map);
388 void PaintAnnotationsVertically(vtkContext2D* painter,
390 const vtkAnnotationMap& map);
395 void PaintAnnotationsHorizontally(vtkContext2D* painter,
397 const vtkAnnotationMap& map);