00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00025 #ifndef __vtkCornerAnnotation_h
00026 #define __vtkCornerAnnotation_h
00027
00028 #include "vtkActor2D.h"
00029
00030 class vtkTextMapper;
00031 class vtkImageMapToWindowLevelColors;
00032 class vtkImageActor;
00033 class vtkTextProperty;
00034
00035 class VTK_HYBRID_EXPORT vtkCornerAnnotation : public vtkActor2D
00036 {
00037 public:
00038 vtkTypeMacro(vtkCornerAnnotation,vtkActor2D);
00039 void PrintSelf(ostream& os, vtkIndent indent);
00040
00043 static vtkCornerAnnotation *New();
00044
00046
00047 int RenderOpaqueGeometry(vtkViewport* viewport);
00048 virtual int RenderTranslucentPolygonalGeometry(vtkViewport* ) {return 0;};
00049 int RenderOverlay(vtkViewport* viewport);
00051
00053 virtual int HasTranslucentPolygonalGeometry();
00054
00056
00058 vtkSetMacro(MaximumLineHeight,double);
00059 vtkGetMacro(MaximumLineHeight,double);
00061
00063
00065 vtkSetMacro(MinimumFontSize,int);
00066 vtkGetMacro(MinimumFontSize,int);
00067 vtkSetMacro(MaximumFontSize,int);
00068 vtkGetMacro(MaximumFontSize,int);
00070
00072
00078 vtkSetMacro( LinearFontScaleFactor, double );
00079 vtkGetMacro( LinearFontScaleFactor, double );
00080 vtkSetMacro( NonlinearFontScaleFactor, double );
00081 vtkGetMacro( NonlinearFontScaleFactor, double );
00083
00087 virtual void ReleaseGraphicsResources(vtkWindow *);
00088
00090
00091 void SetText(int i, const char *text);
00092 const char* GetText(int i);
00093 void ClearAllTexts();
00094 void CopyAllTextsFrom(vtkCornerAnnotation *ca);
00096
00098
00099 void SetImageActor(vtkImageActor*);
00100 vtkGetObjectMacro(ImageActor,vtkImageActor);
00102
00104
00106 void SetWindowLevel(vtkImageMapToWindowLevelColors*);
00107 vtkGetObjectMacro(WindowLevel,vtkImageMapToWindowLevelColors);
00109
00111
00112 vtkSetMacro(LevelShift, double);
00113 vtkGetMacro(LevelShift, double);
00115
00117
00118 vtkSetMacro(LevelScale, double);
00119 vtkGetMacro(LevelScale, double);
00121
00123
00124 virtual void SetTextProperty(vtkTextProperty *p);
00125 vtkGetObjectMacro(TextProperty,vtkTextProperty);
00127
00129
00131 vtkBooleanMacro(ShowSliceAndImage, int);
00132 vtkSetMacro(ShowSliceAndImage, int);
00133 vtkGetMacro(ShowSliceAndImage, int);
00135
00136 protected:
00137 vtkCornerAnnotation();
00138 ~vtkCornerAnnotation();
00139
00140 double MaximumLineHeight;
00141
00142 vtkTextProperty *TextProperty;
00143
00144 vtkImageMapToWindowLevelColors *WindowLevel;
00145 double LevelShift;
00146 double LevelScale;
00147 vtkImageActor *ImageActor;
00148 vtkImageActor *LastImageActor;
00149
00150 char *CornerText[4];
00151
00152 int FontSize;
00153 vtkActor2D *TextActor[4];
00154 vtkTimeStamp BuildTime;
00155 int LastSize[2];
00156 vtkTextMapper *TextMapper[4];
00157
00158 int MinimumFontSize;
00159 int MaximumFontSize;
00160
00161 double LinearFontScaleFactor;
00162 double NonlinearFontScaleFactor;
00163
00164 int ShowSliceAndImage;
00165
00167
00168 virtual void TextReplace(
00169 vtkImageActor *ia, vtkImageMapToWindowLevelColors *wl);
00171
00173
00174 virtual void SetTextActorsPosition(int vsize[2]);
00175 virtual void SetTextActorsJustification();
00177
00178 private:
00179 vtkCornerAnnotation(const vtkCornerAnnotation&);
00180 void operator=(const vtkCornerAnnotation&);
00181 };
00182
00183
00184 #endif
00185
00186
00187