00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00022 #ifndef __vtkLabelRenderStrategy_h
00023 #define __vtkLabelRenderStrategy_h
00024
00025 #include "vtkObject.h"
00026
00027 #include "vtkStdString.h"
00028 #include "vtkUnicodeString.h"
00029
00030 class vtkRenderer;
00031 class vtkWindow;
00032 class vtkTextProperty;
00033
00034 class VTK_RENDERING_EXPORT vtkLabelRenderStrategy : public vtkObject
00035 {
00036 public:
00037 void PrintSelf(ostream& os, vtkIndent indent);
00038 vtkTypeMacro(vtkLabelRenderStrategy, vtkObject);
00039
00041
00044 virtual bool SupportsRotation()
00045 { return true; }
00047
00049
00054 virtual bool SupportsBoundedSize()
00055 { return true; }
00057
00059
00060 virtual void SetRenderer(vtkRenderer* ren);
00061 vtkGetObjectMacro(Renderer, vtkRenderer);
00063
00065
00066 virtual void SetDefaultTextProperty(vtkTextProperty* tprop);
00067 vtkGetObjectMacro(DefaultTextProperty, vtkTextProperty);
00069
00070
00072
00075 virtual void ComputeLabelBounds(vtkTextProperty* tprop, vtkStdString label, double bds[4])
00076 { this->ComputeLabelBounds(tprop, vtkUnicodeString::from_utf8(label.c_str()), bds); }
00077 virtual void ComputeLabelBounds(vtkTextProperty* tprop, vtkUnicodeString label, double bds[4]) = 0;
00079
00081
00088 virtual void RenderLabel(int x[2], vtkTextProperty* tprop, vtkStdString label)
00089 { this->RenderLabel(x, tprop, vtkUnicodeString::from_utf8(label)); }
00090 virtual void RenderLabel(int x[2], vtkTextProperty* tprop, vtkStdString label, int maxWidth)
00091 { this->RenderLabel(x, tprop, vtkUnicodeString::from_utf8(label), maxWidth); }
00092 virtual void RenderLabel(int x[2], vtkTextProperty* tprop, vtkUnicodeString label) = 0;
00093 virtual void RenderLabel(int x[2], vtkTextProperty* tprop, vtkUnicodeString label, int vtkNotUsed(maxWidth))
00094 { this->RenderLabel(x, tprop, label); }
00095
00097
00099 virtual void StartFrame() { }
00100
00102 virtual void EndFrame() { }
00103
00107 virtual void ReleaseGraphicsResources(vtkWindow *) { }
00108
00109 protected:
00110 vtkLabelRenderStrategy();
00111 ~vtkLabelRenderStrategy();
00112
00113 vtkRenderer* Renderer;
00114 vtkTextProperty* DefaultTextProperty;
00115
00116 private:
00117 vtkLabelRenderStrategy(const vtkLabelRenderStrategy&);
00118 void operator=(const vtkLabelRenderStrategy&);
00119 };
00120
00121 #endif
00122