VTK
dox/Hybrid/vtkCornerAnnotation.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkCornerAnnotation.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00035 #ifndef __vtkCornerAnnotation_h
00036 #define __vtkCornerAnnotation_h
00037 
00038 #include "vtkActor2D.h"
00039 
00040 class vtkTextMapper;
00041 class vtkImageMapToWindowLevelColors;
00042 class vtkImageActor;
00043 class vtkTextProperty;
00044 
00045 class VTK_HYBRID_EXPORT vtkCornerAnnotation : public vtkActor2D
00046 {
00047 public:
00048   vtkTypeMacro(vtkCornerAnnotation,vtkActor2D);
00049   void PrintSelf(ostream& os, vtkIndent indent);
00050 
00053   static vtkCornerAnnotation *New();
00054   
00056 
00057   int RenderOpaqueGeometry(vtkViewport* viewport);
00058   virtual int RenderTranslucentPolygonalGeometry(vtkViewport* ) {return 0;};
00059   int RenderOverlay(vtkViewport* viewport);
00061 
00063   virtual int HasTranslucentPolygonalGeometry();
00064   
00066 
00068   vtkSetMacro(MaximumLineHeight,double);
00069   vtkGetMacro(MaximumLineHeight,double);
00071   
00073 
00075   vtkSetMacro(MinimumFontSize,int);
00076   vtkGetMacro(MinimumFontSize,int);
00077   vtkSetMacro(MaximumFontSize,int);
00078   vtkGetMacro(MaximumFontSize,int);
00080 
00082 
00088   vtkSetMacro( LinearFontScaleFactor, double );
00089   vtkGetMacro( LinearFontScaleFactor, double );
00090   vtkSetMacro( NonlinearFontScaleFactor, double );
00091   vtkGetMacro( NonlinearFontScaleFactor, double );
00093 
00097   virtual void ReleaseGraphicsResources(vtkWindow *);
00098 
00100 
00101   void SetText(int i, const char *text);
00102   const char* GetText(int i);
00103   void ClearAllTexts();
00104   void CopyAllTextsFrom(vtkCornerAnnotation *ca);
00106 
00108 
00109   void SetImageActor(vtkImageActor*);
00110   vtkGetObjectMacro(ImageActor,vtkImageActor);
00112   
00114 
00116   void SetWindowLevel(vtkImageMapToWindowLevelColors*);
00117   vtkGetObjectMacro(WindowLevel,vtkImageMapToWindowLevelColors);
00119 
00121 
00122   vtkSetMacro(LevelShift, double);
00123   vtkGetMacro(LevelShift, double);
00125   
00127 
00128   vtkSetMacro(LevelScale, double);
00129   vtkGetMacro(LevelScale, double);
00131   
00133 
00134   virtual void SetTextProperty(vtkTextProperty *p);
00135   vtkGetObjectMacro(TextProperty,vtkTextProperty);
00137 
00139 
00141   vtkBooleanMacro(ShowSliceAndImage, int);
00142   vtkSetMacro(ShowSliceAndImage, int);
00143   vtkGetMacro(ShowSliceAndImage, int);
00145   
00146 protected:
00147   vtkCornerAnnotation();
00148   ~vtkCornerAnnotation();
00149 
00150   double MaximumLineHeight;
00151 
00152   vtkTextProperty *TextProperty;
00153 
00154   vtkImageMapToWindowLevelColors *WindowLevel;
00155   double LevelShift;
00156   double LevelScale;
00157   vtkImageActor *ImageActor;
00158   vtkImageActor *LastImageActor;
00159 
00160   char *CornerText[4];
00161   
00162   int FontSize;
00163   vtkActor2D    *TextActor[4];
00164   vtkTimeStamp   BuildTime;
00165   int            LastSize[2];
00166   vtkTextMapper *TextMapper[4];
00167 
00168   int MinimumFontSize;
00169   int MaximumFontSize;
00170 
00171   double LinearFontScaleFactor;
00172   double NonlinearFontScaleFactor;
00173   
00174   int ShowSliceAndImage;
00175   
00177 
00178   virtual void TextReplace(
00179     vtkImageActor *ia, vtkImageMapToWindowLevelColors *wl);
00181 
00183 
00184   virtual void SetTextActorsPosition(int vsize[2]);
00185   virtual void SetTextActorsJustification();
00187 
00188 private:
00189   vtkCornerAnnotation(const vtkCornerAnnotation&);  // Not implemented.
00190   void operator=(const vtkCornerAnnotation&);  // Not implemented.
00191 };
00192 
00193 
00194 #endif
00195 
00196 
00197