VTK
vtkScatterPlotMatrix.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkScatterPlotMatrix.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 __vtkScatterPlotMatrix_h
29 #define __vtkScatterPlotMatrix_h
30 
31 #include "vtkChartMatrix.h"
32 #include "vtkSmartPointer.h" // For ivars
33 #include "vtkNew.h" // For ivars
34 #include "vtkColor.h" // For member function return
35 #include "vtkStdString.h" // For ivars
36 
37 class vtkStringArray;
38 class vtkTable;
39 class vtkAxis;
40 class vtkAnnotationLink;
41 class vtkTextProperty;
43 
45 {
46 public:
47  enum {
51  NOPLOT
52  };
53 
55  virtual void PrintSelf(ostream &os, vtkIndent indent);
56 
58  static vtkScatterPlotMatrix *New();
59 
62  virtual void Update();
63 
65  virtual bool Paint(vtkContext2D *painter);
66 
70  virtual bool SetActivePlot(const vtkVector2i& position);
71 
73  virtual vtkVector2i GetActivePlot();
74 
78  VTK_LEGACY(vtkAnnotationLink* GetActiveAnnotationLink());
79 
82  vtkAnnotationLink* GetAnnotationLink();
83 
87  virtual void SetInput(vtkTable *table);
88 
90  void SetColumnVisibility(const vtkStdString& name, bool visible);
91 
94  void InsertVisibleColumn(const vtkStdString& name, int index);
95 
97  bool GetColumnVisibility(const vtkStdString& name);
98 
101  void SetColumnVisibilityAll(bool visible);
102 
104  virtual vtkStringArray* GetVisibleColumns();
105 
108  virtual void SetVisibleColumns(vtkStringArray* visColumns);
109 
112  virtual void SetNumberOfBins(int numberOfBins);
113 
116  virtual int GetNumberOfBins() const { return this->NumberOfBins; }
117 
119  void SetPlotColor(int plotType, const vtkColor4ub& color);
120 
122  void SetPlotMarkerStyle(int plotType, int style);
123 
125  void SetPlotMarkerSize(int plotType, float size);
126 
128  bool Hit(const vtkContextMouseEvent &mouse);
129 
131  bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
132 
134  bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
135 
138 
140 
142  int GetPlotType(const vtkVector2i &pos);
143  int GetPlotType(int row, int column);
145 
147 
148  void SetTitle(const vtkStdString& title);
149  vtkStdString GetTitle();
151 
153 
155  void SetTitleProperties(vtkTextProperty *prop);
156  vtkTextProperty* GetTitleProperties();
158 
160 
163  void SetGridVisibility(int plotType, bool visible);
164  bool GetGridVisibility(int plotType);
166 
168 
170  void SetBackgroundColor(int plotType, const vtkColor4ub& color);
171  vtkColor4ub GetBackgroundColor(int plotType);
173 
175 
177  void SetAxisColor(int plotType, const vtkColor4ub& color);
178  vtkColor4ub GetAxisColor(int plotType);
180 
182 
184  void SetGridColor(int plotType, const vtkColor4ub& color);
185  vtkColor4ub GetGridColor(int plotType);
187 
189 
192  void SetAxisLabelVisibility(int plotType, bool visible);
193  bool GetAxisLabelVisibility(int plotType);
195 
197 
200  void SetAxisLabelProperties(int plotType, vtkTextProperty *prop);
201  vtkTextProperty* GetAxisLabelProperties(int plotType);
203 
205 
207  void SetAxisLabelNotation(int plotType, int notation);
208  int GetAxisLabelNotation(int plotType);
210 
212 
214  void SetAxisLabelPrecision(int plotType, int precision);
215  int GetAxisLabelPrecision(int plotType);
217 
219 
221  void SetTooltipNotation(int plotType, int notation);
222  void SetTooltipPrecision(int plotType, int precision);
223  int GetTooltipNotation(int plotType);
224  int GetTooltipPrecision(int plotType);
226 
228 
229  void SetScatterPlotSelectedRowColumnColor(const vtkColor4ub& color);
230  vtkColor4ub GetScatterPlotSelectedRowColumnColor();
232 
234 
235  void SetScatterPlotSelectedActiveColor(const vtkColor4ub& color);
236  vtkColor4ub GetScatterPlotSelectedActiveColor();
238 
240  void UpdateSettings();
241 
243  void UpdateChartSettings(int plotType);
244 
246 
250  virtual void SetSelectionMode(int);
251  vtkGetMacro(SelectionMode, int);
253 
254 protected:
257 
260  void UpdateLayout();
261 
263 
265  void AttachAxisRangeListener(vtkAxis*);
266  void AxisRangeForwarderCallback(vtkObject*, unsigned long, void*);
268 
271  void BigChartSelectionCallback(vtkObject*, unsigned long, void*);
272 
275  virtual void UpdateAnimationPath(const vtkVector2i& newActivePos);
276 
279  virtual void StartAnimation(vtkRenderWindowInteractor* interactor);
280 
281  class PIMPL;
282  PIMPL *Private;
283 
284  // The position of the active plot (defaults to 0, 1).
286 
287  // Weakly owned input data for the scatter plot matrix.
289 
290  // Strongly owned internal data for the column visibility.
292 
293  // The number of bins in the histograms.
295 
296  // The title of the scatter plot matrix.
299 
300  // The mode when the chart is doing selection.
302 
303 private:
304  vtkScatterPlotMatrix(const vtkScatterPlotMatrix &); // Not implemented.
305  void operator=(const vtkScatterPlotMatrix &); // Not implemented.
306 };
307 
308 #endif //__vtkScatterPlotMatrix_h