vtkPVScalarBarActor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPVScalarBarActor.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
16 /*-------------------------------------------------------------------------
17  Copyright 2008 Sandia Corporation.
18  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
19  the U.S. Government retains certain rights in this software.
20 -------------------------------------------------------------------------*/
21 
35 #ifndef vtkPVScalarBarActor_h
36 #define vtkPVScalarBarActor_h
37 
38 #include "vtkRemotingViewsModule.h" // needed for export macro
39 #include "vtkScalarBarActor.h"
40 
41 #include "vtkNew.h" // For ivars
42 #include "vtkSmartPointer.h" // For ivars
43 #include <vector> // For ivars
44 
45 class vtkAxis;
46 class vtkContextScene;
47 
49 {
50 public:
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53  static vtkPVScalarBarActor* New();
54 
56 
60  vtkGetMacro(AspectRatio, double);
61  vtkSetMacro(AspectRatio, double);
63 
65 
70  vtkGetMacro(AutomaticLabelFormat, int);
71  vtkSetMacro(AutomaticLabelFormat, int);
72  vtkBooleanMacro(AutomaticLabelFormat, int);
74 
76 
79  vtkGetMacro(DrawTickMarks, int);
80  vtkSetMacro(DrawTickMarks, int);
81  vtkBooleanMacro(DrawTickMarks, int);
83 
85 
88  vtkGetMacro(DrawSubTickMarks, int);
89  vtkSetMacro(DrawSubTickMarks, int);
90  vtkBooleanMacro(DrawSubTickMarks, int);
92 
94 
98  vtkGetMacro(AddRangeLabels, int);
99  vtkSetMacro(AddRangeLabels, int);
100  vtkBooleanMacro(AddRangeLabels, int);
102 
104 
108  vtkSetMacro(AutomaticAnnotations, int);
109  vtkGetMacro(AutomaticAnnotations, int);
110  vtkBooleanMacro(AutomaticAnnotations, int);
112 
114 
117  vtkGetStringMacro(RangeLabelFormat);
118  vtkSetStringMacro(RangeLabelFormat);
120 
124  virtual void AddValueLabelIfUnoccluded(double value, double pos, double diff);
125 
127 
131  vtkGetMacro(TitleJustification, int);
132  vtkSetClampMacro(TitleJustification, int, VTK_TEXT_LEFT, VTK_TEXT_RIGHT);
134 
136 
140  vtkGetMacro(AddRangeAnnotations, int);
141  vtkSetMacro(AddRangeAnnotations, int);
142  vtkBooleanMacro(AddRangeAnnotations, int);
144 
150  void ReleaseGraphicsResources(vtkWindow*) override;
151 
155  int RenderOpaqueGeometry(vtkViewport* viewport) override;
156 
160  int RenderOverlay(vtkViewport* viewport) override;
161 
162 protected:
164  ~vtkPVScalarBarActor() override;
165 
167 
170  void PrepareTitleText() override;
171  void ComputeScalarBarThickness() override;
172  void LayoutTitle() override;
173  void ComputeScalarBarLength() override;
174  void LayoutTicks() override;
175  void ConfigureAnnotations() override;
176  void ConfigureTitle() override;
177  void ConfigureTicks() override;
179 
185  void EditAnnotations() override;
186 
196  virtual void BuildScalarBarTexture();
197 
203  virtual int CreateLabel(
204  double value, int minDigits, int targetWidth, int targetHeight, vtkViewport* viewport);
205 
206  double AspectRatio;
211 
216 
218 
223 
225 
231 
237 
242 
247 
248 private:
249  vtkPVScalarBarActor(const vtkPVScalarBarActor&) = delete;
250  void operator=(const vtkPVScalarBarActor&) = delete;
251 };
252 
253 #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 *)