VTK
vtkChartLegend.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkChartLegend.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 =========================================================================*/
15 
28 #ifndef vtkChartLegend_h
29 #define vtkChartLegend_h
30 
31 #include "vtkChartsCoreModule.h" // For export macro
32 #include "vtkContextItem.h"
33 #include "vtkNew.h" // For vtkNew
34 #include "vtkRect.h" // For vtkRectf return value
35 
36 class vtkChart;
37 class vtkPen;
38 class vtkBrush;
39 class vtkTextProperty;
40 
42 {
43 public:
45  virtual void PrintSelf(ostream &os, vtkIndent indent);
46 
48  static vtkChartLegend *New();
49 
51 
52  vtkSetVector2Macro(Point, float);
54 
56 
57  vtkGetVector2Macro(Point, float);
59 
60  enum {
61  LEFT = 0,
64  TOP,
66  CUSTOM
67  };
68 
70  void SetPoint(const vtkVector2f &point);
71 
73  const vtkVector2f& GetPointVector();
74 
76 
78  vtkSetMacro(HorizontalAlignment, int);
80 
82 
83  vtkGetMacro(HorizontalAlignment, int);
85 
87 
89  vtkSetMacro(VerticalAlignment, int);
91 
93 
94  vtkGetMacro(VerticalAlignment, int);
96 
98 
99  vtkSetMacro(Padding, int);
101 
103 
104  vtkGetMacro(Padding, int);
106 
108 
109  vtkSetMacro(SymbolWidth, int);
111 
113 
114  vtkGetMacro(SymbolWidth, int);
116 
118  virtual void SetLabelSize(int size);
119 
121  virtual int GetLabelSize();
122 
124 
128  vtkSetMacro(Inline, bool);
129  vtkGetMacro(Inline, bool);
131 
133 
137  vtkSetMacro(DragEnabled, bool);
138  vtkGetMacro(DragEnabled, bool);
140 
143  void SetChart(vtkChart* chart);
144 
147  vtkChart* GetChart();
148 
151  virtual void Update();
152 
154  virtual bool Paint(vtkContext2D *painter);
155 
161  virtual vtkRectf GetBoundingRect(vtkContext2D* painter);
162 
164  vtkPen * GetPen();
165 
167  vtkBrush * GetBrush();
168 
170  vtkTextProperty * GetLabelProperties();
171 
173 
179  vtkSetMacro(CacheBounds, bool);
180  vtkGetMacro(CacheBounds, bool);
181  vtkBooleanMacro(CacheBounds, bool);
183 
185  virtual bool Hit(const vtkContextMouseEvent &mouse);
186 
188  virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
189 
191  virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
192 
194  virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse);
195 
196 protected:
197  vtkChartLegend();
198  ~vtkChartLegend();
199 
200  float* Point; // The point the legend is anchored to.
201  int HorizontalAlignment; // Alignment of the legend to the point it is anchored to.
202  int VerticalAlignment; // Alignment of the legend to the point it is anchored to.
203 
206 
209 
212 
215 
219 
221  int Button;
222 
225 
227 
229  int Padding;
230 
233 
235  bool Inline;
236 
237  // Private storage class
238  class Private;
239  Private* Storage;
240 
241 private:
242  vtkChartLegend(const vtkChartLegend &); // Not implemented.
243  void operator=(const vtkChartLegend &); // Not implemented.
244 };
245 
246 #endif //vtkChartLegend_h
Private * Storage
vtkTimeStamp PlotTime
base class for items that are part of a vtkContextScene.
virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse)
virtual bool Paint(vtkContext2D *painter)
record modification and/or execution time
Definition: vtkTimeStamp.h:34
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:56
Factory class for drawing 2D charts.
Definition: vtkChart.h:49
vtkTimeStamp RectTime
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:36
data structure to represent mouse events.
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
vtkNew< vtkBrush > Brush
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:38
represent text properties.
draw the chart legend
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
virtual bool Hit(const vtkContextMouseEvent &mouse)
virtual void PrintSelf(ostream &os, vtkIndent indent)
vtkNew< vtkTextProperty > LabelProperties
static vtkObject * New()
virtual void Update()
vtkNew< vtkPen > Pen
#define VTKCHARTSCORE_EXPORT