VTK  9.0.2
vtkScalarBarActorInternal.h
Go to the documentation of this file.
1 #ifndef vtkScalarBarActorInternal_h
2 #define vtkScalarBarActorInternal_h
3 
4 #ifndef __VTK_WRAP__
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 class vtkActor2D;
15 class vtkCellArray;
16 class vtkTextActor;
17 class vtkPoints;
18 class vtkPolyData;
21 class vtkViewport;
22 
24 template <class T>
25 class VTKRENDERINGANNOTATION_EXPORT vtkSmartVector : public std::vector<vtkSmartPointer<T> >
26 {
27 public:
32  {
33  // NB: This is relatively evil. But much cheaper than copying the array.
34  // It assumes the compiler won't pad the class.
35  return reinterpret_cast<T**>(&((*this)[0]));
36  }
37 };
38 
41 {
44 
53 };
54 
56 class VTKRENDERINGANNOTATION_EXPORT vtkScalarBarActorInternal
57 {
58 public:
60  {
61  this->Viewport = nullptr;
62  this->SwatchColors = nullptr;
63  this->SwatchPts = nullptr;
64  this->Polys = nullptr;
65  this->AnnotationBoxes = nullptr;
66  this->AnnotationBoxesMapper = nullptr;
67  this->AnnotationBoxesActor = nullptr;
68  this->AnnotationLeaders = nullptr;
69  this->AnnotationLeadersMapper = nullptr;
70  this->AnnotationLeadersActor = nullptr;
71  this->NanSwatch = nullptr;
72  this->NanSwatchMapper = nullptr;
73  this->NanSwatchActor = nullptr;
74 
75  this->BelowRangeSwatch = nullptr;
76  this->BelowRangeSwatchMapper = nullptr;
77  this->BelowRangeSwatchActor = nullptr;
78 
79  this->AboveRangeSwatch = nullptr;
80  this->AboveRangeSwatchMapper = nullptr;
81  this->AboveRangeSwatchActor = nullptr;
82  }
83 
84  // Define types for smart vectors containing various base classes.
86 
87  // Other vector container types.
88  typedef std::vector<double> DoubleVector;
89  typedef std::vector<vtkColor3ub> ColorVector;
90 
97 
99  double NanSwatchSize;
100 
103 
106 
108  double SwatchPad;
109 
112  int NumNotes;
113 
117 
121 
124  int TL[2]; // VERTICAL => TL={0,1}, HORIZONTAL => TL={1,0}, Size[TL[0]] == width, Size[TL[1]] ==
125  // height
126 
129 
132 
135 
138 
141 
144 
147 
150 
154 
157 
159  std::map<double, vtkStdString> Labels;
160 
163  std::map<double, vtkColor3ub> LabelColors;
165 
167 
181 
185 
190 };
191 
192 #endif
193 
194 #endif // vtkScalarBarActorInternal_h
195 // VTK-HeaderTest-Exclude: vtkScalarBarActorInternal.h
a actor that draws 2D data
Definition: vtkActor2D.h:40
object to represent cell connectivity
Definition: vtkCellArray.h:180
represent and manipulate 3D points
Definition: vtkPoints.h:34
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
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.
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.
std::map< double, vtkColor3ub > LabelColors
Map from viewport coordinates to the leader line color of each annotation.
vtkPolyDataMapper2D * AnnotationLeadersMapper
vtkScalarBarBox NanBox
The bounding box of the NaN swatch.
vtkViewport * Viewport
Cache of dimensions fixed during geometry assembly.
std::vector< double > DoubleVector
vtkPolyDataMapper2D * NanSwatchMapper
vtkScalarBarBox AboveRangeSwatchBox
The bounding box of the Above Range.
vtkScalarBarBox TickBox
The bounding box of tick mark anchor points (tick labels are not fully contained)
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.
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
vtkPolyDataMapper2D * AboveRangeSwatchMapper
vtkPolyDataMapper2D * AnnotationBoxesMapper
std::map< double, vtkStdString > Labels
Map from viewport coordinates to label text of each annotation.
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:51
dynamic, self-adjusting array of unsigned char
abstract specification for Viewports
Definition: vtkViewport.h:45
@ 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).