00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00026 #ifndef __vtkTextRepresentation_h
00027 #define __vtkTextRepresentation_h
00028
00029 #include "vtkBorderRepresentation.h"
00030
00031 class vtkRenderer;
00032 class vtkTextActor;
00033 class vtkTextProperty;
00034 class vtkTextRepresentationObserver;
00035
00036 class VTK_WIDGETS_EXPORT vtkTextRepresentation : public vtkBorderRepresentation
00037 {
00038 public:
00040 static vtkTextRepresentation *New();
00041
00043
00044 vtkTypeRevisionMacro(vtkTextRepresentation,vtkBorderRepresentation);
00045 void PrintSelf(ostream& os, vtkIndent indent);
00047
00049
00051 void SetTextActor(vtkTextActor *textActor);
00052 vtkGetObjectMacro(TextActor,vtkTextActor);
00054
00056
00057 void SetText(const char* text);
00058 const char* GetText();
00060
00062
00063 virtual void BuildRepresentation();
00064 virtual void GetSize(double size[2])
00065 {size[0]=2.0; size[1]=2.0;}
00067
00069
00071 virtual void GetActors2D(vtkPropCollection*);
00072 virtual void ReleaseGraphicsResources(vtkWindow*);
00073 virtual int RenderOverlay(vtkViewport*);
00074 virtual int RenderOpaqueGeometry(vtkViewport*);
00075 virtual int RenderTranslucentPolygonalGeometry(vtkViewport*);
00076 virtual int HasTranslucentPolygonalGeometry();
00078
00079
00080 enum
00081 {
00082 AnyLocation = 0,
00083 LowerLeftCorner,
00084 LowerRightCorner,
00085 LowerCenter,
00086 UpperLeftCorner,
00087 UpperRightCorner,
00088 UpperCenter
00089 };
00090
00091
00093
00096 virtual void SetWindowLocation(int enumLocation);
00097 vtkGetMacro(WindowLocation, int);
00099
00101
00103 virtual void SetPosition(double x, double y);
00104 virtual void SetPosition(double pos[2])
00105 { this->SetPosition(pos[0], pos[1]);};
00107
00109
00110 void ExecuteTextPropertyModifiedEvent(vtkObject* obj, unsigned long enumEvent, void* p);
00111 void ExecuteTextActorModifiedEvent(vtkObject* obj, unsigned long enumEvent, void* p);
00113
00114 protected:
00115 vtkTextRepresentation();
00116 ~vtkTextRepresentation();
00117
00118
00119 virtual void InitializeTextActor();
00120
00121
00122 virtual void CheckTextBoundary();
00123
00124
00125 vtkTextActor *TextActor;
00126 vtkTextProperty *TextProperty;
00127
00128
00129 int WindowLocation;
00130 virtual void UpdateWindowLocation();
00131
00132
00133 vtkTextRepresentationObserver *Observer;
00134
00135 private:
00136 vtkTextRepresentation(const vtkTextRepresentation&);
00137 void operator=(const vtkTextRepresentation&);
00138 };
00139
00140 #endif