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 
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  virtual void PrintSelf(ostream &os, vtkIndent indent);
49 
53  static vtkPlotStacked *New();
54 
56 
59  virtual void SetColor(unsigned char r, unsigned char g, unsigned char b,
60  unsigned char a);
61  virtual void SetColor(double r, double g, double b);
62  virtual void GetColor(double rgb[3]);
64 
70  virtual void Update();
71 
75  virtual bool Paint(vtkContext2D *painter);
76 
83  virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
84  int legendIndex);
85 
89  virtual void GetBounds(double bounds[4]);
90 
95  virtual void GetUnscaledInputBounds(double bounds[4]);
96 
100  virtual void SetInputArray(int index, const vtkStdString &name);
101 
105  void SetColorSeries(vtkColorSeries *colorSeries);
106 
111 
116 
123  const vtkVector2f& tolerance,
125 
129  virtual bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max);
130 
131 protected:
134 
139 
140  // Descript:
141  // For stacked plots the Extent data must be greater than (or equal to) the
142  // base data. Insure that this is true
143  void FixExtent();
144 
150 
156 
162 
167 
168  bool LogX, LogY;
169 
174 
175 private:
176  vtkPlotStacked(const vtkPlotStacked &) VTK_DELETE_FUNCTION;
177  void operator=(const vtkPlotStacked &) VTK_DELETE_FUNCTION;
178 
179  vtkPlotStackedPrivate *Private;
180 
181 };
182 
183 #endif //vtkPlotStacked_h
vtkPoints2D
represent and manipulate 2D points
Definition: vtkPoints2D.h:37
vtkPlotStacked::PaintLegend
virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf &rect, int legendIndex)
Paint legend event for the Stacked plot, called whenever the legend needs the plot items symbol/mark/...
vtkPlotStacked
Class for drawing an stacked polygon plot given an X, Ybase, Yextent in a vtkTable.
Definition: vtkPlotStacked.h:45
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::GetUnscaledInputBounds
virtual void GetUnscaledInputBounds(double bounds[4])
Get the unscaled input bounds for this mapper as (Xmin,Xmax,Ymin,Ymax).
vtkPlotStacked::LogY
bool LogY
Definition: vtkPlotStacked.h:168
vtkPlotStacked::CalculateLogSeries
void CalculateLogSeries()
Handle calculating the log of the x or y series if necessary.
vtkPlotStacked::GetBounds
virtual void GetBounds(double bounds[4])
Get the bounds for this mapper as (Xmin,Xmax,Ymin,Ymax).
vtkPlotStacked::New
static vtkPlotStacked * New()
Creates a Stacked Plot Object.
vtkPlot.h
vtkIdType
int vtkIdType
Definition: vtkType.h:287
vtkPlotStacked::GetLabels
virtual vtkStringArray * GetLabels()
Get the plot labels.
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:69
vtkColorSeries
stores a list of colors.
Definition: vtkColorSeries.h:55
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:36
vtkPlotStacked::ColorSeries
vtkSmartPointer< vtkColorSeries > ColorSeries
The color series to use for each series.
Definition: vtkPlotStacked.h:173
vtkSmartPointer< vtkColorSeries >
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:58
vtkPlot
Abstract class for 2D plots.
Definition: vtkPlot.h:53
vtkPlotStacked::vtkPlotStacked
vtkPlotStacked()
vtkPlotStacked::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkPlotStacked::GetColorSeries
vtkColorSeries * GetColorSeries()
Get the color series used if when this is a stacked bar plot.
vtkPlotStacked::SelectPoints
virtual bool SelectPoints(const vtkVector2f &min, const vtkVector2f &max)
Select all points in the specified rectangle.
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:31
vtkPlotStacked::FixExtent
void FixExtent()
vtkPlotStacked::SetColor
virtual void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Set the plot color.
vtkPlotStacked::~vtkPlotStacked
~vtkPlotStacked()
vtkX3D::point
@ point
Definition: vtkX3D.h:236
vtkPlotStacked::SetInputArray
virtual void SetInputArray(int index, const vtkStdString &name)
When used to set additional arrays, stacked bars are created.
vtkPlotStacked::GetNearestPoint
virtual vtkIdType GetNearestPoint(const vtkVector2f &point, const vtkVector2f &tolerance, vtkVector2f *location)
Function to query a plot for the nearest point to the specified coordinate.
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
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:161
vtkPlotStacked::Update
virtual void Update()
Perform any updates to the item that may be necessary before rendering.
vtkPlotStacked::GetColor
virtual void GetColor(double rgb[3])
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkPlotStacked::BuildTime
vtkTimeStamp BuildTime
The point cache is marked dirty until it has been initialized.
Definition: vtkPlotStacked.h:166
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:42
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:43
vtkX3D::location
@ location
Definition: vtkX3D.h:406
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:155
vtkChartXY
Factory class for drawing XY charts.
Definition: vtkChartXY.h:50
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:49
vtkPlotStacked::SetColor
virtual void SetColor(double r, double g, double b)
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkRectf
Definition: vtkRect.h:297
vtkVector2f
Definition: vtkVector.h:338
vtkPlotStacked::Paint
virtual bool Paint(vtkContext2D *painter)
Paint event for the Stacked plot, called whenever the chart needs to be drawn.