1 // File: VISU_ScalarBarActor.hxx
2 // Created: Wed Feb 26 10:13:15 2003
3 // Author: Alexey PETROV
4 // <apo@ivanox.nnov.matra-dtv.fr>
7 #ifndef VISU_ScalarBarActor_HeaderFile
8 #define VISU_ScalarBarActor_HeaderFile
10 #include <vtkScalarBarActor.h>
11 #include <vtkActor2D.h>
12 #include <vtkScalarsToColors.h>
13 #include <vtkPolyDataMapper2D.h>
14 #include <vtkTextMapper.h>
16 class VISU_LookupTable;
18 #define VTK_ORIENT_HORIZONTAL 0
19 #define VTK_ORIENT_VERTICAL 1
21 class VTK_EXPORT VISU_ScalarBarActor : public vtkActor2D
24 vtkTypeMacro(VISU_ScalarBarActor,vtkActor2D);
25 void PrintSelf(ostream& os, vtkIndent indent);
27 static VISU_ScalarBarActor *New();
29 int RenderOpaqueGeometry(vtkViewport* viewport);
30 int RenderTranslucentGeometry(vtkViewport*) { return 0; };
31 int RenderOverlay(vtkViewport* viewport);
33 virtual void ReleaseGraphicsResources(vtkWindow *);
35 void SetLookupTable(vtkScalarsToColors*);
36 vtkScalarsToColors* GetLookupTable();
38 vtkSetClampMacro(MaximumNumberOfColors, int, 2, VTK_LARGE_INTEGER);
39 vtkGetMacro(MaximumNumberOfColors, int);
41 vtkSetClampMacro(NumberOfLabels, int, 0, 64);
42 vtkGetMacro(NumberOfLabels, int);
44 vtkSetClampMacro(Orientation,int,VTK_ORIENT_HORIZONTAL, VTK_ORIENT_VERTICAL);
45 vtkGetMacro(Orientation, int);
46 void SetOrientationToHorizontal()
47 {this->SetOrientation(VTK_ORIENT_HORIZONTAL);};
48 void SetOrientationToVertical() {this->SetOrientation(VTK_ORIENT_VERTICAL);};
50 vtkSetMacro(Bold, int);
51 vtkGetMacro(Bold, int);
52 vtkBooleanMacro(Bold, int);
54 vtkSetMacro(Italic, int);
55 vtkGetMacro(Italic, int);
56 vtkBooleanMacro(Italic, int);
58 vtkSetMacro(Shadow, int);
59 vtkGetMacro(Shadow, int);
60 vtkBooleanMacro(Shadow, int);
62 vtkSetMacro(FontFamily, int);
63 vtkGetMacro(FontFamily, int);
64 void SetFontFamilyToArial() {this->SetFontFamily(VTK_ARIAL);};
65 void SetFontFamilyToCourier() {this->SetFontFamily(VTK_COURIER);};
66 void SetFontFamilyToTimes() {this->SetFontFamily(VTK_TIMES);};
68 vtkSetStringMacro(LabelFormat);
69 vtkGetStringMacro(LabelFormat);
71 vtkSetStringMacro(Title);
72 vtkGetStringMacro(Title);
74 void ShallowCopy(vtkProp *prop);
77 VISU_ScalarBarActor();
78 ~VISU_ScalarBarActor();
79 VISU_ScalarBarActor(const VISU_ScalarBarActor&);
80 void operator=(const VISU_ScalarBarActor&);
82 VISU_LookupTable* myLookupTable;
84 int MaximumNumberOfColors;
86 int NumberOfLabelsBuilt;
97 vtkTextMapper *TitleMapper;
98 vtkActor2D *TitleActor;
100 vtkTextMapper **TextMappers;
101 vtkActor2D **TextActors;
103 vtkPolyData *ScalarBar;
104 vtkPolyDataMapper2D *ScalarBarMapper;
105 vtkActor2D *ScalarBarActor;
107 vtkTimeStamp BuildTime;
111 void SizeTitle(int *titleSize, int *size, vtkViewport *viewport);
112 void AllocateAndSizeLabels(int *labelSize, int *size,
113 vtkViewport *viewport, float *range);