Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkTextProperty.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkTextProperty.h,v $
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 =========================================================================*/
00032 #ifndef __vtkTextProperty_h
00033 #define __vtkTextProperty_h
00034 
00035 #include "vtkObject.h"
00036 
00037 class VTK_RENDERING_EXPORT vtkTextProperty : public vtkObject
00038 {
00039 public:
00040   vtkTypeRevisionMacro(vtkTextProperty,vtkObject);
00041   void PrintSelf(ostream& os, vtkIndent indent);
00042 
00045   static vtkTextProperty *New();
00046 
00048 
00049   vtkSetVector3Macro(Color,double);
00050   vtkGetVector3Macro(Color,double);
00052 
00054 
00056   vtkSetMacro(Opacity,double);
00057   vtkGetMacro(Opacity,double);
00059 
00061 
00063   vtkSetClampMacro(FontFamily,int,VTK_ARIAL,VTK_TIMES);
00064   vtkGetMacro(FontFamily, int);
00065   void SetFontFamilyToArial()   { this->SetFontFamily(VTK_ARIAL);  };
00066   void SetFontFamilyToCourier() { this->SetFontFamily(VTK_COURIER);};
00067   void SetFontFamilyToTimes()   { this->SetFontFamily(VTK_TIMES);  };
00068   char *GetFontFamilyAsString();
00069   static char *GetFontFamilyAsString( int f );
00071 
00073 
00074   vtkSetClampMacro(FontSize,int,0,VTK_LARGE_INTEGER);
00075   vtkGetMacro(FontSize, int);
00077 
00079 
00080   vtkSetMacro(Bold, int);
00081   vtkGetMacro(Bold, int);
00082   vtkBooleanMacro(Bold, int);
00084 
00086 
00087   vtkSetMacro(Italic, int);
00088   vtkGetMacro(Italic, int);
00089   vtkBooleanMacro(Italic, int);
00091 
00093 
00094   vtkSetMacro(Shadow, int);
00095   vtkGetMacro(Shadow, int);
00096   vtkBooleanMacro(Shadow, int);
00098 
00100 
00102   vtkSetVector2Macro(ShadowOffset,int);
00103   vtkGetVectorMacro(ShadowOffset,int,2);
00105 
00107   void GetShadowColor(double color[3]);
00108   
00110 
00112   vtkSetClampMacro(Justification,int,VTK_TEXT_LEFT,VTK_TEXT_RIGHT);
00113   vtkGetMacro(Justification,int);
00114   void SetJustificationToLeft()     
00115     { this->SetJustification(VTK_TEXT_LEFT);};
00116   void SetJustificationToCentered() 
00117     { this->SetJustification(VTK_TEXT_CENTERED);};
00118   void SetJustificationToRight()    
00119     { this->SetJustification(VTK_TEXT_RIGHT);};
00120   char *GetJustificationAsString();
00122     
00124 
00126   vtkSetClampMacro(VerticalJustification,int,VTK_TEXT_BOTTOM,VTK_TEXT_TOP);
00127   vtkGetMacro(VerticalJustification,int);
00128   void SetVerticalJustificationToBottom() 
00129     {this->SetVerticalJustification(VTK_TEXT_BOTTOM);};
00130   void SetVerticalJustificationToCentered() 
00131     {this->SetVerticalJustification(VTK_TEXT_CENTERED);};
00132   void SetVerticalJustificationToTop() 
00133     {this->SetVerticalJustification(VTK_TEXT_TOP);};
00134   char *GetVerticalJustificationAsString();
00136     
00138 
00139   vtkSetMacro(Orientation,double);
00140   vtkGetMacro(Orientation,double);
00142 
00144 
00146   vtkSetMacro(LineSpacing, double);
00147   vtkGetMacro(LineSpacing, double);
00149   
00151 
00152   vtkSetMacro(LineOffset, double);
00153   vtkGetMacro(LineOffset, double);
00155   
00157   void ShallowCopy(vtkTextProperty *tprop);
00158   
00159 protected:
00160   vtkTextProperty();
00161   ~vtkTextProperty() {};
00162 
00163   double Color[3];
00164   double Opacity;
00165   int   FontFamily;
00166   int   FontSize;
00167   int   Bold;
00168   int   Italic;
00169   int   Shadow;
00170   int   ShadowOffset[2];
00171   int   Justification;
00172   int   VerticalJustification;
00173   double Orientation;
00174   double LineOffset;
00175   double LineSpacing;
00176   
00177 private:
00178   vtkTextProperty(const vtkTextProperty&);  // Not implemented.
00179   void operator=(const vtkTextProperty&);  // Not implemented.
00180 };
00181 
00182 inline char *vtkTextProperty::GetFontFamilyAsString( int f )
00183 {
00184   if ( f == VTK_ARIAL )
00185     {
00186     return (char *)"Arial";
00187     }
00188   else if ( f == VTK_COURIER ) 
00189     {
00190     return (char *)"Courier";
00191     }
00192   else if ( f == VTK_TIMES ) 
00193     {
00194     return (char *)"Times";
00195     }
00196   return (char *)"Unknown";
00197 }
00198 
00199 inline char *vtkTextProperty::GetFontFamilyAsString(void)
00200 {
00201   return vtkTextProperty::GetFontFamilyAsString( this->GetFontFamily() );
00202 }
00203 
00204 inline char *vtkTextProperty::GetJustificationAsString(void)
00205 {
00206   if (this->Justification == VTK_TEXT_LEFT)
00207     {
00208     return (char *)"Left";
00209     }
00210   else if (this->Justification == VTK_TEXT_CENTERED) 
00211     {
00212     return (char *)"Centered";
00213     }
00214   else if (this->Justification == VTK_TEXT_RIGHT) 
00215     {
00216     return (char *)"Right";
00217     }
00218   return (char *)"Unknown";
00219 }
00220 
00221 inline char *vtkTextProperty::GetVerticalJustificationAsString(void)
00222 {
00223   if (this->VerticalJustification == VTK_TEXT_BOTTOM)
00224     {
00225     return (char *)"Bottom";
00226     }
00227   else if (this->VerticalJustification == VTK_TEXT_CENTERED) 
00228     {
00229     return (char *)"Centered";
00230     }
00231   else if (this->VerticalJustification == VTK_TEXT_TOP) 
00232     {
00233     return (char *)"Top";
00234     }
00235   return (char *)"Unknown";
00236 }
00237 
00238 #endif

Generated on Mon Jan 21 23:07:36 2008 for VTK by  doxygen 1.4.3-20050530