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 "vtkNew.h" // For ivars
39 #include "vtkRemotingViewsModule.h" // needed for export macro
40 #include "vtkScalarBarActor.h"
41 #include "vtkSmartPointer.h" // For ivars
42 #include <vector> // For ivars
43 
44 class vtkAxis;
45 class vtkContextScene;
46 
48 {
49 public:
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52  static vtkPVScalarBarActor* New();
53 
55 
59  vtkGetMacro(AspectRatio, double);
60  vtkSetMacro(AspectRatio, double);
62 
64 
69  vtkGetMacro(AutomaticLabelFormat, int);
70  vtkSetMacro(AutomaticLabelFormat, int);
71  vtkBooleanMacro(AutomaticLabelFormat, int);
73 
75 
78  vtkGetMacro(DrawTickMarks, int);
79  vtkSetMacro(DrawTickMarks, int);
80  vtkBooleanMacro(DrawTickMarks, int);
82 
84 
87  vtkGetMacro(DrawSubTickMarks, int);
88  vtkSetMacro(DrawSubTickMarks, int);
89  vtkBooleanMacro(DrawSubTickMarks, int);
91 
93 
97  vtkGetMacro(AddRangeLabels, int);
98  vtkSetMacro(AddRangeLabels, int);
99  vtkBooleanMacro(AddRangeLabels, int);
101 
103 
107  vtkSetMacro(AutomaticAnnotations, int);
108  vtkGetMacro(AutomaticAnnotations, int);
109  vtkBooleanMacro(AutomaticAnnotations, int);
111 
113 
116  vtkGetStringMacro(RangeLabelFormat);
117  vtkSetStringMacro(RangeLabelFormat);
119 
123  virtual void AddValueLabelIfUnoccluded(double value, double pos, double diff);
124 
126 
130  vtkGetMacro(TitleJustification, int);
131  vtkSetClampMacro(TitleJustification, int, VTK_TEXT_LEFT, VTK_TEXT_RIGHT);
133 
135 
139  vtkGetMacro(AddRangeAnnotations, int);
140  vtkSetMacro(AddRangeAnnotations, int);
141  vtkBooleanMacro(AddRangeAnnotations, int);
143 
149  void ReleaseGraphicsResources(vtkWindow*) override;
150 
154  int RenderOpaqueGeometry(vtkViewport* viewport) override;
155 
159  int RenderOverlay(vtkViewport* viewport) override;
160 
161 protected:
163  ~vtkPVScalarBarActor() override;
164 
166 
169  void PrepareTitleText() override;
170  void ComputeScalarBarThickness() override;
171  void LayoutTitle() override;
172  void ComputeScalarBarLength() override;
173  void LayoutTicks() override;
174  void ConfigureAnnotations() override;
175  void ConfigureTitle() override;
176  void ConfigureTicks() override;
178 
184  void EditAnnotations() override;
185 
195  virtual void BuildScalarBarTexture();
196 
202  virtual int CreateLabel(
203  double value, int minDigits, int targetWidth, int targetHeight, vtkViewport* viewport);
204 
205  double AspectRatio;
210 
215 
217 
222 
224 
230 
236 
241 
246 
247 private:
248  vtkPVScalarBarActor(const vtkPVScalarBarActor&) = delete;
249  void operator=(const vtkPVScalarBarActor&) = delete;
250 };
251 
252 #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 *)