VTK  9.7.1
vtkPlotStacked.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
16 #ifndef vtkPlotStacked_h
17 #define vtkPlotStacked_h
18 
19 #include "vtkChartsCoreModule.h" // For export macro
20 #include "vtkPlot.h"
21 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkChartXY;
25 class vtkContext2D;
26 class vtkTable;
27 class vtkPoints2D;
28 class vtkStdString;
29 class vtkImageData;
30 class vtkColorSeries;
31 
32 class vtkPlotStackedPrivate;
33 
34 class VTKCHARTSCORE_EXPORT VTK_MARSHALAUTO vtkPlotStacked : public vtkPlot
35 {
36 public:
37  vtkTypeMacro(vtkPlotStacked, vtkPlot);
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
43  static vtkPlotStacked* New();
44 
48  void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a) override;
49  void SetColor(unsigned char r, unsigned char g, unsigned char b) override;
50 
52 
55  void SetColorF(double r, double g, double b, double a) override;
56  void SetColorF(double r, double g, double b) override;
58 
60 
63  void GetColorF(double rgb[3]) override;
65 
69  bool Paint(vtkContext2D* painter) override;
70 
77  bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
78 
82  void GetBounds(double bounds[4]) override;
83 
88  void GetUnscaledInputBounds(double bounds[4]) override;
89 
93  void SetInputArray(int index, const vtkStdString& name) override;
94 
98  void SetColorSeries(vtkColorSeries* colorSeries);
99 
103  vtkColorSeries* GetColorSeries();
104 
108  vtkStringArray* GetLabels() override;
109 
115  vtkIdType GetNearestPoint(const vtkVector2f& point, const vtkVector2f& tolerance,
116  vtkVector2f* location, vtkIdType* segmentId) override;
118 
122  bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max) override;
123 
130  bool UpdateCache() override;
131 
132 protected:
133  vtkPlotStacked();
134  ~vtkPlotStacked() override;
135 
139  bool CacheRequiresUpdate() override;
140 
141  // Descript:
142  // For stacked plots the Extent data must be greater than (or equal to) the
143  // base data. Ensure that this is true
144  void FixExtent();
145 
150  void CalculateLogSeries();
151 
157 
163 
164  bool LogX, LogY;
165 
170 
171 private:
172  vtkPlotStacked(const vtkPlotStacked&) = delete;
173  void operator=(const vtkPlotStacked&) = delete;
174 
175  vtkPlotStackedPrivate* Private;
176 };
177 
178 VTK_ABI_NAMESPACE_END
179 #endif // vtkPlotStacked_h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:27
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 void SetColorF(double r, double g, double b, double a)
Set the plot color with floating values (comprised between 0.0 and 1.0)
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:393
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:363
virtual void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Set the plot color with integer values (comprised between 0 and 255)
virtual void GetColorF(double rgb[3])
Get the plot color as floating rgb values (comprised between 0.0 and 1.0)
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:49
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:28
represent and manipulate 2D points
Definition: vtkPoints2D.h:27
virtual vtkStringArray * GetLabels()
Get the plot labels.
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
virtual bool UpdateCache()
Update the internal cache.
Definition: vtkPlot.h:455
Abstract class for 2D plots.
Definition: vtkPlot.h:43
Class for drawing an stacked polygon plot given an X, Ybase, Yextent in a vtkTable.
Factory class for drawing XY charts.
Definition: vtkChartXY.h:49
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:59
stores a list of colors.
virtual void GetUnscaledInputBounds(double bounds[4])
Provide un-log-scaled bounds for the plot inputs.
Definition: vtkPlot.h:419
vtkIdTypeArray * BaseBadPoints
An array containing the indices of all the "bad base points", meaning any x, y pair that has an infin...
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
#define max(a, b)