VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Rendering/Annotation/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 =========================================================================*/
00038 #ifndef vtkCornerAnnotation_h
00039 #define vtkCornerAnnotation_h
00040 
00041 #include "vtkRenderingAnnotationModule.h" // For export macro
00042 #include "vtkActor2D.h"
00043 
00044 class vtkTextMapper;
00045 class vtkImageMapToWindowLevelColors;
00046 class vtkImageActor;
00047 class vtkTextProperty;
00048 
00049 class VTKRENDERINGANNOTATION_EXPORT vtkCornerAnnotation : public vtkActor2D
00050 {
00051 public:
00052   vtkTypeMacro(vtkCornerAnnotation,vtkActor2D);
00053   void PrintSelf(ostream& os, vtkIndent indent);
00054 
00057   static vtkCornerAnnotation *New();
00058 
00060 
00061   int RenderOpaqueGeometry(vtkViewport* viewport);
00062   virtual int RenderTranslucentPolygonalGeometry(vtkViewport* ) {return 0;};
00063   int RenderOverlay(vtkViewport* viewport);
00065 
00067   virtual int HasTranslucentPolygonalGeometry();
00068 
00070 
00072   vtkSetMacro(MaximumLineHeight,double);
00073   vtkGetMacro(MaximumLineHeight,double);
00075 
00077 
00079   vtkSetMacro(MinimumFontSize,int);
00080   vtkGetMacro(MinimumFontSize,int);
00081   vtkSetMacro(MaximumFontSize,int);
00082   vtkGetMacro(MaximumFontSize,int);
00084 
00086 
00092   vtkSetMacro( LinearFontScaleFactor, double );
00093   vtkGetMacro( LinearFontScaleFactor, double );
00094   vtkSetMacro( NonlinearFontScaleFactor, double );
00095   vtkGetMacro( NonlinearFontScaleFactor, double );
00097 
00101   virtual void ReleaseGraphicsResources(vtkWindow *);
00102 
00104 
00106   enum TextPosition
00107     {
00108     LowerLeft = 0, 
00109     LowerRight,    
00110     UpperLeft,     
00111     UpperRight     
00112     };
00114 
00116 
00117   void SetText(int i, const char *text);
00118   const char* GetText(int i);
00119   void ClearAllTexts();
00120   void CopyAllTextsFrom(vtkCornerAnnotation *ca);
00122 
00124 
00125   void SetImageActor(vtkImageActor*);
00126   vtkGetObjectMacro(ImageActor,vtkImageActor);
00128 
00130 
00132   void SetWindowLevel(vtkImageMapToWindowLevelColors*);
00133   vtkGetObjectMacro(WindowLevel,vtkImageMapToWindowLevelColors);
00135 
00137 
00138   vtkSetMacro(LevelShift, double);
00139   vtkGetMacro(LevelShift, double);
00141 
00143 
00144   vtkSetMacro(LevelScale, double);
00145   vtkGetMacro(LevelScale, double);
00147 
00149 
00150   virtual void SetTextProperty(vtkTextProperty *p);
00151   vtkGetObjectMacro(TextProperty,vtkTextProperty);
00153 
00155 
00157   vtkBooleanMacro(ShowSliceAndImage, int);
00158   vtkSetMacro(ShowSliceAndImage, int);
00159   vtkGetMacro(ShowSliceAndImage, int);
00161 
00162 protected:
00163   vtkCornerAnnotation();
00164   ~vtkCornerAnnotation();
00165 
00166   double MaximumLineHeight;
00167 
00168   vtkTextProperty *TextProperty;
00169 
00170   vtkImageMapToWindowLevelColors *WindowLevel;
00171   double LevelShift;
00172   double LevelScale;
00173   vtkImageActor *ImageActor;
00174   vtkImageActor *LastImageActor;
00175 
00176   char *CornerText[4];
00177 
00178   int FontSize;
00179   vtkActor2D    *TextActor[4];
00180   vtkTimeStamp   BuildTime;
00181   int            LastSize[2];
00182   vtkTextMapper *TextMapper[4];
00183 
00184   int MinimumFontSize;
00185   int MaximumFontSize;
00186 
00187   double LinearFontScaleFactor;
00188   double NonlinearFontScaleFactor;
00189 
00190   int ShowSliceAndImage;
00191 
00193 
00194   virtual void TextReplace(
00195     vtkImageActor *ia, vtkImageMapToWindowLevelColors *wl);
00197 
00199 
00200   virtual void SetTextActorsPosition(int vsize[2]);
00201   virtual void SetTextActorsJustification();
00203 
00204 private:
00205   vtkCornerAnnotation(const vtkCornerAnnotation&);  // Not implemented.
00206   void operator=(const vtkCornerAnnotation&);  // Not implemented.
00207 };
00208 
00209 
00210 #endif
00211 
00212 
00213