00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00079 #ifndef __vtkScalarBarActor_h
00080 #define __vtkScalarBarActor_h
00081
00082 #include "vtkActor2D.h"
00083 #include "vtkScalarsToColors.h"
00084 #include "vtkPolyDataMapper2D.h"
00085 #include "vtkTextMapper.h"
00086
00087 #define VTK_ORIENT_HORIZONTAL 0
00088 #define VTK_ORIENT_VERTICAL 1
00089
00090 class VTK_RENDERING_EXPORT vtkScalarBarActor : public vtkActor2D
00091 {
00092 public:
00093 vtkTypeMacro(vtkScalarBarActor,vtkActor2D);
00094 void PrintSelf(ostream& os, vtkIndent indent);
00095
00100 static vtkScalarBarActor *New();
00101
00102
00104
00105 int RenderOpaqueGeometry(vtkViewport* viewport);
00106 int RenderTranslucentGeometry(vtkViewport*) { return 0; };
00107 int RenderOverlay(vtkViewport* viewport);
00109
00113 virtual void ReleaseGraphicsResources(vtkWindow *);
00114
00116
00119 vtkSetObjectMacro(LookupTable,vtkScalarsToColors);
00120 vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
00122
00124
00127 vtkSetClampMacro(MaximumNumberOfColors, int, 2, VTK_LARGE_INTEGER);
00128 vtkGetMacro(MaximumNumberOfColors, int);
00130
00132
00133 vtkSetClampMacro(NumberOfLabels, int, 0, 64);
00134 vtkGetMacro(NumberOfLabels, int);
00136
00138
00139 vtkSetClampMacro(Orientation,int,VTK_ORIENT_HORIZONTAL, VTK_ORIENT_VERTICAL);
00140 vtkGetMacro(Orientation, int);
00141 void SetOrientationToHorizontal()
00142 {this->SetOrientation(VTK_ORIENT_HORIZONTAL);};
00143 void SetOrientationToVertical() {this->SetOrientation(VTK_ORIENT_VERTICAL);};
00145
00147
00148 vtkSetMacro(Bold, int);
00149 vtkGetMacro(Bold, int);
00150 vtkBooleanMacro(Bold, int);
00152
00154
00155 vtkSetMacro(Italic, int);
00156 vtkGetMacro(Italic, int);
00157 vtkBooleanMacro(Italic, int);
00159
00161
00163 vtkSetMacro(Shadow, int);
00164 vtkGetMacro(Shadow, int);
00165 vtkBooleanMacro(Shadow, int);
00167
00169
00172 vtkSetMacro(FontFamily, int);
00173 vtkGetMacro(FontFamily, int);
00174 void SetFontFamilyToArial() {this->SetFontFamily(VTK_ARIAL);};
00175 void SetFontFamilyToCourier() {this->SetFontFamily(VTK_COURIER);};
00176 void SetFontFamilyToTimes() {this->SetFontFamily(VTK_TIMES);};
00178
00180
00181 vtkSetStringMacro(LabelFormat);
00182 vtkGetStringMacro(LabelFormat);
00184
00186
00187 vtkSetStringMacro(Title);
00188 vtkGetStringMacro(Title);
00190
00193 void ShallowCopy(vtkProp *prop);
00194
00195 protected:
00196 vtkScalarBarActor();
00197 ~vtkScalarBarActor();
00198
00199 vtkScalarsToColors *LookupTable;
00200 int MaximumNumberOfColors;
00201 int NumberOfLabels;
00202 int NumberOfLabelsBuilt;
00203 int Orientation;
00204 char *Title;
00205
00206 int Bold;
00207 int Italic;
00208 int Shadow;
00209 int FontFamily;
00210 char *LabelFormat;
00211
00212 private:
00213 vtkTextMapper *TitleMapper;
00214 vtkActor2D *TitleActor;
00215
00216 vtkTextMapper **TextMappers;
00217 vtkActor2D **TextActors;
00218
00219 vtkPolyData *ScalarBar;
00220 vtkPolyDataMapper2D *ScalarBarMapper;
00221 vtkActor2D *ScalarBarActor;
00222
00223 vtkTimeStamp BuildTime;
00224 int LastSize[2];
00225 int LastOrigin[2];
00226
00227 void SizeTitle(int *titleSize, int *size, vtkViewport *viewport);
00228 void AllocateAndSizeLabels(int *labelSize, int *size,
00229 vtkViewport *viewport, float *range);
00230 private:
00231 vtkScalarBarActor(const vtkScalarBarActor&);
00232 void operator=(const vtkScalarBarActor&);
00233 };
00234
00235
00236 #endif
00237