VTK  9.3.1
vtkScalarBarActorInternal.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 #ifndef vtkScalarBarActorInternal_h
4 #define vtkScalarBarActorInternal_h
5 
6 #include "vtkColor.h" // for AnnotationColors, LabelColorMap, and tuples
7 #include "vtkRenderingAnnotationModule.h" // For export macro
8 #include "vtkSmartPointer.h" // for "smart vectors"
9 #include "vtkStdString.h" // for LabelMap
10 
11 #include <map>
12 #include <vector>
13 
14 VTK_ABI_NAMESPACE_BEGIN
15 class vtkActor2D;
16 class vtkCellArray;
17 class vtkTextActor;
18 class vtkPoints;
19 class vtkPolyData;
22 class vtkViewport;
23 
25 template <class T>
26 class VTKRENDERINGANNOTATION_EXPORT vtkSmartVector : public std::vector<vtkSmartPointer<T>>
27 {
28 public:
33  {
34  // NB: This is relatively evil. But much cheaper than copying the array.
35  // It assumes the compiler won't pad the class.
36  return reinterpret_cast<T**>(&((*this)[0]));
37  }
38 };
39 
42 {
45 
54 };
55 
57 class VTKRENDERINGANNOTATION_EXPORT vtkScalarBarActorInternal
58 {
59 public:
61  {
62  this->Viewport = nullptr;
63  this->SwatchColors = nullptr;
64  this->SwatchPts = nullptr;
65  this->Polys = nullptr;
66  this->AnnotationBoxes = nullptr;
67  this->AnnotationBoxesMapper = nullptr;
68  this->AnnotationBoxesActor = nullptr;
69  this->AnnotationLeaders = nullptr;
70  this->AnnotationLeadersMapper = nullptr;
71  this->AnnotationLeadersActor = nullptr;
72  this->NanSwatch = nullptr;
73  this->NanSwatchMapper = nullptr;
74  this->NanSwatchActor = nullptr;
75 
76  this->BelowRangeSwatch = nullptr;
77  this->BelowRangeSwatchMapper = nullptr;
78  this->BelowRangeSwatchActor = nullptr;
79 
80  this->AboveRangeSwatch = nullptr;
81  this->AboveRangeSwatchMapper = nullptr;
82  this->AboveRangeSwatchActor = nullptr;
83  }
84 
85  // Define types for smart vectors containing various base classes.
87 
88  // Other vector container types.
89  typedef std::vector<double> DoubleVector;
90  typedef std::vector<vtkColor3ub> ColorVector;
91 
96  vtkViewport* Viewport;
98 
101 
104 
107 
109  double SwatchPad;
110 
113  int NumNotes;
114 
118 
122 
125  int TL[2]; // VERTICAL => TL={0,1}, HORIZONTAL => TL={1,0}, Size[TL[0]] == width, Size[TL[1]] ==
126  // height
127 
130 
133 
136 
139 
142 
145 
148 
151 
155 
158 
160  std::map<double, vtkStdString> Labels;
161 
164  std::map<double, vtkColor3ub> LabelColors;
166 
169  ActorVector TextActors;
170  DoubleVector TextActorAnchors;
177  ActorVector AnnotationLabels;
178  DoubleVector AnnotationAnchors;
179  ColorVector AnnotationColors;
183 
187 
192 };
193 
194 VTK_ABI_NAMESPACE_END
195 #endif // vtkScalarBarActorInternal_h
196 // VTK-HeaderTest-Exclude: vtkScalarBarActorInternal.h
std::vector< vtkColor3ub > ColorVector
vtkTuple< int, 2 > Size
Size of the box, stored as (thickness, length) not (width, height).
vtkPolyData * AboveRangeSwatch
Cache of classes holding geometry assembled and ready for rendering.
vtkActor2D * AboveRangeSwatchActor
Cache of classes holding geometry assembled and ready for rendering.
vtkScalarBarBox TitleBox
The bounding box of the scalar bar title text.
vtkScalarBarBox Frame
The bounding box of the entire scalar bar frame.
ActorVector AnnotationLabels
Cache of classes holding geometry assembled and ready for rendering.
std::vector< double > DoubleVector
DoubleVector AnnotationAnchors
Cache of classes holding geometry assembled and ready for rendering.
vtkScalarBarBox AboveRangeSwatchBox
The bounding box of the Above Range.
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkPolyData * AnnotationBoxes
Cache of classes holding geometry assembled and ready for rendering.
vtkActor2D * AnnotationBoxesActor
Cache of classes holding geometry assembled and ready for rendering.
vtkScalarBarBox ScalarBarBox
The bounding box of the scalar bar (excluding NaN swatch)
a actor that draws 2D data
Definition: vtkActor2D.h:34
Internal state for the scalar bar actor shared with subclasses.
std::map< double, vtkStdString > Labels
Map from viewport coordinates to label text of each annotation.
vtkPolyDataMapper2D * NanSwatchMapper
Cache of classes holding geometry assembled and ready for rendering.
ColorVector AnnotationColors
Cache of classes holding geometry assembled and ready for rendering.
vtkScalarBarBox NanBox
The bounding box of the NaN swatch.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
vtkPolyDataMapper2D * BelowRangeSwatchMapper
Cache of classes holding geometry assembled and ready for rendering.
vtkPolyData * NanSwatch
Cache of classes holding geometry assembled and ready for rendering.
T ** PointerArray()
Convert to an array of "dumb" pointers for functions that need a contiguous array pointer as input...
double AboveRangeSwatchSize
The thickness and length of the (square) Above Range swatch.
int NumColors
Number of color swatches to draw for either the continuous or categorical scalar bar, not including a NaN swatch.
An actor that displays text.
Definition: vtkTextActor.h:45
vtkPolyDataMapper2D * AboveRangeSwatchMapper
Cache of classes holding geometry assembled and ready for rendering.
int NumNotes
Number of annotated values (at least lut->GetNumberOfAnnotatedValues(), but maybe more) ...
A vector of smart pointers.
vtkPolyData * BelowRangeSwatch
Cache of classes holding geometry assembled and ready for rendering.
double BelowRangeSwatchSize
The thickness and length of the (square) Below Range swatch.
vtkActor2D * BelowRangeSwatchActor
Cache of classes holding geometry assembled and ready for rendering.
vtkPolyData * AnnotationLeaders
Cache of classes holding geometry assembled and ready for rendering.
dynamic, self-adjusting array of unsigned char
object to represent cell connectivity
Definition: vtkCellArray.h:175
vtkPolyDataMapper2D * AnnotationBoxesMapper
Cache of classes holding geometry assembled and ready for rendering.
double SwatchPad
Space in pixels between swatches when in indexed lookup mode.
vtkUnsignedCharArray * SwatchColors
Colors of swatches in Polys.
std::map< double, vtkColor3ub > LabelColors
Map from viewport coordinates to the leader line color of each annotation.
double NanSwatchSize
The thickness and length of the (square) NaN swatch.
ActorVector TextActors
Cache of classes holding geometry assembled and ready for rendering.
vtkPolyDataMapper2D * AnnotationLeadersMapper
Cache of classes holding geometry assembled and ready for rendering.
vtkActor2D * NanSwatchActor
Cache of classes holding geometry assembled and ready for rendering.
vtkPoints * SwatchPts
Point coordinates for the scalar bar actor.
A structure to represent pixel coordinates for text or swatch bounds.
vtkCellArray * Polys
Cells representing color swatches (for the scalar bar actor)
vtkTuple< int, 2 > Posn
The position of the box in viewport (pixel) coordinates.
int NumSwatches
Either NumColors or NumColors + 1, depending on whether the NaN swatch is to be drawn.
vtkActor2D * AnnotationLeadersActor
Cache of classes holding geometry assembled and ready for rendering.
DoubleVector TextActorAnchors
Cache of classes holding geometry assembled and ready for rendering.
draw vtkPolyData onto the image plane
represent and manipulate 3D points
Definition: vtkPoints.h:28
vtkSmartVector< vtkTextActor > ActorVector
vtkScalarBarBox TickBox
The bounding box of tick mark anchor points (tick labels are not fully contained) ...
vtkScalarBarBox BelowRangeSwatchBox
The bounding box of the Below Range.