VTK
vtkScalarBarActorInternal.h
Go to the documentation of this file.
1 #ifndef vtkScalarBarActorInternal_h
2 #define vtkScalarBarActorInternal_h
3 // VTK-HeaderTest-Exclude: vtkScalarBarActorInternal.h
4 
5 #include "vtkColor.h" // for AnnotationColors, LabelColorMap, and tuples
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 
21 template<class T>
22 class vtkSmartVector : public std::vector<vtkSmartPointer<T> >
23 {
24 public:
29  {
30  // NB: This is relatively evil. But much cheaper than copying the array.
31  // It assumes the compiler won't pad the class.
32  return reinterpret_cast<T**>(&((*this)[0]));
33  }
34 };
35 
38 {
41 
50 };
51 
54 {
55 public:
57  {
58  this->Viewport = 0;
59  this->SwatchColors = 0;
60  this->SwatchPts = 0;
61  this->Polys = 0;
62  this->AnnotationBoxes = 0;
63  this->AnnotationBoxesMapper = 0;
64  this->AnnotationBoxesActor = 0;
65  this->AnnotationLeaders = 0;
66  this->AnnotationLeadersMapper = 0;
67  this->AnnotationLeadersActor = 0;
68  this->NanSwatch = 0;
69  this->NanSwatchMapper = 0;
70  this->NanSwatchActor = 0;
71 
72  this->BelowRangeSwatch = 0;
73  this->BelowRangeSwatchMapper = 0;
74  this->BelowRangeSwatchActor = 0;
75 
76  this->AboveRangeSwatch = 0;
77  this->AboveRangeSwatchMapper = 0;
78  this->AboveRangeSwatchActor = 0;
79  }
80 
81  // Define types for smart vectors containing various base classes.
83 
84  // Other vector container types.
85  typedef std::vector<double> DoubleVector;
86  typedef std::vector<vtkColor3ub> ColorVector;
87 
94 
96  double NanSwatchSize;
97 
100 
103 
105  double SwatchPad;
106 
109  int NumNotes;
110 
114 
118 
121  int TL[2]; // VERTICAL => TL={0,1}, HORIZONTAL => TL={1,0}, Size[TL[0]] == width, Size[TL[1]] == height
122 
125 
128 
131 
134 
137 
140 
143 
146 
150 
153 
155  std::map<double, vtkStdString> Labels;
156 
159  std::map<double, vtkColor3ub> LabelColors;
161 
163 
177 
181 
186 };
187 
188 #endif // vtkScalarBarActorInternal_h
a actor that draws 2D data
Definition: vtkActor2D.h:46
object to represent cell connectivity
Definition: vtkCellArray.h:51
represent and manipulate 3D points
Definition: vtkPoints.h:40
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
Internal state for the scalar bar actor shared with subclasses.
int TL[2]
Permutation of (0, 1) that transforms thickness,length into width,height.
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:57
dynamic, self-adjusting array of unsigned char
abstract specification for Viewports
Definition: vtkViewport.h:48
@ vector
Definition: vtkX3D.h:237
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).