Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound 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 =========================================================================*/
00072 #ifndef __vtkCaptionActor2D_h
00073 #define __vtkCaptionActor2D_h
00074 
00075 #include "vtkActor2D.h"
00076 
00077 class vtkActor;
00078 class vtkAppendPolyData;
00079 class vtkGlyph2D;
00080 class vtkGlyph3D;
00081 class vtkPolyData;
00082 class vtkPolyDataMapper2D;
00083 class vtkPolyDataMapper;
00084 class vtkTextActor;
00085 class vtkTextMapper;
00086 class vtkTextProperty;
00087 
00088 class VTK_HYBRID_EXPORT vtkCaptionActor2D : public vtkActor2D
00089 {
00090 public:
00091   vtkTypeRevisionMacro(vtkCaptionActor2D,vtkActor2D);
00092   void PrintSelf(ostream& os, vtkIndent indent);
00093 
00094   static vtkCaptionActor2D *New();
00095 
00097 
00099   vtkSetStringMacro(Caption);
00100   vtkGetStringMacro(Caption);
00102 
00104 
00107   vtkWorldCoordinateMacro(AttachmentPoint);
00109 
00111 
00112   vtkSetMacro(Border,int);
00113   vtkGetMacro(Border,int);
00114   vtkBooleanMacro(Border,int);
00116 
00118 
00120   vtkSetMacro(Leader,int);
00121   vtkGetMacro(Leader,int);
00122   vtkBooleanMacro(Leader,int);
00124 
00126 
00128   vtkSetMacro(ThreeDimensionalLeader,int);
00129   vtkGetMacro(ThreeDimensionalLeader,int);
00130   vtkBooleanMacro(ThreeDimensionalLeader,int);
00132 
00134 
00137   virtual void SetLeaderGlyph(vtkPolyData*);
00138   vtkGetObjectMacro(LeaderGlyph,vtkPolyData);
00140 
00142 
00147   vtkSetClampMacro(LeaderGlyphSize,float,0.0,0.1);
00148   vtkGetMacro(LeaderGlyphSize,float);
00150 
00152 
00155   vtkSetClampMacro(MaximumLeaderGlyphSize,int,1,1000);
00156   vtkGetMacro(MaximumLeaderGlyphSize,int);
00158 
00160 
00162   vtkSetClampMacro(Padding, int, 0, 50);
00163   vtkGetMacro(Padding, int);
00165 
00167 
00168   virtual void SetCaptionTextProperty(vtkTextProperty *p);
00169   vtkGetObjectMacro(CaptionTextProperty,vtkTextProperty);
00171 
00172 #ifndef VTK_REMOVE_LEGACY_CODE
00173 
00174 
00178   virtual void SetFontFamily(int val);
00179   virtual int GetFontFamily();
00180   void SetFontFamilyToArial()   { this->SetFontFamily(VTK_ARIAL);  };
00181   void SetFontFamilyToCourier() { this->SetFontFamily(VTK_COURIER);};
00182   void SetFontFamilyToTimes()   { this->SetFontFamily(VTK_TIMES);  };
00184 #endif
00185 
00186 #ifndef VTK_REMOVE_LEGACY_CODE
00187 
00188 
00191   virtual void SetBold(int val);
00192   virtual int GetBold();
00193   vtkBooleanMacro(Bold, int);
00195 #endif
00196 
00197 #ifndef VTK_REMOVE_LEGACY_CODE
00198 
00199 
00202   virtual void SetItalic(int val);
00203   virtual int GetItalic();
00204   vtkBooleanMacro(Italic, int);
00206 #endif
00207 
00208 #ifndef VTK_REMOVE_LEGACY_CODE
00209 
00210 
00213   virtual void SetShadow(int val);
00214   virtual int GetShadow();
00215   vtkBooleanMacro(Shadow, int);
00217 #endif
00218     
00219 #ifndef VTK_REMOVE_LEGACY_CODE
00220 
00221 
00225   virtual void SetJustification(int val);
00226   virtual int GetJustification();
00227   void SetJustificationToLeft()     
00228     { this->SetJustification(VTK_TEXT_LEFT);};
00229   void SetJustificationToCentered() 
00230     { this->SetJustification(VTK_TEXT_CENTERED);};
00231   void SetJustificationToRight()    
00232     { this->SetJustification(VTK_TEXT_RIGHT);};
00234 #endif
00235     
00236 #ifndef VTK_REMOVE_LEGACY_CODE
00237 
00238 
00242   virtual void SetVerticalJustification(int val);
00243   virtual int GetVerticalJustification();
00244   void SetVerticalJustificationToBottom() 
00245     {this->SetVerticalJustification(VTK_TEXT_BOTTOM);};
00246   void SetVerticalJustificationToCentered() 
00247     {this->SetVerticalJustification(VTK_TEXT_CENTERED);};
00248   void SetVerticalJustificationToTop() 
00249     {this->SetVerticalJustification(VTK_TEXT_TOP);};
00251 #endif
00252     
00255   void ShallowCopy(vtkProp *prop);
00256 
00257 //BTX
00262   virtual void ReleaseGraphicsResources(vtkWindow *);
00263 
00265 
00268   int RenderOpaqueGeometry(vtkViewport* viewport);
00269   int RenderTranslucentGeometry(vtkViewport* ) {return 0;}
00270   int RenderOverlay(vtkViewport* viewport);
00272 //ETX
00273 
00274 protected:
00275   vtkCaptionActor2D();
00276   ~vtkCaptionActor2D();
00277 
00278   vtkCoordinate *AttachmentPointCoordinate;
00279 
00280   char  *Caption;
00281   int   Border;
00282   int   Leader;
00283   int   ThreeDimensionalLeader;
00284   float LeaderGlyphSize;
00285   int   MaximumLeaderGlyphSize;
00286 
00287   vtkPolyData *LeaderGlyph; //what to put on the end of the leader
00288   
00289   int   Padding;
00290 
00291 private:
00292   vtkTextActor        *CaptionActor;
00293   vtkTextProperty     *CaptionTextProperty;
00294 
00295   vtkPolyData         *BorderPolyData;
00296   vtkPolyDataMapper2D *BorderMapper;
00297   vtkActor2D          *BorderActor;
00298 
00299   vtkPolyData         *HeadPolyData;    // single attachment point for glyphing
00300   vtkGlyph3D          *HeadGlyph;       // for 3D leader
00301   vtkPolyData         *LeaderPolyData;  // line represents the leader
00302   vtkAppendPolyData   *AppendLeader;    // append head and leader
00303   
00304   // for 2D leader
00305   vtkCoordinate       *MapperCoordinate2D;
00306   vtkPolyDataMapper2D *LeaderMapper2D;
00307   vtkActor2D          *LeaderActor2D;
00308 
00309   // for 3D leader
00310   vtkPolyDataMapper   *LeaderMapper3D;
00311   vtkActor            *LeaderActor3D;
00312 
00313 private:
00314   vtkCaptionActor2D(const vtkCaptionActor2D&);  // Not implemented.
00315   void operator=(const vtkCaptionActor2D&);  // Not implemented.
00316 };
00317 
00318 
00319 #endif
00320 
00321 
00322