VTK  9.4.20241221
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
33#ifndef vtkPlotPie_h
34#define vtkPlotPie_h
35
36#include "vtkChartsCoreModule.h" // For export macro
37#include "vtkPlot.h"
38#include "vtkSmartPointer.h" // To hold ColorSeries etc.
39#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
40
41VTK_ABI_NAMESPACE_BEGIN
42class vtkContext2D;
43class vtkColorSeries;
44class vtkPoints2D;
45
46class vtkPlotPiePrivate;
47
48class VTKCHARTSCORE_EXPORT VTK_MARSHALAUTO vtkPlotPie : public vtkPlot
49{
50public:
51 vtkTypeMacro(vtkPlotPie, vtkPlot);
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
54 static vtkPlotPie* New();
55
59 bool Paint(vtkContext2D* painter) override;
60
67 bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
68
73 void SetDimensions(int arg1, int arg2, int arg3, int arg4);
74
79 void SetDimensions(const int arg[4]);
80
82
86 vtkGetVector4Macro(Dimensions, int);
88
92 void SetColorSeries(vtkColorSeries* colorSeries);
93
98
104 vtkIdType GetNearestPoint(const vtkVector2f& point, const vtkVector2f& tolerance,
105 vtkVector2f* location, vtkIdType* segmentId) override;
107
114 bool UpdateCache() override;
115
116protected:
118 ~vtkPlotPie() override;
119
120 int Dimensions[4];
121
126
131
132private:
133 vtkPlotPie(const vtkPlotPie&) = delete;
134 void operator=(const vtkPlotPie&) = delete;
135
136 vtkPlotPiePrivate* Private;
137};
138
139VTK_ABI_NAMESPACE_END
140#endif // vtkPlotPie_h
stores a list of colors.
Class for drawing 2D primitives to a graphical context.
a simple class to control print indentation
Definition vtkIndent.h:108
Class for drawing a Pie diagram.
Definition vtkPlotPie.h:49
static vtkPlotPie * New()
~vtkPlotPie() override
vtkIdType GetNearestPoint(const vtkVector2f &point, const vtkVector2f &tolerance, vtkVector2f *location, vtkIdType *segmentId) override
Function to query a plot for the nearest point to the specified coordinate.
void SetColorSeries(vtkColorSeries *colorSeries)
Set the color series to use for the Pie.
bool PaintLegend(vtkContext2D *painter, const vtkRectf &rect, int legendIndex) override
Paint legend event for the XY plot, called whenever the legend needs the plot items symbol/mark/line ...
bool Paint(vtkContext2D *painter) override
Paint event for the item.
void SetDimensions(int arg1, int arg2, int arg3, int arg4)
Set the dimensions of the pie, arguments 1 and 2 are the x and y coordinate of the bottom corner.
vtkColorSeries * GetColorSeries()
Get the color series used.
bool UpdateCache() override
Update the internal cache.
void SetDimensions(const int arg[4])
Set the dimensions of the pie, elements 0 and 1 are the x and y coordinate of the bottom corner.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSmartPointer< vtkColorSeries > ColorSeries
The color series to use for the pie.
Definition vtkPlotPie.h:125
vtkPoints2D * Points
Store a well packed set of angles for the wedges of the pie.
Definition vtkPlotPie.h:130
Abstract class for 2D plots.
Definition vtkPlot.h:153
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.
represent and manipulate 2D points
Definition vtkPoints2D.h:27
Hold a reference to a vtkObjectBase instance.
int vtkIdType
Definition vtkType.h:315
#define VTK_MARSHALAUTO