VTK  9.2.6
vtkPlotPie.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPlotPie.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 
26 #ifndef vtkPlotPie_h
27 #define vtkPlotPie_h
28 
29 #include "vtkChartsCoreModule.h" // For export macro
30 #include "vtkPlot.h"
31 #include "vtkSmartPointer.h" // To hold ColorSeries etc.
32 
33 class vtkContext2D;
34 class vtkColorSeries;
35 class vtkPoints2D;
36 
37 class vtkPlotPiePrivate;
38 
39 class VTKCHARTSCORE_EXPORT vtkPlotPie : public vtkPlot
40 {
41 public:
42  vtkTypeMacro(vtkPlotPie, vtkPlot);
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
45  static vtkPlotPie* New();
46 
50  bool Paint(vtkContext2D* painter) override;
51 
58  bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
59 
64  void SetDimensions(int arg1, int arg2, int arg3, int arg4);
65 
70  void SetDimensions(const int arg[4]);
71 
73 
77  vtkGetVector4Macro(Dimensions, int);
79 
83  void SetColorSeries(vtkColorSeries* colorSeries);
84 
88  vtkColorSeries* GetColorSeries();
89 
95  vtkIdType GetNearestPoint(const vtkVector2f& point, const vtkVector2f& tolerance,
96  vtkVector2f* location, vtkIdType* segmentId) override;
98 
105  bool UpdateCache() override;
106 
107 protected:
108  vtkPlotPie();
109  ~vtkPlotPie() override;
110 
111  int Dimensions[4];
112 
117 
122 
123 private:
124  vtkPlotPie(const vtkPlotPie&) = delete;
125  void operator=(const vtkPlotPie&) = delete;
126 
127  vtkPlotPiePrivate* Private;
128 };
129 
130 #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:116
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:332
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:57
a simple class to control print indentation
Definition: vtkIndent.h:39
represent and manipulate 2D points
Definition: vtkPoints2D.h:36
virtual bool UpdateCache()
Update the internal cache.
Definition: vtkPlot.h:414
Abstract class for 2D plots.
Definition: vtkPlot.h:53
stores a list of colors.
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:39
vtkPoints2D * Points
Store a well packed set of angles for the wedges of the pie.
Definition: vtkPlotPie.h:121