VTK  9.1.0
vtkPlotStacked.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPlotPoints.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
34#ifndef vtkPlotStacked_h
35#define vtkPlotStacked_h
36
37#include "vtkChartsCoreModule.h" // For export macro
38#include "vtkPlot.h"
39
40class vtkChartXY;
41class vtkContext2D;
42class vtkTable;
43class vtkPoints2D;
44class vtkStdString;
45class vtkImageData;
46class vtkColorSeries;
47
48class vtkPlotStackedPrivate;
49
50class VTKCHARTSCORE_EXPORT vtkPlotStacked : public vtkPlot
51{
52public:
53 vtkTypeMacro(vtkPlotStacked, vtkPlot);
54 void PrintSelf(ostream& os, vtkIndent indent) override;
55
60
62
65 void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a) override;
66 void SetColor(double r, double g, double b) override;
67 void GetColor(double rgb[3]) override;
69
75 void Update() override;
76
80 bool Paint(vtkContext2D* painter) override;
81
88 bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
89
93 void GetBounds(double bounds[4]) override;
94
99 void GetUnscaledInputBounds(double bounds[4]) override;
100
104 void SetInputArray(int index, const vtkStdString& name) override;
105
109 void SetColorSeries(vtkColorSeries* colorSeries);
110
115
120
127 vtkVector2f* location, vtkIdType* segmentId) override;
129
133 bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max) override;
134
135protected:
137 ~vtkPlotStacked() override;
138
143
144 // Descript:
145 // For stacked plots the Extent data must be greater than (or equal to) the
146 // base data. Ensure that this is true
147 void FixExtent();
148
154
160
166
171
172 bool LogX, LogY;
173
178
179private:
180 vtkPlotStacked(const vtkPlotStacked&) = delete;
181 void operator=(const vtkPlotStacked&) = delete;
182
183 vtkPlotStackedPrivate* Private;
184};
185
186#endif // vtkPlotStacked_h
Factory class for drawing XY charts.
Definition: vtkChartXY.h:60
stores a list of colors.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:63
dynamic, self-adjusting array of vtkIdType
topologically and geometrically regular array of data
Definition: vtkImageData.h:57
a simple class to control print indentation
Definition: vtkIndent.h:43
Class for drawing an stacked polygon plot given an X, Ybase, Yextent in a vtkTable.
void Update() override
Perform any updates to the item that may be necessary before rendering.
vtkIdTypeArray * ExtentBadPoints
An array containing the indices of all the "bad extent points", meaning any x, y pair that has an inf...
vtkStringArray * GetLabels() override
Get the plot labels.
bool PaintLegend(vtkContext2D *painter, const vtkRectf &rect, int legendIndex) override
Paint legend event for the Stacked plot, called whenever the legend needs the plot items symbol/mark/...
static vtkPlotStacked * New()
Creates a Stacked Plot Object.
bool SelectPoints(const vtkVector2f &min, const vtkVector2f &max) override
Select all points in the specified rectangle.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a) override
Set the plot color.
~vtkPlotStacked() override
void GetColor(double rgb[3]) override
Set the plot color.
void SetInputArray(int index, const vtkStdString &name) override
When used to set additional arrays, stacked bars are created.
void GetUnscaledInputBounds(double bounds[4]) override
Get the unscaled input bounds for this mapper as (Xmin,Xmax,Ymin,Ymax).
vtkTimeStamp BuildTime
The point cache is marked dirty until it has been initialized.
bool UpdateTableCache(vtkTable *table)
Update the table cache.
bool Paint(vtkContext2D *painter) override
Paint event for the Stacked plot, called whenever the chart needs to be drawn.
void GetBounds(double bounds[4]) override
Get the bounds for this mapper as (Xmin,Xmax,Ymin,Ymax).
vtkSmartPointer< vtkColorSeries > ColorSeries
The color series to use for each series.
void SetColor(double r, double g, double b) override
Set the plot color.
vtkColorSeries * GetColorSeries()
Get the color series used if when this is a stacked bar plot.
vtkIdTypeArray * BaseBadPoints
An array containing the indices of all the "bad base points", meaning any x, y pair that has an infin...
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 if this becomes a stacked bar plot.
void CalculateLogSeries()
Handle calculating the log of the x or y series if necessary.
Abstract class for 2D plots.
Definition: vtkPlot.h:57
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:34
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:45
a vtkAbstractArray subclass for strings
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:72
record modification and/or execution time
Definition: vtkTimeStamp.h:42
@ point
Definition: vtkX3D.h:242
@ location
Definition: vtkX3D.h:412
@ name
Definition: vtkX3D.h:225
@ index
Definition: vtkX3D.h:252
int vtkIdType
Definition: vtkType.h:332
#define max(a, b)