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