00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkCaptionRepresentation.h,v $ 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 =========================================================================*/ 00035 #ifndef __vtkCaptionRepresentation_h 00036 #define __vtkCaptionRepresentation_h 00037 00038 #include "vtkBorderRepresentation.h" 00039 00040 class vtkRenderer; 00041 class vtkCaptionActor2D; 00042 class vtkConeSource; 00043 class vtkPointHandleRepresentation3D; 00044 00045 00046 class VTK_WIDGETS_EXPORT vtkCaptionRepresentation : public vtkBorderRepresentation 00047 { 00048 public: 00050 static vtkCaptionRepresentation *New(); 00051 00053 00054 vtkTypeRevisionMacro(vtkCaptionRepresentation,vtkBorderRepresentation); 00055 void PrintSelf(ostream& os, vtkIndent indent); 00057 00059 00062 void SetAnchorPosition(double pos[3]); 00063 void GetAnchorPosition(double pos[3]); 00065 00067 00069 void SetCaptionActor2D(vtkCaptionActor2D *captionActor); 00070 vtkGetObjectMacro(CaptionActor2D,vtkCaptionActor2D); 00072 00074 00077 void SetAnchorRepresentation(vtkPointHandleRepresentation3D*); 00078 vtkGetObjectMacro(AnchorRepresentation,vtkPointHandleRepresentation3D); 00080 00082 00083 virtual void BuildRepresentation(); 00084 virtual void GetSize(double size[2]) 00085 {size[0]=2.0; size[1]=2.0;} 00087 00089 00091 virtual void GetActors2D(vtkPropCollection*); 00092 virtual void ReleaseGraphicsResources(vtkWindow*); 00093 virtual int RenderOverlay(vtkViewport*); 00094 virtual int RenderOpaqueGeometry(vtkViewport*); 00095 virtual int RenderTranslucentPolygonalGeometry(vtkViewport*); 00096 virtual int HasTranslucentPolygonalGeometry(); 00098 00100 00102 vtkSetClampMacro(FontFactor, double, 0.1, 10.0); 00103 vtkGetMacro(FontFactor, double); 00105 00106 protected: 00107 vtkCaptionRepresentation(); 00108 ~vtkCaptionRepresentation(); 00109 00110 // the text to manage 00111 vtkCaptionActor2D *CaptionActor2D; 00112 vtkConeSource *CaptionGlyph; 00113 00114 int PointWidgetState; 00115 int DisplayAttachmentPoint[2]; 00116 double FontFactor; 00117 00118 // Internal representation for the anchor 00119 vtkPointHandleRepresentation3D *AnchorRepresentation; 00120 00121 // Check and adjust boundaries according to the size of the caption text 00122 virtual void AdjustCaptionBoundary(); 00123 00124 private: 00125 vtkCaptionRepresentation(const vtkCaptionRepresentation&); //Not implemented 00126 void operator=(const vtkCaptionRepresentation&); //Not implemented 00127 }; 00128 00129 #endif