• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

dox/Rendering/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 =========================================================================*/
00029 #ifndef __vtkTextProperty_h
00030 #define __vtkTextProperty_h
00031 
00032 #include "vtkObject.h"
00033 
00034 class VTK_RENDERING_EXPORT vtkTextProperty : public vtkObject
00035 {
00036 public:
00037   vtkTypeRevisionMacro(vtkTextProperty,vtkObject);
00038   void PrintSelf(ostream& os, vtkIndent indent);
00039 
00042   static vtkTextProperty *New();
00043 
00045 
00046   vtkSetVector3Macro(Color,double);
00047   vtkGetVector3Macro(Color,double);
00049 
00051 
00053   vtkSetMacro(Opacity,double);
00054   vtkGetMacro(Opacity,double);
00056 
00058 
00060   vtkSetClampMacro(FontFamily,int,VTK_ARIAL,VTK_TIMES);
00061   vtkGetMacro(FontFamily, int);
00062   void SetFontFamilyToArial()   { this->SetFontFamily(VTK_ARIAL);  };
00063   void SetFontFamilyToCourier() { this->SetFontFamily(VTK_COURIER);};
00064   void SetFontFamilyToTimes()   { this->SetFontFamily(VTK_TIMES);  };
00065   static int GetFontFamilyFromString( const char *f ); 
00066   const char *GetFontFamilyAsString();
00067   static const char *GetFontFamilyAsString( int f );
00069 
00071 
00072   vtkSetClampMacro(FontSize,int,0,VTK_LARGE_INTEGER);
00073   vtkGetMacro(FontSize, int);
00075 
00077 
00078   vtkSetMacro(Bold, int);
00079   vtkGetMacro(Bold, int);
00080   vtkBooleanMacro(Bold, int);
00082 
00084 
00085   vtkSetMacro(Italic, int);
00086   vtkGetMacro(Italic, int);
00087   vtkBooleanMacro(Italic, int);
00089 
00091 
00092   vtkSetMacro(Shadow, int);
00093   vtkGetMacro(Shadow, int);
00094   vtkBooleanMacro(Shadow, int);
00096 
00098 
00100   vtkSetVector2Macro(ShadowOffset,int);
00101   vtkGetVectorMacro(ShadowOffset,int,2);
00103 
00105   void GetShadowColor(double color[3]);
00106 
00108 
00110   vtkSetClampMacro(Justification,int,VTK_TEXT_LEFT,VTK_TEXT_RIGHT);
00111   vtkGetMacro(Justification,int);
00112   void SetJustificationToLeft()
00113     { this->SetJustification(VTK_TEXT_LEFT);};
00114   void SetJustificationToCentered()
00115     { this->SetJustification(VTK_TEXT_CENTERED);};
00116   void SetJustificationToRight()
00117     { this->SetJustification(VTK_TEXT_RIGHT);};
00118   const char *GetJustificationAsString();
00120 
00122 
00124   vtkSetClampMacro(VerticalJustification,int,VTK_TEXT_BOTTOM,VTK_TEXT_TOP);
00125   vtkGetMacro(VerticalJustification,int);
00126   void SetVerticalJustificationToBottom()
00127     {this->SetVerticalJustification(VTK_TEXT_BOTTOM);};
00128   void SetVerticalJustificationToCentered()
00129     {this->SetVerticalJustification(VTK_TEXT_CENTERED);};
00130   void SetVerticalJustificationToTop()
00131     {this->SetVerticalJustification(VTK_TEXT_TOP);};
00132   const char *GetVerticalJustificationAsString();
00134 
00136 
00137   vtkSetMacro(Orientation,double);
00138   vtkGetMacro(Orientation,double);
00140 
00142 
00144   vtkSetMacro(LineSpacing, double);
00145   vtkGetMacro(LineSpacing, double);
00147 
00149 
00150   vtkSetMacro(LineOffset, double);
00151   vtkGetMacro(LineOffset, double);
00153 
00155   void ShallowCopy(vtkTextProperty *tprop);
00156 
00157 protected:
00158   vtkTextProperty();
00159   ~vtkTextProperty() {};
00160 
00161   double Color[3];
00162   double Opacity;
00163   int   FontFamily;
00164   int   FontSize;
00165   int   Bold;
00166   int   Italic;
00167   int   Shadow;
00168   int   ShadowOffset[2];
00169   int   Justification;
00170   int   VerticalJustification;
00171   double Orientation;
00172   double LineOffset;
00173   double LineSpacing;
00174 
00175 private:
00176   vtkTextProperty(const vtkTextProperty&);  // Not implemented.
00177   void operator=(const vtkTextProperty&);  // Not implemented.
00178 };
00179 
00180 inline const char *vtkTextProperty::GetFontFamilyAsString( int f )
00181 {
00182   if ( f == VTK_ARIAL )
00183     {
00184     return "Arial";
00185     }
00186   else if ( f == VTK_COURIER )
00187     {
00188     return "Courier";
00189     }
00190   else if ( f == VTK_TIMES )
00191     {
00192     return "Times";
00193     }
00194   return "Unknown";
00195 }
00196 
00197 inline int vtkTextProperty::GetFontFamilyFromString( const char *f )
00198 {
00199   if ( strcmp( f, GetFontFamilyAsString( VTK_ARIAL ) ) == 0 ) 
00200     {
00201     return VTK_ARIAL; 
00202     }
00203   else if ( strcmp( f, GetFontFamilyAsString( VTK_COURIER ) ) == 0 ) 
00204     {
00205     return VTK_COURIER; 
00206     }
00207   else if ( strcmp( f, GetFontFamilyAsString( VTK_TIMES ) ) == 0 ) 
00208     {
00209     return VTK_TIMES; 
00210     }
00211   return VTK_UNKNOWN_FONT; 
00212 }
00213 
00214 inline const char *vtkTextProperty::GetFontFamilyAsString(void)
00215 {
00216   return vtkTextProperty::GetFontFamilyAsString( this->GetFontFamily() );
00217 }
00218 
00219 inline const char *vtkTextProperty::GetJustificationAsString(void)
00220 {
00221   if (this->Justification == VTK_TEXT_LEFT)
00222     {
00223     return "Left";
00224     }
00225   else if (this->Justification == VTK_TEXT_CENTERED)
00226     {
00227     return "Centered";
00228     }
00229   else if (this->Justification == VTK_TEXT_RIGHT)
00230     {
00231     return "Right";
00232     }
00233   return "Unknown";
00234 }
00235 
00236 inline const char *vtkTextProperty::GetVerticalJustificationAsString(void)
00237 {
00238   if (this->VerticalJustification == VTK_TEXT_BOTTOM)
00239     {
00240     return "Bottom";
00241     }
00242   else if (this->VerticalJustification == VTK_TEXT_CENTERED)
00243     {
00244     return "Centered";
00245     }
00246   else if (this->VerticalJustification == VTK_TEXT_TOP)
00247     {
00248     return "Top";
00249     }
00250   return "Unknown";
00251 }
00252 
00253 #endif

Generated by  doxygen 1.7.1