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-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00008 All rights reserved.
00009 
00010 Redistribution and use in source and binary forms, with or without
00011 modification, are permitted provided that the following conditions are met:
00012 
00013  * Redistributions of source code must retain the above copyright notice,
00014    this list of conditions and the following disclaimer.
00015 
00016  * Redistributions in binary form must reproduce the above copyright notice,
00017    this list of conditions and the following disclaimer in the documentation
00018    and/or other materials provided with the distribution.
00019 
00020  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00021    of any contributors may be used to endorse or promote products derived
00022    from this software without specific prior written permission.
00023 
00024  * Modified source versions must be plainly marked as such, and must not be
00025    misrepresented as being the original software.
00026 
00027 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00028 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00029 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00030 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00031 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00032 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00033 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00034 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00035 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00036 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 
00038 =========================================================================*/
00086 #ifndef __vtkCaptionActor2D_h
00087 #define __vtkCaptionActor2D_h
00088 
00089 #include "vtkActor2D.h"
00090 #include "vtkTextMapper.h"
00091 #include "vtkPolyData.h"
00092 
00093 class vtkPolyDataMapper2D;
00094 class vtkPolyDataMapper;
00095 class vtkScaledTextActor;
00096 class vtkGlyph2D;
00097 class vtkGlyph3D;
00098 class vtkAppendPolyData;
00099 class vtkActor;
00100 
00101 class VTK_HYBRID_EXPORT vtkCaptionActor2D : public vtkActor2D
00102 {
00103 public:
00104   vtkTypeMacro(vtkCaptionActor2D,vtkActor2D);
00105   void PrintSelf(ostream& os, vtkIndent indent);
00106 
00107   static vtkCaptionActor2D *New();
00108 
00110 
00112   vtkSetStringMacro(Caption);
00113   vtkGetStringMacro(Caption);
00115 
00117 
00120   vtkWorldCoordinateMacro(AttachmentPoint);
00122 
00124 
00125   vtkSetMacro(Border,int);
00126   vtkGetMacro(Border,int);
00127   vtkBooleanMacro(Border,int);
00129 
00131 
00133   vtkSetMacro(Leader,int);
00134   vtkGetMacro(Leader,int);
00135   vtkBooleanMacro(Leader,int);
00137 
00139 
00141   vtkSetMacro(ThreeDimensionalLeader,int);
00142   vtkGetMacro(ThreeDimensionalLeader,int);
00143   vtkBooleanMacro(ThreeDimensionalLeader,int);
00145 
00147 
00150   vtkSetObjectMacro(LeaderGlyph,vtkPolyData);
00151   vtkGetObjectMacro(LeaderGlyph,vtkPolyData);
00153 
00155 
00160   vtkSetClampMacro(LeaderGlyphSize,float,0.0,0.1);
00161   vtkGetMacro(LeaderGlyphSize,float);
00163 
00165 
00168   vtkSetClampMacro(MaximumLeaderGlyphSize,int,1,1000);
00169   vtkGetMacro(MaximumLeaderGlyphSize,int);
00171 
00173 
00175   vtkSetClampMacro(Padding, int, 0, 50);
00176   vtkGetMacro(Padding, int);
00178 
00180 
00181   vtkSetMacro(Bold, int);
00182   vtkGetMacro(Bold, int);
00183   vtkBooleanMacro(Bold, int);
00185 
00187 
00188   vtkSetMacro(Italic, int);
00189   vtkGetMacro(Italic, int);
00190   vtkBooleanMacro(Italic, int);
00192 
00194 
00196   vtkSetMacro(Shadow, int);
00197   vtkGetMacro(Shadow, int);
00198   vtkBooleanMacro(Shadow, int);
00200 
00202 
00205   vtkSetMacro(FontFamily, int);
00206   vtkGetMacro(FontFamily, int);
00207   void SetFontFamilyToArial() {this->SetFontFamily(VTK_ARIAL);};
00208   void SetFontFamilyToCourier() {this->SetFontFamily(VTK_COURIER);};
00209   void SetFontFamilyToTimes() {this->SetFontFamily(VTK_TIMES);};
00211 
00213 
00215   vtkSetClampMacro(Justification,int,VTK_TEXT_LEFT,VTK_TEXT_RIGHT);
00216   vtkGetMacro(Justification,int);
00217   void SetJustificationToLeft() 
00218     {this->SetJustification(VTK_TEXT_LEFT);}
00219   void SetJustificationToCentered() 
00220     {this->SetJustification(VTK_TEXT_CENTERED);}
00221   void SetJustificationToRight() 
00222     {this->SetJustification(VTK_TEXT_RIGHT);}
00224     
00226 
00228   vtkSetClampMacro(VerticalJustification,int,VTK_TEXT_BOTTOM,VTK_TEXT_TOP);
00229   vtkGetMacro(VerticalJustification,int);
00230   void SetVerticalJustificationToBottom() 
00231     {this->SetVerticalJustification(VTK_TEXT_BOTTOM);}
00232   void SetVerticalJustificationToCentered() 
00233     {this->SetVerticalJustification(VTK_TEXT_CENTERED);}
00234   void SetVerticalJustificationToTop() 
00235     {this->SetVerticalJustification(VTK_TEXT_TOP);}
00237     
00240   void ShallowCopy(vtkProp *prop);
00241 
00242 //BTX
00247   virtual void ReleaseGraphicsResources(vtkWindow *);
00248 
00250 
00253   int RenderOpaqueGeometry(vtkViewport* viewport);
00254   int RenderTranslucentGeometry(vtkViewport* ) {return 0;}
00255   int RenderOverlay(vtkViewport* viewport);
00257 //ETX
00258 
00259 protected:
00260   vtkCaptionActor2D();
00261   ~vtkCaptionActor2D();
00262 
00263   vtkCoordinate *AttachmentPointCoordinate;
00264 
00265   char  *Caption;
00266   int   Border;
00267   int   Leader;
00268   int   ThreeDimensionalLeader;
00269   float LeaderGlyphSize;
00270   int   MaximumLeaderGlyphSize;
00271   vtkPolyData *LeaderGlyph; //what to put on the end of the leader
00272   
00273   int   Padding;
00274   int   Bold;
00275   int   Italic;
00276   int   Shadow;
00277   int   FontFamily;
00278   int   Justification;
00279   int   VerticalJustification;
00280 
00281 private:
00282   vtkTextMapper      *CaptionMapper;
00283   vtkScaledTextActor *CaptionActor;
00284 
00285   vtkPolyData         *BorderPolyData;
00286   vtkPolyDataMapper2D *BorderMapper;
00287   vtkActor2D          *BorderActor;
00288 
00289   vtkPolyData   *HeadPolyData; //single attachment point for glyphing
00290   vtkGlyph3D    *HeadGlyph;  //for 3D leader
00291   vtkPolyData   *LeaderPolyData; //line represents the leader
00292   vtkAppendPolyData *AppendLeader; //append head and leader
00293   
00294   //for 2D leader
00295   vtkCoordinate       *MapperCoordinate2D;
00296   vtkPolyDataMapper2D *LeaderMapper2D;
00297   vtkActor2D          *LeaderActor2D;
00298 
00299   //for 3D leader
00300   vtkPolyDataMapper *LeaderMapper3D;
00301   vtkActor          *LeaderActor3D;
00302 
00303 private:
00304   vtkCaptionActor2D(const vtkCaptionActor2D&);  // Not implemented.
00305   void operator=(const vtkCaptionActor2D&);  // Not implemented.
00306 };
00307 
00308 
00309 #endif
00310 
00311 
00312 

Generated on Thu Mar 28 14:19:23 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001