VTK
vtkBalloonRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBalloonRepresentation.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 =========================================================================*/
59 #ifndef vtkBalloonRepresentation_h
60 #define vtkBalloonRepresentation_h
61 
62 #include "vtkInteractionWidgetsModule.h" // For export macro
64 
65 class vtkTextMapper;
66 class vtkTextActor;
67 class vtkTextProperty;
68 class vtkPoints;
69 class vtkCellArray;
70 class vtkPolyData;
72 class vtkActor2D;
73 class vtkProperty2D;
74 class vtkImageData;
75 class vtkTexture;
76 class vtkPoints;
77 class vtkPolyData;
79 class vtkActor2D;
80 
82 {
83 public:
86 
88 
90  void PrintSelf(ostream& os, vtkIndent indent);
92 
94 
98 
100 
101  vtkGetStringMacro(BalloonText);
102  vtkSetStringMacro(BalloonText);
104 
106 
110  vtkSetVector2Macro(ImageSize,int);
111  vtkGetVector2Macro(ImageSize,int);
113 
115 
119 
121 
126 
128 
132 
133 //BTX
134  enum {ImageLeft=0,ImageRight,ImageBottom,ImageTop};
135 //ETX
137 
143  vtkSetMacro(BalloonLayout,int);
144  vtkGetMacro(BalloonLayout,int);
145  void SetBalloonLayoutToImageLeft() {this->SetBalloonLayout(ImageLeft);}
146  void SetBalloonLayoutToImageRight() {this->SetBalloonLayout(ImageRight);}
147  void SetBalloonLayoutToImageBottom() {this->SetBalloonLayout(ImageBottom);}
148  void SetBalloonLayoutToImageTop() {this->SetBalloonLayout(ImageTop);}
149  void SetBalloonLayoutToTextLeft() {this->SetBalloonLayout(ImageRight);}
150  void SetBalloonLayoutToTextRight() {this->SetBalloonLayout(ImageLeft);}
151  void SetBalloonLayoutToTextTop() {this->SetBalloonLayout(ImageBottom);}
152  void SetBalloonLayoutToTextBottom() {this->SetBalloonLayout(ImageTop);}
154 
156 
160  vtkSetVector2Macro(Offset,int);
161  vtkGetVector2Macro(Offset,int);
163 
165 
167  vtkSetClampMacro(Padding,int,0,100);
168  vtkGetMacro(Padding,int);
170 
172 
173  virtual void StartWidgetInteraction(double e[2]);
174  virtual void EndWidgetInteraction(double e[2]);
175  virtual void BuildRepresentation();
176  virtual int ComputeInteractionState(int X, int Y, int modify=0);
178 
180 
182  virtual int RenderOverlay(vtkViewport *viewport);
184 
187  enum _InteractionState {Outside=0, OnText, OnImage};
188 
189 protected:
192 
193  // The balloon text and image
194  char *BalloonText;
196 
197  // The layout of the balloon
199 
200  // Controlling placement
201  int Padding;
202  int Offset[2];
203  int ImageSize[2];
204 
205  // Represent the text
209 
210  // Represent the image
217 
218  // The frame
225 
226  // Internal variable controlling rendering process
229 
230  // Helper methods
231  void AdjustImageSize(double imageSize[2]);
232  void ScaleImage(double imageSize[2],double scale);
233 
234 private:
235  vtkBalloonRepresentation(const vtkBalloonRepresentation&); //Not implemented
236  void operator=(const vtkBalloonRepresentation&); //Not implemented
237 };
238 
239 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkWidgetRepresentation.h
vtkBalloonRepresentation::SetBalloonLayoutToTextTop
void SetBalloonLayoutToTextTop()
Definition: vtkBalloonRepresentation.h:151
vtkBalloonRepresentation::AdjustImageSize
void AdjustImageSize(double imageSize[2])
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:51
vtkSetVector2Macro
#define vtkSetVector2Macro(name, type)
Definition: vtkSetGet.h:254
vtkBalloonRepresentation::TextMapper
vtkTextMapper * TextMapper
Definition: vtkBalloonRepresentation.h:206
vtkgl::imageSize
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei imageSize
Definition: vtkgl.h:11538
vtkBalloonRepresentation::FrameActor
vtkActor2D * FrameActor
Definition: vtkBalloonRepresentation.h:223
vtkGetVector2Macro
#define vtkGetVector2Macro(name, type)
Definition: vtkSetGet.h:270
vtkBalloonRepresentation::BuildRepresentation
virtual void BuildRepresentation()
vtkBalloonRepresentation::FramePoints
vtkPoints * FramePoints
Definition: vtkBalloonRepresentation.h:219
vtkBalloonRepresentation::EndWidgetInteraction
virtual void EndWidgetInteraction(double e[2])
vtkBalloonRepresentation::New
static vtkBalloonRepresentation * New()
vtkgl::scale
GLenum GLenum GLenum GLenum GLenum scale
Definition: vtkgl.h:15942
vtkBalloonRepresentation::SetFrameProperty
virtual void SetFrameProperty(vtkProperty2D *p)
vtkBalloonRepresentation::ScaleImage
void ScaleImage(double imageSize[2], double scale)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:54
vtkBalloonRepresentation::vtkBalloonRepresentation
vtkBalloonRepresentation()
vtkBalloonRepresentation::FramePolyData
vtkPolyData * FramePolyData
Definition: vtkBalloonRepresentation.h:221
vtkInteractionWidgetsModule.h
vtkBalloonRepresentation::Padding
int Padding
Definition: vtkBalloonRepresentation.h:201
vtkBalloonRepresentation::TextProperty
vtkTextProperty * TextProperty
Definition: vtkBalloonRepresentation.h:208
vtkBalloonRepresentation::RenderOverlay
virtual int RenderOverlay(vtkViewport *viewport)
vtkBalloonRepresentation::TexturePolyData
vtkPolyData * TexturePolyData
Definition: vtkBalloonRepresentation.h:212
vtkBalloonRepresentation::SetBalloonLayoutToImageBottom
void SetBalloonLayoutToImageBottom()
Definition: vtkBalloonRepresentation.h:147
vtkBalloonRepresentation::SetBalloonLayoutToTextBottom
void SetBalloonLayoutToTextBottom()
Definition: vtkBalloonRepresentation.h:152
vtkBalloonRepresentation::TextureMapper
vtkPolyDataMapper2D * TextureMapper
Definition: vtkBalloonRepresentation.h:214
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkBalloonRepresentation::BalloonLayout
int BalloonLayout
Definition: vtkBalloonRepresentation.h:198
vtkBalloonRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkBalloonRepresentation::SetImageProperty
virtual void SetImageProperty(vtkProperty2D *p)
vtkTexture
handles properties associated with a texture map
Definition: vtkTexture.h:70
vtkBalloonRepresentation::ImageVisible
int ImageVisible
Definition: vtkBalloonRepresentation.h:228
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:53
vtkgl::img
GLint GLvoid * img
Definition: vtkgl.h:11544
vtkBalloonRepresentation::FrameProperty
vtkProperty2D * FrameProperty
Definition: vtkBalloonRepresentation.h:224
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
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
vtkBalloonRepresentation::SetBalloonLayoutToTextRight
void SetBalloonLayoutToTextRight()
Definition: vtkBalloonRepresentation.h:150
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkBalloonRepresentation::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *w)
vtkBalloonRepresentation::ImageProperty
vtkProperty2D * ImageProperty
Definition: vtkBalloonRepresentation.h:216
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkBalloonRepresentation::TextActor
vtkActor2D * TextActor
Definition: vtkBalloonRepresentation.h:207
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkBalloonRepresentation::~vtkBalloonRepresentation
~vtkBalloonRepresentation()
vtkBalloonRepresentation::SetBalloonLayoutToImageTop
void SetBalloonLayoutToImageTop()
Definition: vtkBalloonRepresentation.h:148
vtkBalloonRepresentation::Texture
vtkTexture * Texture
Definition: vtkBalloonRepresentation.h:211
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkBalloonRepresentation::BalloonText
char * BalloonText
Definition: vtkBalloonRepresentation.h:194
vtkBalloonRepresentation
represent the vtkBalloonWidget
Definition: vtkBalloonRepresentation.h:82
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:39
vtkBalloonRepresentation::BalloonImage
vtkImageData * BalloonImage
Definition: vtkBalloonRepresentation.h:195
vtkBalloonRepresentation::TextureActor
vtkActor2D * TextureActor
Definition: vtkBalloonRepresentation.h:215
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:40
vtkBalloonRepresentation::TexturePoints
vtkPoints * TexturePoints
Definition: vtkBalloonRepresentation.h:213
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:45
VTKINTERACTIONWIDGETS_EXPORT
#define VTKINTERACTIONWIDGETS_EXPORT
Definition: vtkInteractionWidgetsModule.h:15
vtkBalloonRepresentation::SetBalloonImage
virtual void SetBalloonImage(vtkImageData *img)
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkgl::p
GLfloat GLfloat p
Definition: vtkgl.h:15717
vtkBalloonRepresentation::SetBalloonLayoutToImageLeft
void SetBalloonLayoutToImageLeft()
Definition: vtkBalloonRepresentation.h:145
vtkBalloonRepresentation::_InteractionState
_InteractionState
Definition: vtkBalloonRepresentation.h:187
vtkgl::w
GLubyte GLubyte GLubyte GLubyte w
Definition: vtkgl.h:12054
vtkBalloonRepresentation::StartWidgetInteraction
virtual void StartWidgetInteraction(double e[2])
vtkBalloonRepresentation::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkBalloonRepresentation::SetTextProperty
virtual void SetTextProperty(vtkTextProperty *p)
vtkBalloonRepresentation::SetBalloonLayoutToTextLeft
void SetBalloonLayoutToTextLeft()
Definition: vtkBalloonRepresentation.h:149
vtkBalloonRepresentation::FramePolygon
vtkCellArray * FramePolygon
Definition: vtkBalloonRepresentation.h:220
vtkBalloonRepresentation::SetBalloonLayoutToImageRight
void SetBalloonLayoutToImageRight()
Definition: vtkBalloonRepresentation.h:146
vtkBalloonRepresentation::TextVisible
int TextVisible
Definition: vtkBalloonRepresentation.h:227
vtkBalloonRepresentation::FrameMapper
vtkPolyDataMapper2D * FrameMapper
Definition: vtkBalloonRepresentation.h:222