VTK
vtkTextRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTextRepresentation.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
29 #ifndef vtkTextRepresentation_h
30 #define vtkTextRepresentation_h
31 
32 #include "vtkInteractionWidgetsModule.h" // For export macro
34 
35 class vtkRenderer;
36 class vtkTextActor;
37 class vtkTextProperty;
38 class vtkTextRepresentationObserver;
39 
41 {
42 public:
45 
47 
49  void PrintSelf(ostream& os, vtkIndent indent);
51 
53 
55  void SetTextActor(vtkTextActor *textActor);
58 
60 
61  void SetText(const char* text);
62  const char* GetText();
64 
66 
67  virtual void BuildRepresentation();
68  virtual void GetSize(double size[2])
69  {size[0]=2.0; size[1]=2.0;}
71 
73 
77  virtual int RenderOverlay(vtkViewport*);
82 
83  //BTX
84  enum
85  {
86  AnyLocation = 0,
92  UpperCenter
93  };
94  //ETX
95 
97 
100  virtual void SetWindowLocation(int enumLocation);
101  vtkGetMacro(WindowLocation, int);
103 
105 
107  virtual void SetPosition(double x, double y);
108  virtual void SetPosition(double pos[2])
109  { this->SetPosition(pos[0], pos[1]);};
111 
113 
114  void ExecuteTextPropertyModifiedEvent(vtkObject* obj, unsigned long enumEvent, void* p);
115  void ExecuteTextActorModifiedEvent(vtkObject* obj, unsigned long enumEvent, void* p);
117 
118 protected:
121 
122  // Initialize text actor
123  virtual void InitializeTextActor();
124 
125  // Check and adjust boundaries according to the size of the text
126  virtual void CheckTextBoundary();
127 
128  // the text to manage
131 
132  // Window location by enumeration
134  virtual void UpdateWindowLocation();
135 
136  // observer to observe internal TextActor and TextProperty
137  vtkTextRepresentationObserver *Observer;
138 
139 private:
140  vtkTextRepresentation(const vtkTextRepresentation&); //Not implemented
141  void operator=(const vtkTextRepresentation&); //Not implemented
142 };
143 
144 #endif
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkTextRepresentation::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
vtkBorderRepresentation
represent a vtkBorderWidget
Definition: vtkBorderRepresentation.h:58
vtkgl::obj
GLsizei GLsizei GLuint * obj
Definition: vtkgl.h:11994
vtkTextRepresentation::vtkTextRepresentation
vtkTextRepresentation()
vtkTextRepresentation::LowerRightCorner
@ LowerRightCorner
Definition: vtkTextRepresentation.h:88
vtkTextRepresentation::SetWindowLocation
virtual void SetWindowLocation(int enumLocation)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkTextRepresentation::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkTextRepresentation::Observer
vtkTextRepresentationObserver * Observer
Definition: vtkTextRepresentation.h:137
vtkInteractionWidgetsModule.h
vtkBorderRepresentation::SetPosition
virtual void SetPosition(float x[2])
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkTextRepresentation::SetPosition
virtual void SetPosition(double x, double y)
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkTextRepresentation::UpperRightCorner
@ UpperRightCorner
Definition: vtkTextRepresentation.h:91
vtkTextRepresentation::SetTextActor
void SetTextActor(vtkTextActor *textActor)
vtkTextRepresentation::TextProperty
vtkTextProperty * TextProperty
Definition: vtkTextRepresentation.h:130
vtkTextRepresentation::LowerCenter
@ LowerCenter
Definition: vtkTextRepresentation.h:89
vtkTextRepresentation::GetSize
virtual void GetSize(double size[2])
Definition: vtkTextRepresentation.h:68
vtkBorderRepresentation.h
vtkTextRepresentation::ExecuteTextPropertyModifiedEvent
void ExecuteTextPropertyModifiedEvent(vtkObject *obj, unsigned long enumEvent, void *p)
vtkTextRepresentation
represent text for vtkTextWidget
Definition: vtkTextRepresentation.h:41
vtkTextRepresentation::GetText
const char * GetText()
vtkTextRepresentation::ExecuteTextActorModifiedEvent
void ExecuteTextActorModifiedEvent(vtkObject *obj, unsigned long enumEvent, void *p)
vtkTextRepresentation::UpperLeftCorner
@ UpperLeftCorner
Definition: vtkTextRepresentation.h:90
vtkTextActor
An actor that displays text. Scaled or unscaled.
Definition: vtkTextActor.h:55
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkTextRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkTextRepresentation::SetPosition
virtual void SetPosition(double pos[2])
Definition: vtkTextRepresentation.h:108
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkTextRepresentation::UpdateWindowLocation
virtual void UpdateWindowLocation()
vtkTextRepresentation::HasTranslucentPolygonalGeometry
virtual int HasTranslucentPolygonalGeometry()
vtkTextRepresentation::BuildRepresentation
virtual void BuildRepresentation()
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkTextRepresentation::InitializeTextActor
virtual void InitializeTextActor()
vtkTextRepresentation::WindowLocation
int WindowLocation
Definition: vtkTextRepresentation.h:133
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:39
vtkTextRepresentation::SetText
void SetText(const char *text)
vtkTextRepresentation::LowerLeftCorner
@ LowerLeftCorner
Definition: vtkTextRepresentation.h:87
VTKINTERACTIONWIDGETS_EXPORT
#define VTKINTERACTIONWIDGETS_EXPORT
Definition: vtkInteractionWidgetsModule.h:15
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkTextRepresentation::~vtkTextRepresentation
~vtkTextRepresentation()
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkTextRepresentation::RenderOpaqueGeometry
virtual int RenderOpaqueGeometry(vtkViewport *)
vtkTextRepresentation::CheckTextBoundary
virtual void CheckTextBoundary()
vtkgl::p
GLfloat GLfloat p
Definition: vtkgl.h:15717
vtkTextRepresentation::RenderOverlay
virtual int RenderOverlay(vtkViewport *)
vtkTextRepresentation::New
static vtkTextRepresentation * New()
vtkTextRepresentation::TextActor
vtkTextActor * TextActor
Definition: vtkTextRepresentation.h:129
vtkPropCollection
a list of Props
Definition: vtkPropCollection.h:38
vtkTextRepresentation::GetActors2D
virtual void GetActors2D(vtkPropCollection *)
vtkgl::size
GLsizeiptr size
Definition: vtkgl.h:11843