VTK
vtkPlotBox.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPlotBox.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 vtkPlotBox_h
26 #define vtkPlotBox_h
27 
28 #include "vtkChartsCoreModule.h" // For export macro
29 #include "vtkPlot.h"
30 #include "vtkStdString.h" // For vtkStdString ivars
31 
32 class vtkBrush;
33 class vtkTextProperty;
34 class vtkTable;
35 class vtkStdString;
36 class vtkScalarsToColors;
37 
38 class VTKCHARTSCORE_EXPORT vtkPlotBox : public vtkPlot
39 {
40 public:
41  vtkTypeMacro(vtkPlotBox, vtkPlot);
42  void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE;
43 
47  static vtkPlotBox* New();
48 
54  void Update() VTK_OVERRIDE;
55 
59  bool Paint(vtkContext2D *painter) VTK_OVERRIDE;
60 
67  bool PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
68  int legendIndex) VTK_OVERRIDE;
69 
71 
74  void SetInputData(vtkTable *table) VTK_OVERRIDE;
75  void SetInputData(vtkTable *table, const vtkStdString&,
76  const vtkStdString&) VTK_OVERRIDE
77  {
78  this->SetInputData(table);
79  }
81 
86  vtkStringArray *GetLabels() VTK_OVERRIDE;
87 
93  vtkIdType GetNearestPoint(const vtkVector2f& point,
94  const vtkVector2f& tolerance,
95  vtkVector2f* location) VTK_OVERRIDE;
96 
98 
101  void SetLookupTable(vtkScalarsToColors *lut);
102  vtkScalarsToColors *GetLookupTable();
104 
108  void SetColumnColor(const vtkStdString& colName, double *rgb);
109 
114  virtual void CreateDefaultLookupTable();
115 
117 
120  vtkGetMacro(BoxWidth, float);
121  vtkSetMacro(BoxWidth, float);
123 
125 
128  vtkGetObjectMacro(TitleProperties, vtkTextProperty);
130 
131 protected:
132  vtkPlotBox();
133  ~vtkPlotBox() VTK_OVERRIDE;
134 
135  void DrawBoxPlot(int, unsigned char*, double, vtkContext2D*);
136 
140  bool UpdateTableCache(vtkTable *table);
141 
143 
146  class Private;
147  Private* Storage;
149 
154 
158  float BoxWidth;
159 
163  vtkScalarsToColors *LookupTable;
164 
168  vtkTextProperty* TitleProperties;
169 
170 private:
171  vtkPlotBox(const vtkPlotBox &) VTK_DELETE_FUNCTION;
172  void operator=(const vtkPlotBox &) VTK_DELETE_FUNCTION;
173 
174 };
175 
176 #endif //vtkPlotBox_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
int vtkIdType
Definition: vtkType.h:345
Superclass for mapping scalar values to colors.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:52
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:37
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual vtkStringArray * GetLabels()
Get the plot labels.
Abstract class for 2D plots.
Definition: vtkPlot.h:46
Class for drawing box plots.
Definition: vtkPlotBox.h:38
represent text properties.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:62
virtual void SetInputData(vtkTable *table)
This is a convenience function to set the input table and the x, y column for the plot...
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.