ParaView
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 "vtkPVVTKExtensionsRenderingModule.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 
48 class VTKPVVTKEXTENSIONSRENDERING_EXPORT vtkPVScalarBarActor : public vtkScalarBarActor
49 {
50 public:
51  vtkTypeMacro(vtkPVScalarBarActor, vtkScalarBarActor);
52  virtual void PrintSelf(ostream& os, vtkIndent indent);
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  virtual void ReleaseGraphicsResources(vtkWindow*);
151 
155  int RenderOpaqueGeometry(vtkViewport* viewport);
156 
160  virtual int RenderOverlay(vtkViewport* viewport);
161 
162 protected:
165 
167 
170  virtual void PrepareTitleText();
171  virtual void ComputeScalarBarThickness();
172  virtual void LayoutTitle();
173  virtual void ComputeScalarBarLength();
174  virtual void LayoutTicks();
175  virtual void ConfigureAnnotations();
176  virtual void ConfigureTitle();
177  virtual void ConfigureTicks();
179 
185  virtual void EditAnnotations();
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 
219  vtkTexture* ScalarBarTexture;
220  vtkPolyData* TickMarks;
221  vtkPolyDataMapper2D* TickMarksMapper;
222  vtkActor2D* TickMarksActor;
223 
225 
228  vtkNew<vtkAxis> TickLayoutHelper;
229  vtkNew<vtkContextScene> TickLayoutHelperScene;
231 
237 
242 
247 
248 private:
249  vtkPVScalarBarActor(const vtkPVScalarBarActor&) VTK_DELETE_FUNCTION;
250  void operator=(const vtkPVScalarBarActor&) VTK_DELETE_FUNCTION;
251 };
252 
253 #endif // vtkPVScalarBarActor_h
int TitleJustification
The justification/alignment of the title.
vtkPolyDataMapper2D * TickMarksMapper
int AddRangeAnnotations
Flag to add minimum and maximum as annotations.
int AutomaticAnnotations
Flag indicating whether automatic annotations are computed and shown.
int LabelSpace
Space, in pixels, between the labels and the bar itself.
vtkNew< vtkContextScene > TickLayoutHelperScene
These are used to calculate the tick spacing.
vtkNew< vtkAxis > TickLayoutHelper
These are used to calculate the tick spacing.
A scalar bar with labels of fixed font.