VTK  9.1.0
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
43#ifndef vtkChartPie_h
44#define vtkChartPie_h
45
46#include "vtkChart.h"
47#include "vtkChartsCoreModule.h" // For export macro
48
49class vtkChartLegend;
50class vtkTooltipItem;
51class vtkChartPiePrivate;
52
53class VTKCHARTSCORE_EXPORT vtkChartPie : public vtkChart
54{
55public:
56 vtkTypeMacro(vtkChartPie, vtkChart);
57 void PrintSelf(ostream& os, vtkIndent indent) override;
58
62 static vtkChartPie* New();
63
69 void Update() override;
70
74 bool Paint(vtkContext2D* painter) override;
75
79 vtkPlot* AddPlot(int type) override;
80
84 vtkIdType AddPlot(vtkPlot* plot) override { return Superclass::AddPlot(plot); }
85
89 vtkPlot* GetPlot(vtkIdType index) override;
90
95
99 void SetShowLegend(bool visible) override;
100
106
110 void SetScene(vtkContextScene* scene) override;
111
115 bool Hit(const vtkContextMouseEvent& mouse) override;
116
120 bool MouseEnterEvent(const vtkContextMouseEvent& mouse) override;
121
125 bool MouseMoveEvent(const vtkContextMouseEvent& mouse) override;
126
130 bool MouseLeaveEvent(const vtkContextMouseEvent& mouse) override;
131
135 bool MouseButtonPressEvent(const vtkContextMouseEvent& mouse) override;
136
141
145 bool MouseWheelEvent(const vtkContextMouseEvent& mouse, int delta) override;
146
147protected:
149 ~vtkChartPie() override;
150
155
160
165
170
171private:
172 vtkChartPie(const vtkChartPie&) = delete;
173 void operator=(const vtkChartPie&) = delete;
174
178 bool LocatePointInPlots(const vtkContextMouseEvent& mouse);
179
183 vtkChartPiePrivate* Private;
184};
185
186#endif // vtkChartPie_h
draw the chart legend
Factory class for drawing pie charts.
Definition: vtkChartPie.h:54
static vtkChartPie * New()
Creates a 2D Chart object.
bool PlotTransformValid
Does the plot area transform need to be recalculated?
Definition: vtkChartPie.h:169
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.
Definition: vtkChartPie.h:159
bool MouseEnterEvent(const vtkContextMouseEvent &mouse) override
Mouse enter event.
void SetScene(vtkContextScene *scene) override
Set the vtkContextScene for the item, always set for an item in a scene.
vtkIdType AddPlot(vtkPlot *plot) override
Add a plot to the chart.
Definition: vtkChartPie.h:84
vtkTooltipItem * Tooltip
The tooltip item for the chart - can be used to display extra information.
Definition: vtkChartPie.h:164
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:45
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:73
data structure to represent mouse events.
Provides a 2D scene for vtkContextItem objects.
a simple class to control print indentation
Definition: vtkIndent.h:113
Abstract class for 2D plots.
Definition: vtkPlot.h:157
takes care of drawing 2D axes
int vtkIdType
Definition: vtkType.h:332