VTK
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) VTK_OVERRIDE;
46 
50  static vtkPlotStacked *New();
51 
53 
56  void SetColor(unsigned char r, unsigned char g, unsigned char b,
57  unsigned char a) VTK_OVERRIDE;
58  void SetColor(double r, double g, double b) VTK_OVERRIDE;
59  void GetColor(double rgb[3]) VTK_OVERRIDE;
61 
67  void Update() VTK_OVERRIDE;
68 
72  bool Paint(vtkContext2D *painter) VTK_OVERRIDE;
73 
80  bool PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
81  int legendIndex) VTK_OVERRIDE;
82 
86  void GetBounds(double bounds[4]) VTK_OVERRIDE;
87 
92  void GetUnscaledInputBounds(double bounds[4]) VTK_OVERRIDE;
93 
97  void SetInputArray(int index, const vtkStdString &name) VTK_OVERRIDE;
98 
102  void SetColorSeries(vtkColorSeries *colorSeries);
103 
107  vtkColorSeries *GetColorSeries();
108 
112  vtkStringArray *GetLabels() VTK_OVERRIDE;
113 
119  vtkIdType GetNearestPoint(const vtkVector2f& point,
120  const vtkVector2f& tolerance,
121  vtkVector2f* location) VTK_OVERRIDE;
122 
126  bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max) VTK_OVERRIDE;
127 
128 protected:
129  vtkPlotStacked();
130  ~vtkPlotStacked() VTK_OVERRIDE;
131 
135  bool UpdateTableCache(vtkTable *table);
136 
137  // Descript:
138  // For stacked plots the Extent data must be greater than (or equal to) the
139  // base data. Insure that this is true
140  void FixExtent();
141 
146  void CalculateLogSeries();
147 
152  vtkIdTypeArray* BaseBadPoints;
153 
158  vtkIdTypeArray* ExtentBadPoints;
159 
164 
165  bool LogX, LogY;
166 
171 
172 private:
173  vtkPlotStacked(const vtkPlotStacked &) VTK_DELETE_FUNCTION;
174  void operator=(const vtkPlotStacked &) VTK_DELETE_FUNCTION;
175 
176  vtkPlotStackedPrivate *Private;
177 
178 };
179 
180 #endif //vtkPlotStacked_h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:41
vtkTimeStamp BuildTime
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
record modification and/or execution time
Definition: vtkTimeStamp.h:32
a vtkAbstractArray subclass for strings
dynamic, self-adjusting array of vtkIdType
Hold a reference to a vtkObjectBase instance.
int vtkIdType
Definition: vtkType.h:345
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:52
a simple class to control print indentation
Definition: vtkIndent.h:33
represent and manipulate 2D points
Definition: vtkPoints2D.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
Abstract class for 2D plots.
Definition: vtkPlot.h:46
Class for drawing an stacked polygon plot given an X, Ybase, Yextent in a vtkTable.
Factory class for drawing XY charts.
Definition: vtkChartXY.h:43
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:62
stores a list of colors.
virtual void GetColor(double rgb[3])
Set the plot color.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void Update()
Perform any updates to the item that may be necessary before rendering.
#define max(a, b)