Rendering/vtkScalarBarActor.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00062 #ifndef __vtkScalarBarActor_h
00063 #define __vtkScalarBarActor_h
00064
00065 #include "vtkActor2D.h"
00066
00067 class vtkPolyData;
00068 class vtkPolyDataMapper2D;
00069 class vtkScalarsToColors;
00070 class vtkTextMapper;
00071 class vtkTextProperty;
00072
00073 #define VTK_ORIENT_HORIZONTAL 0
00074 #define VTK_ORIENT_VERTICAL 1
00075
00076 class VTK_RENDERING_EXPORT vtkScalarBarActor : public vtkActor2D
00077 {
00078 public:
00079 vtkTypeRevisionMacro(vtkScalarBarActor,vtkActor2D);
00080 void PrintSelf(ostream& os, vtkIndent indent);
00081
00085 static vtkScalarBarActor *New();
00086
00088
00089 int RenderOpaqueGeometry(vtkViewport* viewport);
00090 int RenderTranslucentGeometry(vtkViewport*) { return 0; };
00091 int RenderOverlay(vtkViewport* viewport);
00093
00097 virtual void ReleaseGraphicsResources(vtkWindow *);
00098
00100
00103 virtual void SetLookupTable(vtkScalarsToColors*);
00104 vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
00106
00108
00111 vtkSetClampMacro(MaximumNumberOfColors, int, 2, VTK_LARGE_INTEGER);
00112 vtkGetMacro(MaximumNumberOfColors, int);
00114
00116
00117 vtkSetClampMacro(NumberOfLabels, int, 0, 64);
00118 vtkGetMacro(NumberOfLabels, int);
00120
00122
00123 vtkSetClampMacro(Orientation,int,VTK_ORIENT_HORIZONTAL, VTK_ORIENT_VERTICAL);
00124 vtkGetMacro(Orientation, int);
00125 void SetOrientationToHorizontal()
00126 {this->SetOrientation(VTK_ORIENT_HORIZONTAL);};
00127 void SetOrientationToVertical() {this->SetOrientation(VTK_ORIENT_VERTICAL);};
00129
00131
00132 virtual void SetTitleTextProperty(vtkTextProperty *p);
00133 vtkGetObjectMacro(TitleTextProperty,vtkTextProperty);
00135
00137
00138 virtual void SetLabelTextProperty(vtkTextProperty *p);
00139 vtkGetObjectMacro(LabelTextProperty,vtkTextProperty);
00141
00142 #ifndef VTK_REMOVE_LEGACY_CODE
00143
00144
00149 virtual void SetFontFamily(int val);
00150 virtual int GetFontFamily();
00151 void SetFontFamilyToArial() { this->SetFontFamily(VTK_ARIAL); };
00152 void SetFontFamilyToCourier() { this->SetFontFamily(VTK_COURIER);};
00153 void SetFontFamilyToTimes() { this->SetFontFamily(VTK_TIMES); };
00155 #endif
00156
00157 #ifndef VTK_REMOVE_LEGACY_CODE
00158
00159
00162 virtual void SetBold(int val);
00163 virtual int GetBold();
00164 vtkBooleanMacro(Bold, int);
00166 #endif
00167
00168 #ifndef VTK_REMOVE_LEGACY_CODE
00169
00170
00173 virtual void SetItalic(int val);
00174 virtual int GetItalic();
00175 vtkBooleanMacro(Italic, int);
00177 #endif
00178
00179 #ifndef VTK_REMOVE_LEGACY_CODE
00180
00181
00184 virtual void SetShadow(int val);
00185 virtual int GetShadow();
00186 vtkBooleanMacro(Shadow, int);
00188 #endif
00189
00191
00192 vtkSetStringMacro(LabelFormat);
00193 vtkGetStringMacro(LabelFormat);
00195
00197
00198 vtkSetStringMacro(Title);
00199 vtkGetStringMacro(Title);
00201
00204 void ShallowCopy(vtkProp *prop);
00205
00206 protected:
00207 vtkScalarBarActor();
00208 ~vtkScalarBarActor();
00209
00210 vtkScalarsToColors *LookupTable;
00211 vtkTextProperty *TitleTextProperty;
00212 vtkTextProperty *LabelTextProperty;
00213
00214 int MaximumNumberOfColors;
00215 int NumberOfLabels;
00216 int NumberOfLabelsBuilt;
00217 int Orientation;
00218 char *Title;
00219 char *LabelFormat;
00220
00221 vtkTextMapper **TextMappers;
00222 virtual void AllocateAndSizeLabels(int *labelSize, int *size,
00223 vtkViewport *viewport, float *range);
00224
00225 private:
00226 vtkTextMapper *TitleMapper;
00227 vtkActor2D *TitleActor;
00228
00229 vtkActor2D **TextActors;
00230
00231 vtkPolyData *ScalarBar;
00232 vtkPolyDataMapper2D *ScalarBarMapper;
00233 vtkActor2D *ScalarBarActor;
00234
00235 vtkTimeStamp BuildTime;
00236 int LastSize[2];
00237 int LastOrigin[2];
00238
00239 void SizeTitle(int *titleSize, int *size, vtkViewport *viewport);
00240
00241 private:
00242 vtkScalarBarActor(const vtkScalarBarActor&);
00243 void operator=(const vtkScalarBarActor&);
00244 };
00245
00246
00247 #endif
00248