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 "vtkContextItem.h"
32 #include "vtkNew.h" // For vtkNew
33 #include "vtkRect.h" // For vtkRectf return value
34 
35 class vtkChart;
36 class vtkPen;
37 class vtkBrush;
38 class vtkTextProperty;
39 
41 {
42 public:
44  virtual void PrintSelf(ostream &os, vtkIndent indent);
45 
47  static vtkChartLegend *New();
48 
50 
51  vtkSetVector2Macro(Point, float);
53 
55 
56  vtkGetVector2Macro(Point, float);
58 
59  enum {
60  LEFT = 0,
63  TOP,
65  CUSTOM
66  };
67 
69  void SetPoint(const vtkVector2f &point);
70 
72  const vtkVector2f& GetPointVector();
73 
75 
77  vtkSetMacro(HorizontalAlignment, int);
79 
81 
82  vtkGetMacro(HorizontalAlignment, int);
84 
86 
88  vtkSetMacro(VerticalAlignment, int);
90 
92 
93  vtkGetMacro(VerticalAlignment, int);
95 
97 
98  vtkSetMacro(Padding, int);
100 
102 
103  vtkGetMacro(Padding, int);
105 
107 
108  vtkSetMacro(SymbolWidth, int);
110 
112 
113  vtkGetMacro(SymbolWidth, int);
115 
117  virtual void SetLabelSize(int size);
118 
120  virtual int GetLabelSize();
121 
123 
127  vtkSetMacro(Inline, bool);
128  vtkGetMacro(Inline, bool);
130 
132 
136  vtkSetMacro(DragEnabled, bool);
137  vtkGetMacro(DragEnabled, bool);
139 
142  void SetChart(vtkChart* chart);
143 
146  vtkChart* GetChart();
147 
150  virtual void Update();
151 
153  virtual bool Paint(vtkContext2D *painter);
154 
160  virtual vtkRectf GetBoundingRect(vtkContext2D* painter);
161 
163  vtkPen * GetPen();
164 
166  vtkBrush * GetBrush();
167 
169  vtkTextProperty * GetLabelProperties();
170 
172  virtual bool Hit(const vtkContextMouseEvent &mouse);
173 
175  virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
176 
178  virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
179 
181  virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse);
182 
183 protected:
184  vtkChartLegend();
185  ~vtkChartLegend();
186 
187  float* Point; // The point the legend is anchored to.
188  int HorizontalAlignment; // Alignment of the legend to the point it is anchored to.
189  int VerticalAlignment; // Alignment of the legend to the point it is anchored to.
190 
193 
196 
199 
202 
204  int Button;
205 
208 
210 
212  int Padding;
213 
216 
218  bool Inline;
219 
220  // Private storage class
221  class Private;
222  Private* Storage;
223 
224 private:
225  vtkChartLegend(const vtkChartLegend &); // Not implemented.
226  void operator=(const vtkChartLegend &); // Not implemented.
227 };
228 
229 #endif //__vtkChartLegend_h
#define VTK_CHARTS_EXPORT
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:33
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:54
Factory class for drawing 2D charts.
Definition: vtkChart.h:46
vtkTimeStamp RectTime
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:35
data structure to represent mouse events.
a simple class to control print indentation
Definition: vtkIndent.h:37
virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
vtkNew< vtkBrush > Brush
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:37
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