VTK  9.3.0
vtkChartPie.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3
15#ifndef vtkChartPie_h
16#define vtkChartPie_h
17
18#include "vtkChart.h"
19#include "vtkChartsCoreModule.h" // For export macro
20
21VTK_ABI_NAMESPACE_BEGIN
22class vtkChartLegend;
23class vtkTooltipItem;
24class vtkChartPiePrivate;
25class vtkPlotPie;
26
27class VTKCHARTSCORE_EXPORT vtkChartPie : public vtkChart
28{
29public:
30 vtkTypeMacro(vtkChartPie, vtkChart);
31 void PrintSelf(ostream& os, vtkIndent indent) override;
32
36 static vtkChartPie* New();
37
43 void Update() override;
44
48 bool Paint(vtkContext2D* painter) override;
49
53 vtkPlot* AddPlot(int type) override;
54
59 virtual void SetPlot(vtkPlotPie* plot);
60
64 vtkPlot* GetPlot(vtkIdType index) override;
65
70
74 void SetShowLegend(bool visible) override;
75
81
85 void SetScene(vtkContextScene* scene) override;
86
90 bool Hit(const vtkContextMouseEvent& mouse) override;
91
95 bool MouseEnterEvent(const vtkContextMouseEvent& mouse) override;
96
100 bool MouseMoveEvent(const vtkContextMouseEvent& mouse) override;
101
105 bool MouseLeaveEvent(const vtkContextMouseEvent& mouse) override;
106
110 bool MouseButtonPressEvent(const vtkContextMouseEvent& mouse) override;
111
116
120 bool MouseWheelEvent(const vtkContextMouseEvent& mouse, int delta) override;
121
122protected:
124 ~vtkChartPie() override;
125
130
135
140
145
146private:
147 vtkChartPie(const vtkChartPie&) = delete;
148 void operator=(const vtkChartPie&) = delete;
149
153 bool LocatePointInPlots(const vtkContextMouseEvent& mouse);
154
158 vtkChartPiePrivate* Private;
159};
160
161VTK_ABI_NAMESPACE_END
162#endif // vtkChartPie_h
draw the chart legend
Factory class for drawing pie charts.
Definition vtkChartPie.h:28
static vtkChartPie * New()
Creates a 2D Chart object.
bool PlotTransformValid
Does the plot area transform need to be recalculated?
bool MouseLeaveEvent(const vtkContextMouseEvent &mouse) override
Mouse leave event.
vtkPlot * GetPlot(vtkIdType index) override
Get the plot at the specified index, returns null if the index is invalid.
bool Paint(vtkContext2D *painter) override
Paint event for the chart, called whenever the chart needs to be drawn.
void Update() override
Perform any updates to the item that may be necessary before rendering.
void SetShowLegend(bool visible) override
Set whether the chart should draw a legend.
void RecalculatePlotTransforms()
Recalculate the necessary transforms.
vtkPlot * AddPlot(int type) override
Add a plot to the chart.
bool MouseMoveEvent(const vtkContextMouseEvent &mouse) override
Mouse move event.
bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) override
Mouse button down event.
bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse) override
Mouse button release event.
bool Hit(const vtkContextMouseEvent &mouse) override
Return true if the supplied x, y coordinate is inside the item.
vtkIdType GetNumberOfPlots() override
Get the number of plots the chart contains.
~vtkChartPie() override
vtkChartLegend * Legend
The legend for the chart.
bool MouseEnterEvent(const vtkContextMouseEvent &mouse) override
Mouse enter event.
virtual void SetPlot(vtkPlotPie *plot)
Set plot to use for the chart.
void SetScene(vtkContextScene *scene) override
Set the vtkContextScene for the item, always set for an item in a scene.
vtkTooltipItem * Tooltip
The tooltip item for the chart - can be used to display extra information.
vtkChartLegend * GetLegend() override
Get the legend for the chart, if available.
bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta) override
Mouse wheel event, positive delta indicates forward movement of the wheel.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Factory class for drawing 2D charts.
Definition vtkChart.h:41
Class for drawing 2D primitives to a graphical context.
data structure to represent mouse events.
Provides a 2D scene for vtkContextItem objects.
a simple class to control print indentation
Definition vtkIndent.h:29
Class for drawing a Pie diagram.
Definition vtkPlotPie.h:29
Abstract class for 2D plots.
Definition vtkPlot.h:44
takes care of drawing 2D axes
int vtkIdType
Definition vtkType.h:315