VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 "vtkFreeTypeUtilities.h" // for bounding box calculations
7 #include "vtkSmartPointer.h" // for "smart vectors"
8 #include "vtkStdString.h" // for LabelMap
9 
10 #include <map>
11 #include <vector>
12 
13 class vtkActor2D;
14 class vtkCellArray;
15 class vtkTextActor;
16 class vtkPoints;
17 class vtkPolyData;
20 
22 template<class T>
23 class 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 
55 {
56 public:
58  {
59  this->Viewport = 0;
60  this->SwatchColors = 0;
61  this->SwatchPts = 0;
62  this->Polys = 0;
63  this->AnnotationBoxes = 0;
64  this->AnnotationBoxesMapper = 0;
65  this->AnnotationBoxesActor = 0;
66  this->AnnotationLeaders = 0;
67  this->AnnotationLeadersMapper = 0;
68  this->AnnotationLeadersActor = 0;
69  this->NanSwatch = 0;
70  this->NanSwatchMapper = 0;
71  this->NanSwatchActor = 0;
72  }
73 
74  // Define types for smart vectors containing various base classes.
77 
78  // Other vector container types.
79  typedef std::vector<double> DoubleVec;
80  typedef std::vector<vtkColor3ub> ColorVec;
81 
89  float DPI;
91  double NanSwatchSize;
93  double SwatchPad;
95  int NumNotes;
97  int NumColors;
101  int TL[2]; // VERTICAL => TL={0,1}, HORIZONTAL => TL={1,0}, Size[TL[0]] == width, Size[TL[1]] == height
119  std::map<double,vtkStdString> Labels;
121  std::map<double,vtkColor3ub> LabelColors;
123 
125 
126  ActorVec TextActors;
134  std::vector<double> AnnotationAnchors;
135  std::vector<vtkColor3ub> AnnotationColors;
140 };
141 
142 #endif // __vtkScalarBarActorInternal_h
vtkTuple< int, 2 > Size
Size of the box, stored as (thickness, length) not (width, height).
ActorVec TextActors
Cache of classes holding geometry assembled and ready for rendering.
std::vector< double > AnnotationAnchors
Cache of classes holding geometry assembled and ready for rendering.
ActorVec AnnotationLabels
Cache of classes holding geometry assembled and ready for rendering.
vtkTuple< int, 2 > Posn
The position of the box in viewport (pixel) coordinates.
vtkScalarBarBox TitleBox
The bounding box of the scalar bar title text.
vtkScalarBarBox Frame
The bounding box of the entire scalar bar frame.
abstract specification for Viewports
Definition: vtkViewport.h:46
std::vector< vtkColor3ub > AnnotationColors
Cache of classes holding geometry assembled and ready for rendering.
vtkViewport * Viewport
Cache of dimensions fixed during geometry assembly.
vtkPolyData * AnnotationBoxes
Cache of classes holding geometry assembled and ready for rendering.
float DPI
Resolution of the viewport; used to render text at the appropriate detail.
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:44
Internal state for the scalar bar actor shared with subclasses.
vtkPolyDataMapper2D * NanSwatchMapper
Cache of classes holding geometry assembled and ready for rendering.
vtkSmartVector< vtkTextActor > MathActorVec
vtkScalarBarBox NanBox
The bounding box of the NaN swatch.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
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...
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. Scaled or unscaled.
Definition: vtkTextActor.h:55
std::vector< vtkColor3ub > ColorVec
int NumNotes
Number of annotated values (at least lut->GetNumberOfAnnotatedValues(), but maybe more) ...
A vector of smart pointers.
std::map< double, vtkColor3ub > LabelColors
Map from viewport coordinates to the leader line color of each annotation.
vtkPolyData * AnnotationLeaders
Cache of classes holding geometry assembled and ready for rendering.
dynamic, self-adjusting array of unsigned char
int TL[2]
Permutation of (0, 1) that transforms thickness,length into width,height.
object to represent cell connectivity
Definition: vtkCellArray.h:49
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.
double NanSwatchSize
The thickness and length of the (square) NaN swatch.
vtkSmartVector< vtkTextActor > ActorVec
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.
std::map< double, vtkStdString > Labels
Map from viewport coordinates to label text of each annotation.
vtkCellArray * Polys
Cells representing color swatches (for the scalar bar actor)
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.
draw vtkPolyData onto the image plane
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkScalarBarBox TickBox
The bounding box of tick mark anchor points (tick labels are not fully contained) ...