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 
45 #ifndef vtkPlotPie_h
46 #define vtkPlotPie_h
47 
48 #include "vtkChartsCoreModule.h" // For export macro
49 #include "vtkPlot.h"
50 #include "vtkSmartPointer.h" // To hold ColorSeries etc.
51 
52 class vtkContext2D;
53 class vtkColorSeries;
54 class vtkPoints2D;
55 
56 class vtkPlotPiePrivate;
57 
58 class VTKCHARTSCORE_EXPORT vtkPlotPie : public vtkPlot
59 {
60 public:
61  vtkTypeMacro(vtkPlotPie, vtkPlot);
62  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
64  static vtkPlotPie* New();
65 
69  bool Paint(vtkContext2D* painter) override;
70 
77  bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
78 
83  void SetDimensions(int arg1, int arg2, int arg3, int arg4);
84 
89  void SetDimensions(const int arg[4]);
90 
92 
96  vtkGetVector4Macro(Dimensions, int);
98 
102  void SetColorSeries(vtkColorSeries* colorSeries);
103 
108 
115  vtkVector2f* location, vtkIdType* segmentId) override;
117 
124  bool UpdateCache() override;
125 
126 protected:
128  ~vtkPlotPie() override;
129 
130  int Dimensions[4];
131 
136 
141 
142 private:
143  vtkPlotPie(const vtkPlotPie&) = delete;
144  void operator=(const vtkPlotPie&) = delete;
145 
146  vtkPlotPiePrivate* Private;
147 };
148 
149 #endif // vtkPlotPie_h
stores a list of colors.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:77
a simple class to control print indentation
Definition: vtkIndent.h:119
Class for drawing a Pie diagram.
Definition: vtkPlotPie.h:59
~vtkPlotPie() override
static vtkPlotPie * New()
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.
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:135
vtkPoints2D * Points
Store a well packed set of angles for the wedges of the pie.
Definition: vtkPlotPie.h:140
vtkColorSeries * GetColorSeries()
Get the color series used.
Abstract class for 2D plots.
Definition: vtkPlot.h:163
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:37
@ point
Definition: vtkX3D.h:242
@ location
Definition: vtkX3D.h:412
int vtkIdType
Definition: vtkType.h:332