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

Hybrid/vtkCaptionActor2D.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkCaptionActor2D.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00073 #ifndef __vtkCaptionActor2D_h
00074 #define __vtkCaptionActor2D_h
00075 
00076 #include "vtkActor2D.h"
00077 
00078 class vtkActor;
00079 class vtkAppendPolyData;
00080 class vtkGlyph2D;
00081 class vtkGlyph3D;
00082 class vtkPolyData;
00083 class vtkPolyDataMapper2D;
00084 class vtkPolyDataMapper;
00085 class vtkTextActor;
00086 class vtkTextMapper;
00087 class vtkTextProperty;
00088 
00089 class VTK_HYBRID_EXPORT vtkCaptionActor2D : public vtkActor2D
00090 {
00091 public:
00092   vtkTypeRevisionMacro(vtkCaptionActor2D,vtkActor2D);
00093   void PrintSelf(ostream& os, vtkIndent indent);
00094 
00095   static vtkCaptionActor2D *New();
00096 
00098 
00100   vtkSetStringMacro(Caption);
00101   vtkGetStringMacro(Caption);
00103 
00105 
00108   vtkWorldCoordinateMacro(AttachmentPoint);
00110 
00112 
00113   vtkSetMacro(Border,int);
00114   vtkGetMacro(Border,int);
00115   vtkBooleanMacro(Border,int);
00117 
00119 
00121   vtkSetMacro(Leader,int);
00122   vtkGetMacro(Leader,int);
00123   vtkBooleanMacro(Leader,int);
00125 
00127 
00129   vtkSetMacro(ThreeDimensionalLeader,int);
00130   vtkGetMacro(ThreeDimensionalLeader,int);
00131   vtkBooleanMacro(ThreeDimensionalLeader,int);
00133 
00135 
00138   virtual void SetLeaderGlyph(vtkPolyData*);
00139   vtkGetObjectMacro(LeaderGlyph,vtkPolyData);
00141 
00143 
00148   vtkSetClampMacro(LeaderGlyphSize,float,0.0,0.1);
00149   vtkGetMacro(LeaderGlyphSize,float);
00151 
00153 
00156   vtkSetClampMacro(MaximumLeaderGlyphSize,int,1,1000);
00157   vtkGetMacro(MaximumLeaderGlyphSize,int);
00159 
00161 
00163   vtkSetClampMacro(Padding, int, 0, 50);
00164   vtkGetMacro(Padding, int);
00166 
00168 
00169   virtual void SetCaptionTextProperty(vtkTextProperty *p);
00170   vtkGetObjectMacro(CaptionTextProperty,vtkTextProperty);
00172 
00173 #ifndef VTK_REMOVE_LEGACY_CODE
00174 
00175 
00179   virtual void SetFontFamily(int val);
00180   virtual int GetFontFamily();
00181   void SetFontFamilyToArial()   { this->SetFontFamily(VTK_ARIAL);  };
00182   void SetFontFamilyToCourier() { this->SetFontFamily(VTK_COURIER);};
00183   void SetFontFamilyToTimes()   { this->SetFontFamily(VTK_TIMES);  };
00185 #endif
00186 
00187 #ifndef VTK_REMOVE_LEGACY_CODE
00188 
00189 
00192   virtual void SetBold(int val);
00193   virtual int GetBold();
00194   vtkBooleanMacro(Bold, int);
00196 #endif
00197 
00198 #ifndef VTK_REMOVE_LEGACY_CODE
00199 
00200 
00203   virtual void SetItalic(int val);
00204   virtual int GetItalic();
00205   vtkBooleanMacro(Italic, int);
00207 #endif
00208 
00209 #ifndef VTK_REMOVE_LEGACY_CODE
00210 
00211 
00214   virtual void SetShadow(int val);
00215   virtual int GetShadow();
00216   vtkBooleanMacro(Shadow, int);
00218 #endif
00219     
00220 #ifndef VTK_REMOVE_LEGACY_CODE
00221 
00222 
00226   virtual void SetJustification(int val);
00227   virtual int GetJustification();
00228   void SetJustificationToLeft()     
00229     { this->SetJustification(VTK_TEXT_LEFT);};
00230   void SetJustificationToCentered() 
00231     { this->SetJustification(VTK_TEXT_CENTERED);};
00232   void SetJustificationToRight()    
00233     { this->SetJustification(VTK_TEXT_RIGHT);};
00235 #endif
00236     
00237 #ifndef VTK_REMOVE_LEGACY_CODE
00238 
00239 
00243   virtual void SetVerticalJustification(int val);
00244   virtual int GetVerticalJustification();
00245   void SetVerticalJustificationToBottom() 
00246     {this->SetVerticalJustification(VTK_TEXT_BOTTOM);};
00247   void SetVerticalJustificationToCentered() 
00248     {this->SetVerticalJustification(VTK_TEXT_CENTERED);};
00249   void SetVerticalJustificationToTop() 
00250     {this->SetVerticalJustification(VTK_TEXT_TOP);};
00252 #endif
00253     
00256   void ShallowCopy(vtkProp *prop);
00257 
00258 //BTX
00263   virtual void ReleaseGraphicsResources(vtkWindow *);
00264 
00266 
00269   int RenderOpaqueGeometry(vtkViewport* viewport);
00270   int RenderTranslucentGeometry(vtkViewport* ) {return 0;}
00271   int RenderOverlay(vtkViewport* viewport);
00273 //ETX
00274 
00275 protected:
00276   vtkCaptionActor2D();
00277   ~vtkCaptionActor2D();
00278 
00279   vtkCoordinate *AttachmentPointCoordinate;
00280 
00281   char  *Caption;
00282   int   Border;
00283   int   Leader;
00284   int   ThreeDimensionalLeader;
00285   float LeaderGlyphSize;
00286   int   MaximumLeaderGlyphSize;
00287 
00288   vtkPolyData *LeaderGlyph; //what to put on the end of the leader
00289   
00290   int   Padding;
00291 
00292 private:
00293   vtkTextActor        *CaptionActor;
00294   vtkTextProperty     *CaptionTextProperty;
00295 
00296   vtkPolyData         *BorderPolyData;
00297   vtkPolyDataMapper2D *BorderMapper;
00298   vtkActor2D          *BorderActor;
00299 
00300   vtkPolyData         *HeadPolyData;    // single attachment point for glyphing
00301   vtkGlyph3D          *HeadGlyph;       // for 3D leader
00302   vtkPolyData         *LeaderPolyData;  // line represents the leader
00303   vtkAppendPolyData   *AppendLeader;    // append head and leader
00304   
00305   // for 2D leader
00306   vtkCoordinate       *MapperCoordinate2D;
00307   vtkPolyDataMapper2D *LeaderMapper2D;
00308   vtkActor2D          *LeaderActor2D;
00309 
00310   // for 3D leader
00311   vtkPolyDataMapper   *LeaderMapper3D;
00312   vtkActor            *LeaderActor3D;
00313 
00314 private:
00315   vtkCaptionActor2D(const vtkCaptionActor2D&);  // Not implemented.
00316   void operator=(const vtkCaptionActor2D&);  // Not implemented.
00317 };
00318 
00319 
00320 #endif
00321 
00322 
00323