VTK  9.2.6
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 
28 #ifndef vtkPlotStacked_h
29 #define vtkPlotStacked_h
30 
31 #include "vtkChartsCoreModule.h" // For export macro
32 #include "vtkPlot.h"
33 
34 class vtkChartXY;
35 class vtkContext2D;
36 class vtkTable;
37 class vtkPoints2D;
38 class vtkStdString;
39 class vtkImageData;
40 class vtkColorSeries;
41 
42 class vtkPlotStackedPrivate;
43 
44 class VTKCHARTSCORE_EXPORT vtkPlotStacked : public vtkPlot
45 {
46 public:
47  vtkTypeMacro(vtkPlotStacked, vtkPlot);
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
53  static vtkPlotStacked* New();
54 
56 
59  void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a) override;
60  void SetColor(double r, double g, double b) override;
61  void GetColor(double rgb[3]) override;
63 
67  bool Paint(vtkContext2D* painter) override;
68 
75  bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
76 
80  void GetBounds(double bounds[4]) override;
81 
86  void GetUnscaledInputBounds(double bounds[4]) override;
87 
91  void SetInputArray(int index, const vtkStdString& name) override;
92 
96  void SetColorSeries(vtkColorSeries* colorSeries);
97 
101  vtkColorSeries* GetColorSeries();
102 
106  vtkStringArray* GetLabels() override;
107 
113  vtkIdType GetNearestPoint(const vtkVector2f& point, const vtkVector2f& tolerance,
114  vtkVector2f* location, vtkIdType* segmentId) override;
116 
120  bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max) override;
121 
128  bool UpdateCache() override;
129 
130 protected:
131  vtkPlotStacked();
132  ~vtkPlotStacked() override;
133 
137  virtual bool CacheRequiresUpdate() override;
138 
139  // Descript:
140  // For stacked plots the Extent data must be greater than (or equal to) the
141  // base data. Ensure that this is true
142  void FixExtent();
143 
148  void CalculateLogSeries();
149 
155 
161 
162  bool LogX, LogY;
163 
168 
169 private:
170  vtkPlotStacked(const vtkPlotStacked&) = delete;
171  void operator=(const vtkPlotStacked&) = delete;
172 
173  vtkPlotStackedPrivate* Private;
174 };
175 
176 #endif // vtkPlotStacked_h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:38
vtkSmartPointer< vtkColorSeries > ColorSeries
The color series to use for each series.
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.
virtual void GetBounds(double bounds[4])
Get the bounds for this plot as (Xmin, Xmax, Ymin, Ymax).
Definition: vtkPlot.h:352
vtkIdTypeArray * ExtentBadPoints
An array containing the indices of all the "bad extent points", meaning any x, y pair that has an inf...
a vtkAbstractArray subclass for strings
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.
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:332
virtual void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Set the plot color.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:57
virtual bool SelectPoints(const vtkVector2f &min, const vtkVector2f &max)
Select all points in the specified rectangle.
a simple class to control print indentation
Definition: vtkIndent.h:39
represent and manipulate 2D points
Definition: vtkPoints2D.h:36
virtual vtkStringArray * GetLabels()
Get the plot labels.
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
virtual bool UpdateCache()
Update the internal cache.
Definition: vtkPlot.h:414
Abstract class for 2D plots.
Definition: vtkPlot.h:53
Class for drawing an stacked polygon plot given an X, Ybase, Yextent in a vtkTable.
Factory class for drawing XY charts.
Definition: vtkChartXY.h:56
virtual bool CacheRequiresUpdate()
Test if the internal cache requires an update.
virtual void SetInputArray(int index, const vtkStdString &name)
Convenience function to set the input arrays.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:73
stores a list of colors.
virtual void GetUnscaledInputBounds(double bounds[4])
Provide un-log-scaled bounds for the plot inputs.
Definition: vtkPlot.h:378
virtual void GetColor(double rgb[3])
Set the plot color.
vtkIdTypeArray * BaseBadPoints
An array containing the indices of all the "bad base points", meaning any x, y pair that has an infin...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
#define max(a, b)