vtkPVScalarBarActor.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
3 // SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
4 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
5 
19 #ifndef vtkPVScalarBarActor_h
20 #define vtkPVScalarBarActor_h
21 
22 #include "vtkNew.h" // For ivars
23 #include "vtkRemotingViewsModule.h" // needed for export macro
24 #include "vtkScalarBarActor.h"
25 #include "vtkSmartPointer.h" // For ivars
26 #include <vector> // For ivars
27 
28 class vtkAxis;
29 class vtkContextScene;
30 
32 {
33 public:
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36  static vtkPVScalarBarActor* New();
37 
39 
43  vtkGetMacro(AspectRatio, double);
44  vtkSetMacro(AspectRatio, double);
46 
48 
53  vtkGetMacro(AutomaticLabelFormat, int);
54  vtkSetMacro(AutomaticLabelFormat, int);
55  vtkBooleanMacro(AutomaticLabelFormat, int);
57 
59 
62  vtkGetMacro(DrawTickMarks, int);
63  vtkSetMacro(DrawTickMarks, int);
64  vtkBooleanMacro(DrawTickMarks, int);
66 
68 
71  vtkGetMacro(DrawSubTickMarks, int);
72  vtkSetMacro(DrawSubTickMarks, int);
73  vtkBooleanMacro(DrawSubTickMarks, int);
75 
77 
81  vtkGetMacro(AddRangeLabels, int);
82  vtkSetMacro(AddRangeLabels, int);
83  vtkBooleanMacro(AddRangeLabels, int);
85 
87 
91  vtkSetMacro(AutomaticAnnotations, int);
92  vtkGetMacro(AutomaticAnnotations, int);
93  vtkBooleanMacro(AutomaticAnnotations, int);
95 
97 
100  vtkGetStringMacro(RangeLabelFormat);
101  vtkSetStringMacro(RangeLabelFormat);
103 
107  virtual void AddValueLabelIfUnoccluded(double value, double pos, double diff);
108 
110 
114  vtkGetMacro(TitleJustification, int);
115  vtkSetClampMacro(TitleJustification, int, VTK_TEXT_LEFT, VTK_TEXT_RIGHT);
117 
119 
123  vtkGetMacro(AddRangeAnnotations, int);
124  vtkSetMacro(AddRangeAnnotations, int);
125  vtkBooleanMacro(AddRangeAnnotations, int);
127 
133  void ReleaseGraphicsResources(vtkWindow*) override;
134 
138  int RenderOpaqueGeometry(vtkViewport* viewport) override;
139 
143  int RenderOverlay(vtkViewport* viewport) override;
144 
145 protected:
147  ~vtkPVScalarBarActor() override;
148 
150 
153  void PrepareTitleText() override;
154  void ComputeScalarBarThickness() override;
155  void LayoutTitle() override;
156  void ComputeScalarBarLength() override;
157  void LayoutTicks() override;
158  void ConfigureAnnotations() override;
159  void ConfigureTitle() override;
160  void ConfigureTicks() override;
162 
168  void EditAnnotations() override;
169 
179  virtual void BuildScalarBarTexture();
180 
186  virtual int CreateLabel(
187  double value, int minDigits, int targetWidth, int targetHeight, vtkViewport* viewport);
188 
189  double AspectRatio;
194 
199 
201 
206 
208 
214 
220 
225 
230 
231 private:
232  vtkPVScalarBarActor(const vtkPVScalarBarActor&) = delete;
233  void operator=(const vtkPVScalarBarActor&) = delete;
234 };
235 
236 #endif // vtkPVScalarBarActor_h
virtual void EditAnnotations()
int TitleJustification
The justification/alignment of the title.
virtual void LayoutTitle()
virtual void ConfigureTitle()
#define VTKREMOTINGVIEWS_EXPORT
vtkPolyDataMapper2D * TickMarksMapper
int RenderOverlay(vtkViewport *viewport)
int AddRangeAnnotations
Flag to add minimum and maximum as annotations.
int AutomaticAnnotations
Flag indicating whether automatic annotations are computed and shown.
virtual void ComputeScalarBarThickness()
int LabelSpace
Space, in pixels, between the labels and the bar itself.
void PrintSelf(ostream &os, vtkIndent indent)
vtkNew< vtkContextScene > TickLayoutHelperScene
These are used to calculate the tick spacing.
virtual void ComputeScalarBarLength()
int RenderOpaqueGeometry(vtkViewport *viewport)
static vtkScalarBarActor * New()
virtual void ConfigureAnnotations()
virtual void LayoutTicks()
virtual void PrepareTitleText()
vtkNew< vtkAxis > TickLayoutHelper
These are used to calculate the tick spacing.
virtual void ConfigureTicks()
A scalar bar with labels of fixed font.
void operator=(const vtkObjectBase &)
virtual void ReleaseGraphicsResources(vtkWindow *)