VTK
vtkChartPie.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkChartPie.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 
24 #ifndef vtkChartPie_h
25 #define vtkChartPie_h
26 
27 #include "vtkChartsCoreModule.h" // For export macro
28 #include "vtkChart.h"
29 
30 class vtkChartLegend;
31 class vtkTooltipItem;
32 class vtkChartPiePrivate;
33 
34 class VTKCHARTSCORE_EXPORT vtkChartPie : public vtkChart
35 {
36 public:
37  vtkTypeMacro(vtkChartPie, vtkChart);
38  void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE;
39 
43  static vtkChartPie *New();
44 
50  void Update() VTK_OVERRIDE;
51 
55  bool Paint(vtkContext2D *painter) VTK_OVERRIDE;
56 
60  vtkPlot * AddPlot(int type) VTK_OVERRIDE;
61 
65  vtkIdType AddPlot(vtkPlot* plot) VTK_OVERRIDE
66  { return Superclass::AddPlot(plot); }
67 
71  vtkPlot* GetPlot(vtkIdType index) VTK_OVERRIDE;
72 
76  vtkIdType GetNumberOfPlots() VTK_OVERRIDE;
77 
81  void SetShowLegend(bool visible) VTK_OVERRIDE;
82 
87  vtkChartLegend * GetLegend() VTK_OVERRIDE;
88 
92  void SetScene(vtkContextScene *scene) VTK_OVERRIDE;
93 
97  bool Hit(const vtkContextMouseEvent &mouse) VTK_OVERRIDE;
98 
102  bool MouseEnterEvent(const vtkContextMouseEvent &mouse) VTK_OVERRIDE;
103 
107  bool MouseMoveEvent(const vtkContextMouseEvent &mouse) VTK_OVERRIDE;
108 
112  bool MouseLeaveEvent(const vtkContextMouseEvent &mouse) VTK_OVERRIDE;
113 
117  bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) VTK_OVERRIDE;
118 
122  bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse) VTK_OVERRIDE;
123 
127  bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta) VTK_OVERRIDE;
128 
129 protected:
130  vtkChartPie();
131  ~vtkChartPie() VTK_OVERRIDE;
132 
136  void RecalculatePlotTransforms();
137 
142 
147 
152 
153 private:
154  vtkChartPie(const vtkChartPie &) VTK_DELETE_FUNCTION;
155  void operator=(const vtkChartPie &) VTK_DELETE_FUNCTION;
156 
160  bool LocatePointInPlots(const vtkContextMouseEvent &mouse);
161 
165  vtkChartPiePrivate *Private;
166 
167 };
168 
169 #endif //vtkChartPie_h
bool PlotTransformValid
Does the plot area transform need to be recalculated?
Definition: vtkChartPie.h:151
virtual void SetShowLegend(bool visible)
Set/get whether the chart should draw a legend.
virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse)
Mouse button down event Return true if the item holds the event, false if the event can be propagated...
vtkChartLegend * Legend
The legend for the chart.
Definition: vtkChartPie.h:141
int vtkIdType
Definition: vtkType.h:345
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:52
Factory class for drawing 2D charts.
Definition: vtkChart.h:44
virtual void SetScene(vtkContextScene *scene)
Set the vtkContextScene for the item, always set for an item in a scene.
virtual bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta)
Mouse wheel event, positive delta indicates forward movement of the wheel.
Provides a 2D scene for vtkContextItem objects.
data structure to represent mouse events.
virtual vtkChartLegend * GetLegend()
Get the legend for the chart, if available.
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
Mouse button release event.
virtual vtkIdType GetNumberOfPlots()
Get the number of plots the chart contains.
Abstract class for 2D plots.
Definition: vtkPlot.h:46
virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse)
Mouse enter event.
Factory class for drawing pie charts.
Definition: vtkChartPie.h:34
draw the chart legend
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
Mouse move event.
virtual bool Hit(const vtkContextMouseEvent &mouse)
Return true if the supplied x, y coordinate is inside the item.
virtual vtkPlot * GetPlot(vtkIdType index)
Get the plot at the specified index, returns null if the index is invalid.
takes care of drawing 2D axes
vtkTooltipItem * Tooltip
The tooltip item for the chart - can be used to display extra information.
Definition: vtkChartPie.h:146
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void Update()
Perform any updates to the item that may be necessary before rendering.
virtual bool MouseLeaveEvent(const vtkContextMouseEvent &mouse)
Mouse leave event.