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 
44 #ifndef vtkPlotStacked_h
45 #define vtkPlotStacked_h
46 
47 #include "vtkChartsCoreModule.h" // For export macro
48 #include "vtkPlot.h"
49 
50 class vtkChartXY;
51 class vtkContext2D;
52 class vtkTable;
53 class vtkPoints2D;
54 class vtkStdString;
55 class vtkImageData;
56 class vtkColorSeries;
57 
58 class vtkPlotStackedPrivate;
59 
60 class VTKCHARTSCORE_EXPORT vtkPlotStacked : public vtkPlot
61 {
62 public:
63  vtkTypeMacro(vtkPlotStacked, vtkPlot);
64  void PrintSelf(ostream& os, vtkIndent indent) override;
65 
69  static vtkPlotStacked* New();
70 
72 
75  void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a) override;
76  void SetColor(double r, double g, double b) override;
77  void GetColor(double rgb[3]) override;
79 
85  void Update() override;
86 
90  bool Paint(vtkContext2D* painter) override;
91 
98  bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
99 
103  void GetBounds(double bounds[4]) override;
104 
109  void GetUnscaledInputBounds(double bounds[4]) override;
110 
114  void SetInputArray(int index, const vtkStdString& name) override;
115 
119  void SetColorSeries(vtkColorSeries* colorSeries);
120 
125 
130 
137  vtkVector2f* location, vtkIdType* segmentId) override;
139 
143  bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max) override;
144 
145 protected:
147  ~vtkPlotStacked() override;
148 
153 
154  // Descript:
155  // For stacked plots the Extent data must be greater than (or equal to) the
156  // base data. Ensure that this is true
157  void FixExtent();
158 
164 
170 
176 
181 
182  bool LogX, LogY;
183 
188 
189 private:
190  vtkPlotStacked(const vtkPlotStacked&) = delete;
191  void operator=(const vtkPlotStacked&) = delete;
192 
193  vtkPlotStackedPrivate* Private;
194 };
195 
196 #endif // vtkPlotStacked_h
vtkPoints2D
represent and manipulate 2D points
Definition: vtkPoints2D.h:34
vtkPlotStacked
Class for drawing an stacked polygon plot given an X, Ybase, Yextent in a vtkTable.
Definition: vtkPlotStacked.h:61
vtkPlotStacked::UpdateTableCache
bool UpdateTableCache(vtkTable *table)
Update the table cache.
vtkPlotStacked::SetColorSeries
void SetColorSeries(vtkColorSeries *colorSeries)
Set the color series to use if this becomes a stacked bar plot.
vtkPlotStacked::LogY
bool LogY
Definition: vtkPlotStacked.h:182
vtkPlotStacked::CalculateLogSeries
void CalculateLogSeries()
Handle calculating the log of the x or y series if necessary.
vtkPlotStacked::New
static vtkPlotStacked * New()
Creates a Stacked Plot Object.
vtkPlot.h
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:172
vtkColorSeries
stores a list of colors.
Definition: vtkColorSeries.h:168
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:52
vtkPlotStacked::ColorSeries
vtkSmartPointer< vtkColorSeries > ColorSeries
The color series to use for each series.
Definition: vtkPlotStacked.h:187
vtkSmartPointer< vtkColorSeries >
vtkPlotStacked::SetColor
void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a) override
Set the plot color.
vtkPlotStacked::~vtkPlotStacked
~vtkPlotStacked() override
vtkPlotStacked::Paint
bool Paint(vtkContext2D *painter) override
Paint event for the Stacked plot, called whenever the chart needs to be drawn.
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:73
vtkPlot
Abstract class for 2D plots.
Definition: vtkPlot.h:157
vtkPlotStacked::vtkPlotStacked
vtkPlotStacked()
vtkPlotStacked::GetColorSeries
vtkColorSeries * GetColorSeries()
Get the color series used if when this is a stacked bar plot.
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:31
vtkPlotStacked::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPlotStacked::GetColor
void GetColor(double rgb[3]) override
Set the plot color.
vtkPlotStacked::SetInputArray
void SetInputArray(int index, const vtkStdString &name) override
When used to set additional arrays, stacked bars are created.
vtkPlotStacked::FixExtent
void FixExtent()
vtkPlot::GetNearestPoint
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.
vtkX3D::point
@ point
Definition: vtkX3D.h:242
vtkPlotStacked::GetLabels
vtkStringArray * GetLabels() override
Get the plot labels.
vtkPlotStacked::Update
void Update() override
Perform any updates to the item that may be necessary before rendering.
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkPlotStacked::SetColor
void SetColor(double r, double g, double b) override
Set the plot color.
vtkPlotStacked::ExtentBadPoints
vtkIdTypeArray * ExtentBadPoints
An array containing the indices of all the "bad extent points", meaning any x, y pair that has an inf...
Definition: vtkPlotStacked.h:175
vtkPlotStacked::PaintLegend
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/...
vtkX3D::name
@ name
Definition: vtkX3D.h:225
vtkPlotStacked::GetBounds
void GetBounds(double bounds[4]) override
Get the bounds for this mapper as (Xmin,Xmax,Ymin,Ymax).
vtkPlotStacked::SelectPoints
bool SelectPoints(const vtkVector2f &min, const vtkVector2f &max) override
Select all points in the specified rectangle.
vtkPlotStacked::BuildTime
vtkTimeStamp BuildTime
The point cache is marked dirty until it has been initialized.
Definition: vtkPlotStacked.h:180
vtkPlotStacked::GetUnscaledInputBounds
void GetUnscaledInputBounds(double bounds[4]) override
Get the unscaled input bounds for this mapper as (Xmin,Xmax,Ymin,Ymax).
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:145
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:146
vtkX3D::location
@ location
Definition: vtkX3D.h:412
vtkPlotStacked::BaseBadPoints
vtkIdTypeArray * BaseBadPoints
An array containing the indices of all the "bad base points", meaning any x, y pair that has an infin...
Definition: vtkPlotStacked.h:169
vtkPlotStacked::GetNearestPoint
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.
vtkChartXY
Factory class for drawing XY charts.
Definition: vtkChartXY.h:160
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:105
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkRectf
Definition: vtkRect.h:336
vtkVector2f
Definition: vtkVector.h:491