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 
00105   void SetText(int i, const char *text);
00106   const char* GetText(int i);
00107   void ClearAllTexts();
00108   void CopyAllTextsFrom(vtkCornerAnnotation *ca);
00110 
00112 
00113   void SetImageActor(vtkImageActor*);
00114   vtkGetObjectMacro(ImageActor,vtkImageActor);
00116 
00118 
00120   void SetWindowLevel(vtkImageMapToWindowLevelColors*);
00121   vtkGetObjectMacro(WindowLevel,vtkImageMapToWindowLevelColors);
00123 
00125 
00126   vtkSetMacro(LevelShift, double);
00127   vtkGetMacro(LevelShift, double);
00129 
00131 
00132   vtkSetMacro(LevelScale, double);
00133   vtkGetMacro(LevelScale, double);
00135 
00137 
00138   virtual void SetTextProperty(vtkTextProperty *p);
00139   vtkGetObjectMacro(TextProperty,vtkTextProperty);
00141 
00143 
00145   vtkBooleanMacro(ShowSliceAndImage, int);
00146   vtkSetMacro(ShowSliceAndImage, int);
00147   vtkGetMacro(ShowSliceAndImage, int);
00149 
00150 protected:
00151   vtkCornerAnnotation();
00152   ~vtkCornerAnnotation();
00153 
00154   double MaximumLineHeight;
00155 
00156   vtkTextProperty *TextProperty;
00157 
00158   vtkImageMapToWindowLevelColors *WindowLevel;
00159   double LevelShift;
00160   double LevelScale;
00161   vtkImageActor *ImageActor;
00162   vtkImageActor *LastImageActor;
00163 
00164   char *CornerText[4];
00165 
00166   int FontSize;
00167   vtkActor2D    *TextActor[4];
00168   vtkTimeStamp   BuildTime;
00169   int            LastSize[2];
00170   vtkTextMapper *TextMapper[4];
00171 
00172   int MinimumFontSize;
00173   int MaximumFontSize;
00174 
00175   double LinearFontScaleFactor;
00176   double NonlinearFontScaleFactor;
00177 
00178   int ShowSliceAndImage;
00179 
00181 
00182   virtual void TextReplace(
00183     vtkImageActor *ia, vtkImageMapToWindowLevelColors *wl);
00185 
00187 
00188   virtual void SetTextActorsPosition(int vsize[2]);
00189   virtual void SetTextActorsJustification();
00191 
00192 private:
00193   vtkCornerAnnotation(const vtkCornerAnnotation&);  // Not implemented.
00194   void operator=(const vtkCornerAnnotation&);  // Not implemented.
00195 };
00196 
00197 
00198 #endif
00199 
00200 
00201