VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Rendering/Annotation/vtkScalarBarActorInternal.h
Go to the documentation of this file.
00001 #ifndef vtkScalarBarActorInternal_h
00002 #define vtkScalarBarActorInternal_h
00003 // VTK-HeaderTest-Exclude: vtkScalarBarActorInternal.h
00004 
00005 #include "vtkColor.h" // for AnnotationColors, LabelColorMap, and tuples
00006 #include "vtkFreeTypeUtilities.h" // for bounding box calculations
00007 #include "vtkSmartPointer.h" // for "smart vectors"
00008 #include "vtkStdString.h" // for LabelMap
00009 
00010 #include <map>
00011 #include <vector>
00012 
00013 class vtkActor2D;
00014 class vtkCellArray;
00015 class vtkTextActor;
00016 class vtkPoints;
00017 class vtkPolyData;
00018 class vtkPolyDataMapper2D;
00019 class vtkUnsignedCharArray;
00020 
00022 template<class T>
00023 class vtkSmartVector : public std::vector<vtkSmartPointer<T> >
00024 {
00025 public:
00029   T** PointerArray()
00030     {
00031     // NB: This is relatively evil. But much cheaper than copying the array.
00032     // It assumes the compiler won't pad the class.
00033     return reinterpret_cast<T**>(&((*this)[0]));
00034     }
00035 };
00036 
00038 struct vtkScalarBarBox
00039 {
00041   vtkTuple<int,2> Posn;
00042 
00050   vtkTuple<int,2> Size;
00051 };
00052 
00054 class vtkScalarBarActorInternal
00055 {
00056 public:
00057   vtkScalarBarActorInternal()
00058     {
00059     this->Viewport = 0;
00060     this->SwatchColors = 0;
00061     this->SwatchPts = 0;
00062     this->Polys = 0;
00063     this->AnnotationBoxes = 0;
00064     this->AnnotationBoxesMapper = 0;
00065     this->AnnotationBoxesActor = 0;
00066     this->AnnotationLeaders = 0;
00067     this->AnnotationLeadersMapper = 0;
00068     this->AnnotationLeadersActor = 0;
00069     this->NanSwatch = 0;
00070     this->NanSwatchMapper = 0;
00071     this->NanSwatchActor = 0;
00072     }
00073 
00074   // Define types for smart vectors containing various base classes.
00075   typedef vtkSmartVector<vtkTextActor> ActorVector;
00076 
00077   // Other vector container types.
00078   typedef std::vector<double>      DoubleVector;
00079   typedef std::vector<vtkColor3ub> ColorVector;
00080 
00086   vtkViewport* Viewport;
00087 
00089   double NanSwatchSize;
00090 
00092   double SwatchPad;
00093 
00096   int NumNotes;
00097 
00100   int NumColors;
00101 
00104   int NumSwatches;
00105 
00108   int TL[2]; // VERTICAL => TL={0,1}, HORIZONTAL => TL={1,0}, Size[TL[0]] == width, Size[TL[1]] == height
00109 
00111   vtkPoints* SwatchPts;
00112 
00114   vtkCellArray* Polys;
00115 
00117   vtkUnsignedCharArray* SwatchColors;
00118 
00120   vtkScalarBarBox Frame;
00121 
00123   vtkScalarBarBox ScalarBarBox;
00124 
00126   vtkScalarBarBox NanBox;
00127 
00130   vtkScalarBarBox TickBox;
00131 
00133   vtkScalarBarBox TitleBox;
00134 
00136   std::map<double,vtkStdString> Labels;
00137 
00140   std::map<double,vtkColor3ub> LabelColors;
00142 
00144 
00145   ActorVector          TextActors;
00146   vtkPolyData*         AnnotationBoxes;
00147   vtkPolyDataMapper2D* AnnotationBoxesMapper;
00148   vtkActor2D*          AnnotationBoxesActor;
00149   vtkPolyData*         AnnotationLeaders;
00150   vtkPolyDataMapper2D* AnnotationLeadersMapper;
00151   vtkActor2D*          AnnotationLeadersActor;
00152   ActorVector          AnnotationLabels;
00153   DoubleVector         AnnotationAnchors;
00154   ColorVector          AnnotationColors;
00155   vtkPolyData*         NanSwatch;
00156   vtkPolyDataMapper2D* NanSwatchMapper;
00157   vtkActor2D*          NanSwatchActor;
00159 };
00160 
00161 #endif // vtkScalarBarActorInternal_h