VTK
dox/Widgets/vtkCaptionRepresentation.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkCaptionRepresentation.h
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 =========================================================================*/
00038 #ifndef __vtkCaptionRepresentation_h
00039 #define __vtkCaptionRepresentation_h
00040 
00041 #include "vtkBorderRepresentation.h"
00042 
00043 class vtkRenderer;
00044 class vtkCaptionActor2D;
00045 class vtkConeSource;
00046 class vtkPointHandleRepresentation3D;
00047 
00048 
00049 class VTK_WIDGETS_EXPORT vtkCaptionRepresentation : public vtkBorderRepresentation
00050 {
00051 public:
00053   static vtkCaptionRepresentation *New();
00054 
00056 
00057   vtkTypeMacro(vtkCaptionRepresentation,vtkBorderRepresentation);
00058   void PrintSelf(ostream& os, vtkIndent indent);
00060 
00062 
00065   void SetAnchorPosition(double pos[3]);
00066   void GetAnchorPosition(double pos[3]);
00068 
00070 
00072   void SetCaptionActor2D(vtkCaptionActor2D *captionActor);
00073   vtkGetObjectMacro(CaptionActor2D,vtkCaptionActor2D);
00075 
00077 
00080   void SetAnchorRepresentation(vtkPointHandleRepresentation3D*);
00081   vtkGetObjectMacro(AnchorRepresentation,vtkPointHandleRepresentation3D);
00083 
00085 
00086   virtual void BuildRepresentation();
00087   virtual void GetSize(double size[2])
00088     {size[0]=2.0; size[1]=2.0;}
00090   
00092 
00094   virtual void GetActors2D(vtkPropCollection*);
00095   virtual void ReleaseGraphicsResources(vtkWindow*);
00096   virtual int RenderOverlay(vtkViewport*);
00097   virtual int RenderOpaqueGeometry(vtkViewport*);
00098   virtual int RenderTranslucentPolygonalGeometry(vtkViewport*);
00099   virtual int HasTranslucentPolygonalGeometry();
00101 
00103 
00105   vtkSetClampMacro(FontFactor, double, 0.1, 10.0);
00106   vtkGetMacro(FontFactor, double);
00108   
00109 protected:
00110   vtkCaptionRepresentation();
00111   ~vtkCaptionRepresentation();
00112 
00113   // the text to manage
00114   vtkCaptionActor2D *CaptionActor2D;
00115   vtkConeSource     *CaptionGlyph;
00116   
00117   int PointWidgetState;
00118   int DisplayAttachmentPoint[2];
00119   double FontFactor;
00120 
00121   // Internal representation for the anchor 
00122   vtkPointHandleRepresentation3D *AnchorRepresentation;
00123 
00124   // Check and adjust boundaries according to the size of the caption text
00125   virtual void AdjustCaptionBoundary();
00126 
00127 private:
00128   vtkCaptionRepresentation(const vtkCaptionRepresentation&);  //Not implemented
00129   void operator=(const vtkCaptionRepresentation&);  //Not implemented
00130 };
00131 
00132 #endif