VTK  9.7.1
vtkPlotPie.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 
14 #ifndef vtkPlotPie_h
15 #define vtkPlotPie_h
16 
17 #include "vtkChartsCoreModule.h" // For export macro
18 #include "vtkPlot.h"
19 #include "vtkSmartPointer.h" // To hold ColorSeries etc.
20 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
21 
22 VTK_ABI_NAMESPACE_BEGIN
23 class vtkContext2D;
24 class vtkColorSeries;
25 class vtkPoints2D;
26 
27 class vtkPlotPiePrivate;
28 
29 class VTKCHARTSCORE_EXPORT VTK_MARSHALAUTO vtkPlotPie : public vtkPlot
30 {
31 public:
32  vtkTypeMacro(vtkPlotPie, vtkPlot);
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
35  static vtkPlotPie* New();
36 
40  bool Paint(vtkContext2D* painter) override;
41 
48  bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
49 
54  void SetDimensions(int arg1, int arg2, int arg3, int arg4);
55 
60  void SetDimensions(const int arg[4]);
61 
63 
67  vtkGetVector4Macro(Dimensions, int);
69 
73  void SetColorSeries(vtkColorSeries* colorSeries);
74 
78  vtkColorSeries* GetColorSeries();
79 
85  vtkIdType GetNearestPoint(const vtkVector2f& point, const vtkVector2f& tolerance,
86  vtkVector2f* location, vtkIdType* segmentId) override;
88 
95  bool UpdateCache() override;
96 
97 protected:
98  vtkPlotPie();
99  ~vtkPlotPie() override;
100 
101  int Dimensions[4];
102 
107 
112 
113 private:
114  vtkPlotPie(const vtkPlotPie&) = delete;
115  void operator=(const vtkPlotPie&) = delete;
116 
117  vtkPlotPiePrivate* Private;
118 };
119 
120 VTK_ABI_NAMESPACE_END
121 #endif // vtkPlotPie_h
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf &rect, int legendIndex)
Paint legend event for the plot, called whenever the legend needs the plot items symbol/mark/line dra...
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.
vtkSmartPointer< vtkColorSeries > ColorSeries
The color series to use for the pie.
Definition: vtkPlotPie.h:106
virtual vtkIdType GetNearestPoint(const vtkVector2f &point, const vtkVector2f &tolerance, vtkVector2f *location, vtkIdType *segmentId)
Function to query a plot for the nearest point to the specified coordinate.
int vtkIdType
Definition: vtkType.h:363
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:49
a simple class to control print indentation
Definition: vtkIndent.h:28
represent and manipulate 2D points
Definition: vtkPoints2D.h:27
virtual bool UpdateCache()
Update the internal cache.
Definition: vtkPlot.h:455
Abstract class for 2D plots.
Definition: vtkPlot.h:43
stores a list of colors.
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Class for drawing a Pie diagram.
Definition: vtkPlotPie.h:29
vtkPoints2D * Points
Store a well packed set of angles for the wedges of the pie.
Definition: vtkPlotPie.h:111