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 =========================================================================*/
30 #ifndef vtkTextRepresentation_h
31 #define vtkTextRepresentation_h
32 
33 #include "vtkInteractionWidgetsModule.h" // For export macro
35 
36 class vtkRenderer;
37 class vtkTextActor;
38 class vtkTextProperty;
39 class vtkTextRepresentationObserver;
40 
41 class VTKINTERACTIONWIDGETS_EXPORT vtkTextRepresentation : public vtkBorderRepresentation
42 {
43 public:
48 
50 
54  void PrintSelf(ostream& os, vtkIndent indent);
56 
58 
62  void SetTextActor(vtkTextActor *textActor);
63  vtkGetObjectMacro(TextActor,vtkTextActor);
65 
67 
70  void SetText(const char* text);
71  const char* GetText();
73 
77  virtual void BuildRepresentation();
78  virtual void GetSize(double size[2])
79  {size[0]=2.0; size[1]=2.0;}
80 
82 
88  virtual int RenderOverlay(vtkViewport*);
93 
94  enum
95  {
96  AnyLocation = 0,
102  UpperCenter
103  };
104 
106 
117  virtual void SetWindowLocation(int enumLocation);
118  vtkGetMacro(WindowLocation, int);
120 
122 
126  virtual void SetPosition(double x, double y);
127  virtual void SetPosition(double pos[2])
128  { this->SetPosition(pos[0], pos[1]);};
130 
132 
135  void ExecuteTextPropertyModifiedEvent(vtkObject* obj, unsigned long enumEvent, void* p);
136  void ExecuteTextActorModifiedEvent(vtkObject* obj, unsigned long enumEvent, void* p);
138 
139 protected:
142 
143  // Initialize text actor
144  virtual void InitializeTextActor();
145 
146  // Check and adjust boundaries according to the size of the text
147  virtual void CheckTextBoundary();
148 
149  // the text to manage
152 
153  // Window location by enumeration
155  virtual void UpdateWindowLocation();
156 
157  // observer to observe internal TextActor and TextProperty
158  vtkTextRepresentationObserver *Observer;
159 
160 private:
161  vtkTextRepresentation(const vtkTextRepresentation&) VTK_DELETE_FUNCTION;
162  void operator=(const vtkTextRepresentation&) VTK_DELETE_FUNCTION;
163 };
164 
165 #endif
vtkTextRepresentation::LowerCenter
@ LowerCenter
Definition: vtkTextRepresentation.h:99
vtkTextRepresentation::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
vtkBorderRepresentation
represent a vtkBorderWidget
Definition: vtkBorderRepresentation.h:59
vtkTextRepresentation::vtkTextRepresentation
vtkTextRepresentation()
vtkTextRepresentation::SetWindowLocation
virtual void SetWindowLocation(int enumLocation)
Set the text position, by enumeration ( AnyLocation = 0, LowerLeftCorner, LowerRightCorner,...
vtkTextRepresentation::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkTextRepresentation::Observer
vtkTextRepresentationObserver * Observer
Definition: vtkTextRepresentation.h:158
vtkBorderRepresentation::SetPosition
virtual void SetPosition(float x[2])
vtkTextRepresentation::SetPosition
virtual void SetPosition(double x, double y)
Set the text position, by overiding the same function of vtkBorderRepresentation so that the Modified...
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkTextRepresentation::SetTextActor
void SetTextActor(vtkTextActor *textActor)
Specify the vtkTextActor to manage.
vtkTextRepresentation::TextProperty
vtkTextProperty * TextProperty
Definition: vtkTextRepresentation.h:151
vtkTextRepresentation::GetSize
virtual void GetSize(double size[2])
Definition: vtkTextRepresentation.h:78
vtkTextRepresentation::LowerLeftCorner
@ LowerLeftCorner
Definition: vtkTextRepresentation.h:97
vtkBorderRepresentation.h
vtkTextRepresentation::ExecuteTextPropertyModifiedEvent
void ExecuteTextPropertyModifiedEvent(vtkObject *obj, unsigned long enumEvent, void *p)
Internal.
vtkTextRepresentation
represent text for vtkTextWidget
Definition: vtkTextRepresentation.h:42
vtkTextRepresentation::GetText
const char * GetText()
vtkTextRepresentation::ExecuteTextActorModifiedEvent
void ExecuteTextActorModifiedEvent(vtkObject *obj, unsigned long enumEvent, void *p)
vtkTextRepresentation::UpperRightCorner
@ UpperRightCorner
Definition: vtkTextRepresentation.h:101
vtkTextActor
An actor that displays text.
Definition: vtkTextActor.h:57
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkTextRepresentation::LowerRightCorner
@ LowerRightCorner
Definition: vtkTextRepresentation.h:98
vtkTextRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkTextRepresentation::SetPosition
virtual void SetPosition(double pos[2])
Definition: vtkTextRepresentation.h:127
vtkX3D::size
@ size
Definition: vtkX3D.h:253
vtkTextRepresentation::UpdateWindowLocation
virtual void UpdateWindowLocation()
vtkTextRepresentation::HasTranslucentPolygonalGeometry
virtual int HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkTextRepresentation::BuildRepresentation
virtual void BuildRepresentation()
Satisfy the superclasses API.
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:48
vtkTextRepresentation::InitializeTextActor
virtual void InitializeTextActor()
vtkTextRepresentation::WindowLocation
int WindowLocation
Definition: vtkTextRepresentation.h:154
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:40
vtkTextRepresentation::SetText
void SetText(const char *text)
Get/Set the text string display by this representation.
vtkTextRepresentation::~vtkTextRepresentation
~vtkTextRepresentation()
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkTextRepresentation::RenderOpaqueGeometry
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkTextRepresentation::UpperLeftCorner
@ UpperLeftCorner
Definition: vtkTextRepresentation.h:100
vtkTextRepresentation::CheckTextBoundary
virtual void CheckTextBoundary()
vtkTextRepresentation::RenderOverlay
virtual int RenderOverlay(vtkViewport *)
vtkTextRepresentation::New
static vtkTextRepresentation * New()
Instantiate class.
vtkTextRepresentation::TextActor
vtkTextActor * TextActor
Definition: vtkTextRepresentation.h:150
vtkPropCollection
a list of Props
Definition: vtkPropCollection.h:39
vtkTextRepresentation::GetActors2D
virtual void GetActors2D(vtkPropCollection *)
These methods are necessary to make this representation behave as a vtkProp.