VTK  9.2.6
vtkScalarBarActorInternal.h
Go to the documentation of this file.
1 #ifndef vtkScalarBarActorInternal_h
2 #define vtkScalarBarActorInternal_h
3 
4 #include "vtkColor.h" // for AnnotationColors, LabelColorMap, and tuples
5 #include "vtkRenderingAnnotationModule.h" // For export macro
6 #include "vtkSmartPointer.h" // for "smart vectors"
7 #include "vtkStdString.h" // for LabelMap
8 
9 #include <map>
10 #include <vector>
11 
12 class vtkActor2D;
13 class vtkCellArray;
14 class vtkTextActor;
15 class vtkPoints;
16 class vtkPolyData;
19 class vtkViewport;
20 
22 template <class T>
23 class VTKRENDERINGANNOTATION_EXPORT vtkSmartVector : public std::vector<vtkSmartPointer<T>>
24 {
25 public:
30  {
31  // NB: This is relatively evil. But much cheaper than copying the array.
32  // It assumes the compiler won't pad the class.
33  return reinterpret_cast<T**>(&((*this)[0]));
34  }
35 };
36 
39 {
42 
51 };
52 
54 class VTKRENDERINGANNOTATION_EXPORT vtkScalarBarActorInternal
55 {
56 public:
58  {
59  this->Viewport = nullptr;
60  this->SwatchColors = nullptr;
61  this->SwatchPts = nullptr;
62  this->Polys = nullptr;
63  this->AnnotationBoxes = nullptr;
64  this->AnnotationBoxesMapper = nullptr;
65  this->AnnotationBoxesActor = nullptr;
66  this->AnnotationLeaders = nullptr;
67  this->AnnotationLeadersMapper = nullptr;
68  this->AnnotationLeadersActor = nullptr;
69  this->NanSwatch = nullptr;
70  this->NanSwatchMapper = nullptr;
71  this->NanSwatchActor = nullptr;
72 
73  this->BelowRangeSwatch = nullptr;
74  this->BelowRangeSwatchMapper = nullptr;
75  this->BelowRangeSwatchActor = nullptr;
76 
77  this->AboveRangeSwatch = nullptr;
78  this->AboveRangeSwatchMapper = nullptr;
79  this->AboveRangeSwatchActor = nullptr;
80  }
81 
82  // Define types for smart vectors containing various base classes.
84 
85  // Other vector container types.
86  typedef std::vector<double> DoubleVector;
87  typedef std::vector<vtkColor3ub> ColorVector;
88 
95 
97  double NanSwatchSize;
98 
101 
104 
106  double SwatchPad;
107 
110  int NumNotes;
111 
115 
119 
122  int TL[2]; // VERTICAL => TL={0,1}, HORIZONTAL => TL={1,0}, Size[TL[0]] == width, Size[TL[1]] ==
123  // height
124 
127 
130 
133 
136 
139 
142 
145 
148 
152 
155 
157  std::map<double, vtkStdString> Labels;
158 
161  std::map<double, vtkColor3ub> LabelColors;
163 
180 
184 
189 };
190 
191 #endif // vtkScalarBarActorInternal_h
192 // VTK-HeaderTest-Exclude: vtkScalarBarActorInternal.h
a actor that draws 2D data
Definition: vtkActor2D.h:155
object to represent cell connectivity
Definition: vtkCellArray.h:296
represent and manipulate 3D points
Definition: vtkPoints.h:149
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:200
Internal state for the scalar bar actor shared with subclasses.
std::vector< vtkColor3ub > ColorVector
ActorVector TextActors
Cache of classes holding geometry assembled and ready for rendering.
vtkPolyData * AboveRangeSwatch
Cache of classes holding geometry assembled and ready for rendering.
vtkScalarBarBox ScalarBarBox
The bounding box of the scalar bar (excluding NaN swatch)
int NumSwatches
Either NumColors or NumColors + 1, depending on whether the NaN swatch is to be drawn.
vtkUnsignedCharArray * SwatchColors
Colors of swatches in Polys.
vtkScalarBarBox Frame
The bounding box of the entire scalar bar frame.
vtkSmartVector< vtkTextActor > ActorVector
int NumColors
Number of color swatches to draw for either the continuous or categorical scalar bar,...
vtkScalarBarBox BelowRangeSwatchBox
The bounding box of the Below Range.
double NanSwatchSize
The thickness and length of the (square) NaN swatch.
vtkActor2D * BelowRangeSwatchActor
Cache of classes holding geometry assembled and ready for rendering.
std::map< double, vtkColor3ub > LabelColors
Map from viewport coordinates to the leader line color of each annotation.
DoubleVector TextActorAnchors
Cache of classes holding geometry assembled and ready for rendering.
vtkPolyData * NanSwatch
Cache of classes holding geometry assembled and ready for rendering.
vtkPolyDataMapper2D * AnnotationLeadersMapper
Cache of classes holding geometry assembled and ready for rendering.
vtkScalarBarBox NanBox
The bounding box of the NaN swatch.
vtkViewport * Viewport
Cache of dimensions fixed during geometry assembly.
std::vector< double > DoubleVector
vtkPolyData * AnnotationBoxes
Cache of classes holding geometry assembled and ready for rendering.
vtkPolyDataMapper2D * NanSwatchMapper
Cache of classes holding geometry assembled and ready for rendering.
vtkScalarBarBox AboveRangeSwatchBox
The bounding box of the Above Range.
vtkPolyData * BelowRangeSwatch
Cache of classes holding geometry assembled and ready for rendering.
vtkScalarBarBox TickBox
The bounding box of tick mark anchor points (tick labels are not fully contained)
vtkActor2D * AboveRangeSwatchActor
Cache of classes holding geometry assembled and ready for rendering.
int NumNotes
Number of annotated values (at least lut->GetNumberOfAnnotatedValues(), but maybe more)
double AboveRangeSwatchSize
The thickness and length of the (square) Above Range swatch.
vtkScalarBarBox TitleBox
The bounding box of the scalar bar title text.
ColorVector AnnotationColors
Cache of classes holding geometry assembled and ready for rendering.
vtkCellArray * Polys
Cells representing color swatches (for the scalar bar actor)
double BelowRangeSwatchSize
The thickness and length of the (square) Below Range swatch.
vtkPoints * SwatchPts
Point coordinates for the scalar bar actor.
vtkPolyDataMapper2D * BelowRangeSwatchMapper
Cache of classes holding geometry assembled and ready for rendering.
vtkActor2D * AnnotationBoxesActor
Cache of classes holding geometry assembled and ready for rendering.
vtkPolyDataMapper2D * AboveRangeSwatchMapper
Cache of classes holding geometry assembled and ready for rendering.
vtkPolyDataMapper2D * AnnotationBoxesMapper
Cache of classes holding geometry assembled and ready for rendering.
vtkActor2D * AnnotationLeadersActor
Cache of classes holding geometry assembled and ready for rendering.
ActorVector AnnotationLabels
Cache of classes holding geometry assembled and ready for rendering.
std::map< double, vtkStdString > Labels
Map from viewport coordinates to label text of each annotation.
vtkActor2D * NanSwatchActor
Cache of classes holding geometry assembled and ready for rendering.
DoubleVector AnnotationAnchors
Cache of classes holding geometry assembled and ready for rendering.
vtkPolyData * AnnotationLeaders
Cache of classes holding geometry assembled and ready for rendering.
double SwatchPad
Space in pixels between swatches when in indexed lookup mode.
A vector of smart pointers.
T ** PointerArray()
Convert to an array of "dumb" pointers for functions that need a contiguous array pointer as input.
An actor that displays text.
Definition: vtkTextActor.h:166
dynamic, self-adjusting array of unsigned char
abstract specification for Viewports
Definition: vtkViewport.h:56
@ vector
Definition: vtkX3D.h:243
A structure to represent pixel coordinates for text or swatch bounds.
vtkTuple< int, 2 > Posn
The position of the box in viewport (pixel) coordinates.
vtkTuple< int, 2 > Size
Size of the box, stored as (thickness, length) not (width, height).