VTK  9.0.1
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 "vtkChart.h"
28 #include "vtkChartsCoreModule.h" // For export macro
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) override;
39 
43  static vtkChartPie* New();
44 
50  void Update() override;
51 
55  bool Paint(vtkContext2D* painter) override;
56 
60  vtkPlot* AddPlot(int type) override;
61 
65  vtkIdType AddPlot(vtkPlot* plot) override { return Superclass::AddPlot(plot); }
66 
70  vtkPlot* GetPlot(vtkIdType index) override;
71 
75  vtkIdType GetNumberOfPlots() override;
76 
80  void SetShowLegend(bool visible) override;
81 
86  vtkChartLegend* GetLegend() override;
87 
91  void SetScene(vtkContextScene* scene) override;
92 
96  bool Hit(const vtkContextMouseEvent& mouse) override;
97 
101  bool MouseEnterEvent(const vtkContextMouseEvent& mouse) override;
102 
106  bool MouseMoveEvent(const vtkContextMouseEvent& mouse) override;
107 
111  bool MouseLeaveEvent(const vtkContextMouseEvent& mouse) override;
112 
116  bool MouseButtonPressEvent(const vtkContextMouseEvent& mouse) override;
117 
121  bool MouseButtonReleaseEvent(const vtkContextMouseEvent& mouse) override;
122 
126  bool MouseWheelEvent(const vtkContextMouseEvent& mouse, int delta) override;
127 
128 protected:
129  vtkChartPie();
130  ~vtkChartPie() override;
131 
135  void RecalculatePlotTransforms();
136 
141 
146 
151 
152 private:
153  vtkChartPie(const vtkChartPie&) = delete;
154  void operator=(const vtkChartPie&) = delete;
155 
159  bool LocatePointInPlots(const vtkContextMouseEvent& mouse);
160 
164  vtkChartPiePrivate* Private;
165 };
166 
167 #endif // vtkChartPie_h
vtkChart
Factory class for drawing 2D charts.
Definition: vtkChart.h:44
vtkChartPie
Factory class for drawing pie charts.
Definition: vtkChartPie.h:34
vtkChart::GetNumberOfPlots
virtual vtkIdType GetNumberOfPlots()
Get the number of plots the chart contains.
vtkContextMouseEvent
data structure to represent mouse events.
Definition: vtkContextMouseEvent.h:34
vtkChartPie::Legend
vtkChartLegend * Legend
The legend for the chart.
Definition: vtkChartPie.h:140
vtkX3D::type
@ type
Definition: vtkX3D.h:522
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkChartPie::PlotTransformValid
bool PlotTransformValid
Does the plot area transform need to be recalculated?
Definition: vtkChartPie.h:150
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkChartLegend
draw the chart legend
Definition: vtkChartLegend.h:39
vtkChart.h
vtkTooltipItem
takes care of drawing 2D axes
Definition: vtkTooltipItem.h:39
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:52
vtkChart::AddPlot
virtual vtkPlot * AddPlot(int type)
Add a plot to the chart, defaults to using the name of the y column.
vtkPlot
Abstract class for 2D plots.
Definition: vtkPlot.h:46
vtkContextScene
Provides a 2D scene for vtkContextItem objects.
Definition: vtkContextScene.h:47
vtkChart::Paint
bool Paint(vtkContext2D *painter) override=0
Paint event for the chart, called whenever the chart needs to be drawn.
vtkChart::GetLegend
virtual vtkChartLegend * GetLegend()
Get the legend for the chart, if available.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkAbstractContextItem::Hit
virtual bool Hit(const vtkContextMouseEvent &mouse)
Return true if the supplied x, y coordinate is inside the item.
vtkChart::GetPlot
virtual vtkPlot * GetPlot(vtkIdType index)
Get the plot at the specified index, returns null if the index is invalid.
vtkAbstractContextItem::MouseMoveEvent
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
Mouse move event.
vtkAbstractContextItem::MouseButtonReleaseEvent
virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
Mouse button release event.
vtkChartPie::Tooltip
vtkTooltipItem * Tooltip
The tooltip item for the chart - can be used to display extra information.
Definition: vtkChartPie.h:145
vtkChartPie::AddPlot
vtkIdType AddPlot(vtkPlot *plot) override
Add a plot to the chart.
Definition: vtkChartPie.h:65
vtkChart::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAbstractContextItem::SetScene
virtual void SetScene(vtkContextScene *scene)
Set the vtkContextScene for the item, always set for an item in a scene.
vtkAbstractContextItem::MouseEnterEvent
virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse)
Mouse enter event.
vtkAbstractContextItem::MouseLeaveEvent
virtual bool MouseLeaveEvent(const vtkContextMouseEvent &mouse)
Mouse leave event.
vtkAbstractContextItem::MouseButtonPressEvent
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...
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkAbstractContextItem::MouseWheelEvent
virtual bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta)
Mouse wheel event, positive delta indicates forward movement of the wheel.
vtkChart::SetShowLegend
virtual void SetShowLegend(bool visible)
Set/get whether the chart should draw a legend.
vtkAbstractContextItem::Update
virtual void Update()
Perform any updates to the item that may be necessary before rendering.