VTK  9.0.1
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 
25 #ifndef vtkPlotStacked_h
26 #define vtkPlotStacked_h
27 
28 #include "vtkChartsCoreModule.h" // For export macro
29 #include "vtkPlot.h"
30 
31 class vtkChartXY;
32 class vtkContext2D;
33 class vtkTable;
34 class vtkPoints2D;
35 class vtkStdString;
36 class vtkImageData;
37 class vtkColorSeries;
38 
39 class vtkPlotStackedPrivate;
40 
41 class VTKCHARTSCORE_EXPORT vtkPlotStacked : public vtkPlot
42 {
43 public:
44  vtkTypeMacro(vtkPlotStacked, vtkPlot);
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
50  static vtkPlotStacked* New();
51 
53 
56  void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a) override;
57  void SetColor(double r, double g, double b) override;
58  void GetColor(double rgb[3]) override;
60 
66  void Update() override;
67 
71  bool Paint(vtkContext2D* painter) override;
72 
79  bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
80 
84  void GetBounds(double bounds[4]) override;
85 
90  void GetUnscaledInputBounds(double bounds[4]) override;
91 
95  void SetInputArray(int index, const vtkStdString& name) override;
96 
100  void SetColorSeries(vtkColorSeries* colorSeries);
101 
105  vtkColorSeries* GetColorSeries();
106 
110  vtkStringArray* GetLabels() override;
111 
117  vtkIdType GetNearestPoint(const vtkVector2f& point, const vtkVector2f& tolerance,
119 #ifndef VTK_LEGACY_REMOVE
120  vtkIdType* segmentId) override;
121 #else
122  vtkIdType* segmentId = nullptr) override;
123 #endif // VTK_LEGACY_REMOVE
124 
125 #ifndef VTK_LEGACY_REMOVE
127 #endif // VTK_LEGACY_REMOVE
128 
132  bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max) override;
133 
134 protected:
135  vtkPlotStacked();
136  ~vtkPlotStacked() override;
137 
141  bool UpdateTableCache(vtkTable* table);
142 
143  // Descript:
144  // For stacked plots the Extent data must be greater than (or equal to) the
145  // base data. Insure that this is true
146  void FixExtent();
147 
152  void CalculateLogSeries();
153 
159 
165 
170 
171  bool LogX, LogY;
172 
177 
178 private:
179  vtkPlotStacked(const vtkPlotStacked&) = delete;
180  void operator=(const vtkPlotStacked&) = delete;
181 
182  vtkPlotStackedPrivate* Private;
183 };
184 
185 #endif // vtkPlotStacked_h
vtkPoints2D
represent and manipulate 2D points
Definition: vtkPoints2D.h:33
vtkPlotStacked
Class for drawing an stacked polygon plot given an X, Ybase, Yextent in a vtkTable.
Definition: vtkPlotStacked.h:41
vtkPlotStacked::LogY
bool LogY
Definition: vtkPlotStacked.h:171
vtkPlot.h
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:62
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkColorSeries
stores a list of colors.
Definition: vtkColorSeries.h:59
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:32
vtkPlotStacked::ColorSeries
vtkSmartPointer< vtkColorSeries > ColorSeries
The color series to use for each series.
Definition: vtkPlotStacked.h:176
vtkSmartPointer< vtkColorSeries >
vtkPlot::SetColor
virtual void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Set the plot color.
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:52
vtkPlot
Abstract class for 2D plots.
Definition: vtkPlot.h:46
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:31
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
vtkPlot::SelectPoints
virtual bool SelectPoints(const vtkVector2f &min, const vtkVector2f &max)
Select all points in the specified rectangle.
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
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:164
vtkPlot::PaintLegend
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...
vtkX3D::name
@ name
Definition: vtkX3D.h:225
vtkPlotStacked::BuildTime
vtkTimeStamp BuildTime
The point cache is marked dirty until it has been initialized.
Definition: vtkPlotStacked.h:169
vtkPlot::SetInputArray
virtual void SetInputArray(int index, const vtkStdString &name)
Convenience function to set the input arrays.
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:35
vtkPlot::GetLabels
virtual vtkStringArray * GetLabels()
Get the plot labels.
vtkAbstractContextItem::Paint
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.
vtkPlot::GetUnscaledInputBounds
virtual void GetUnscaledInputBounds(double bounds[4])
Provide un-log-scaled bounds for the plot inputs.
Definition: vtkPlot.h:369
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:36
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:158
vtkChartXY
Factory class for drawing XY charts.
Definition: vtkChartXY.h:45
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:34
vtkPlot::GetBounds
virtual void GetBounds(double bounds[4])
Get the bounds for this plot as (Xmin, Xmax, Ymin, Ymax).
Definition: vtkPlot.h:343
vtkPlot::GetColor
virtual void GetColor(double rgb[3])
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkPlot::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkRectf
Definition: vtkRect.h:326
vtkVector2f
Definition: vtkVector.h:432
vtkAbstractContextItem::Update
virtual void Update()
Perform any updates to the item that may be necessary before rendering.