VTK
dox/Interaction/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 "vtkInteractionWidgetsModule.h" // For export macro
00042 #include "vtkBorderRepresentation.h"
00043 
00044 class vtkRenderer;
00045 class vtkCaptionActor2D;
00046 class vtkConeSource;
00047 class vtkPointHandleRepresentation3D;
00048 
00049 
00050 class VTKINTERACTIONWIDGETS_EXPORT vtkCaptionRepresentation : public vtkBorderRepresentation
00051 {
00052 public:
00054   static vtkCaptionRepresentation *New();
00055 
00057 
00058   vtkTypeMacro(vtkCaptionRepresentation,vtkBorderRepresentation);
00059   void PrintSelf(ostream& os, vtkIndent indent);
00061 
00063 
00066   void SetAnchorPosition(double pos[3]);
00067   void GetAnchorPosition(double pos[3]);
00069 
00071 
00073   void SetCaptionActor2D(vtkCaptionActor2D *captionActor);
00074   vtkGetObjectMacro(CaptionActor2D,vtkCaptionActor2D);
00076 
00078 
00081   void SetAnchorRepresentation(vtkPointHandleRepresentation3D*);
00082   vtkGetObjectMacro(AnchorRepresentation,vtkPointHandleRepresentation3D);
00084 
00086 
00087   virtual void BuildRepresentation();
00088   virtual void GetSize(double size[2])
00089     {size[0]=2.0; size[1]=2.0;}
00091 
00093 
00095   virtual void GetActors2D(vtkPropCollection*);
00096   virtual void ReleaseGraphicsResources(vtkWindow*);
00097   virtual int RenderOverlay(vtkViewport*);
00098   virtual int RenderOpaqueGeometry(vtkViewport*);
00099   virtual int RenderTranslucentPolygonalGeometry(vtkViewport*);
00100   virtual int HasTranslucentPolygonalGeometry();
00102 
00104 
00106   vtkSetClampMacro(FontFactor, double, 0.1, 10.0);
00107   vtkGetMacro(FontFactor, double);
00109 
00110 protected:
00111   vtkCaptionRepresentation();
00112   ~vtkCaptionRepresentation();
00113 
00114   // the text to manage
00115   vtkCaptionActor2D *CaptionActor2D;
00116   vtkConeSource     *CaptionGlyph;
00117 
00118   int PointWidgetState;
00119   int DisplayAttachmentPoint[2];
00120   double FontFactor;
00121 
00122   // Internal representation for the anchor
00123   vtkPointHandleRepresentation3D *AnchorRepresentation;
00124 
00125   // Check and adjust boundaries according to the size of the caption text
00126   virtual void AdjustCaptionBoundary();
00127 
00128 private:
00129   vtkCaptionRepresentation(const vtkCaptionRepresentation&);  //Not implemented
00130   void operator=(const vtkCaptionRepresentation&);  //Not implemented
00131 };
00132 
00133 #endif