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 "vtkChartsCoreModule.h" // For export macro
32 #include "vtkChartMatrix.h"
33 #include "vtkSmartPointer.h" // For ivars
34 #include "vtkNew.h" // For ivars
35 #include "vtkColor.h" // For member function return
36 #include "vtkStdString.h" // For ivars
37 
38 class vtkStringArray;
39 class vtkTable;
40 class vtkAxis;
41 class vtkAnnotationLink;
42 class vtkTextProperty;
43 class vtkTooltipItem;
45 
47 {
48 public:
49  enum {
53  NOPLOT
54  };
55 
57  virtual void PrintSelf(ostream &os, vtkIndent indent);
58 
60  static vtkScatterPlotMatrix *New();
61 
64  virtual void Update();
65 
67  virtual bool Paint(vtkContext2D *painter);
68 
69  virtual void SetScene(vtkContextScene *scene);
70 
74  virtual bool SetActivePlot(const vtkVector2i& position);
75 
77  virtual vtkVector2i GetActivePlot();
78 
81  vtkAnnotationLink* GetAnnotationLink();
82 
86  virtual void SetInput(vtkTable *table);
87 
89  void SetColumnVisibility(const vtkStdString& name, bool visible);
90 
93  void InsertVisibleColumn(const vtkStdString& name, int index);
94 
96  bool GetColumnVisibility(const vtkStdString& name);
97 
100  void SetColumnVisibilityAll(bool visible);
101 
103  virtual vtkStringArray* GetVisibleColumns();
104 
107  virtual void SetVisibleColumns(vtkStringArray* visColumns);
108 
111  virtual void SetNumberOfBins(int numberOfBins);
112 
115  virtual int GetNumberOfBins() const { return this->NumberOfBins; }
116 
118  void SetPlotColor(int plotType, const vtkColor4ub& color);
119 
121  void SetPlotMarkerStyle(int plotType, int style);
122 
124  void SetPlotMarkerSize(int plotType, float size);
125 
127  bool Hit(const vtkContextMouseEvent &mouse);
128 
130  bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
131 
133  bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
134 
137 
139 
141  int GetPlotType(const vtkVector2i &pos);
142  int GetPlotType(int row, int column);
144 
146 
147  void SetTitle(const vtkStdString& title);
148  vtkStdString GetTitle();
150 
152 
154  void SetTitleProperties(vtkTextProperty *prop);
155  vtkTextProperty* GetTitleProperties();
157 
159 
162  void SetGridVisibility(int plotType, bool visible);
163  bool GetGridVisibility(int plotType);
165 
167 
169  void SetBackgroundColor(int plotType, const vtkColor4ub& color);
170  vtkColor4ub GetBackgroundColor(int plotType);
172 
174 
176  void SetAxisColor(int plotType, const vtkColor4ub& color);
177  vtkColor4ub GetAxisColor(int plotType);
179 
181 
183  void SetGridColor(int plotType, const vtkColor4ub& color);
184  vtkColor4ub GetGridColor(int plotType);
186 
188 
191  void SetAxisLabelVisibility(int plotType, bool visible);
192  bool GetAxisLabelVisibility(int plotType);
194 
196 
199  void SetAxisLabelProperties(int plotType, vtkTextProperty *prop);
200  vtkTextProperty* GetAxisLabelProperties(int plotType);
202 
204 
206  void SetAxisLabelNotation(int plotType, int notation);
207  int GetAxisLabelNotation(int plotType);
209 
211 
213  void SetAxisLabelPrecision(int plotType, int precision);
214  int GetAxisLabelPrecision(int plotType);
216 
218 
220  void SetTooltipNotation(int plotType, int notation);
221  void SetTooltipPrecision(int plotType, int precision);
222  int GetTooltipNotation(int plotType);
223  int GetTooltipPrecision(int plotType);
225 
228  void SetTooltip(vtkTooltipItem *tooltip);
229 
232  vtkTooltipItem* GetTooltip() const;
233 
235  void SetIndexedLabels(vtkStringArray *labels);
236 
238  vtkStringArray* GetIndexedLabels() const;
239 
241 
242  void SetScatterPlotSelectedRowColumnColor(const vtkColor4ub& color);
243  vtkColor4ub GetScatterPlotSelectedRowColumnColor();
245 
247 
248  void SetScatterPlotSelectedActiveColor(const vtkColor4ub& color);
249  vtkColor4ub GetScatterPlotSelectedActiveColor();
251 
253  void UpdateSettings();
254 
256  void UpdateChartSettings(int plotType);
257 
259 
263  virtual void SetSelectionMode(int);
264  vtkGetMacro(SelectionMode, int);
266 
268  vtkStdString GetColumnName(int column);
269 
271  vtkStdString GetRowName(int row);
272 
275  void SetNumberOfFrames(int frames);
276 
279  int GetNumberOfFrames();
280 
282  void ClearAnimationPath();
283 
287  bool AddAnimationPath(const vtkVector2i &move);
288 
290  vtkIdType GetNumberOfAnimationPathElements();
291 
293  vtkVector2i GetAnimationPathElement(vtkIdType i);
294 
296  bool BeginAnimationPath(vtkRenderWindowInteractor* interactor);
297 
300  virtual void AdvanceAnimation();
301 
303  virtual vtkChart * GetMainChart();
304 
305 protected:
308 
311  void UpdateLayout();
312 
314 
316  void AttachAxisRangeListener(vtkAxis*);
317  void AxisRangeForwarderCallback(vtkObject*, unsigned long, void*);
319 
322  void BigChartSelectionCallback(vtkObject*, unsigned long, void*);
323 
326  virtual void UpdateAnimationPath(const vtkVector2i& newActivePos);
327 
330  virtual void StartAnimation(vtkRenderWindowInteractor* interactor);
331 
333 
334  static void ProcessEvents(vtkObject *caller, unsigned long event,
335  void *clientData, void *callerData);
337 
338  // The position of the active plot (defaults to 0, 1).
340 
341  // Weakly owned input data for the scatter plot matrix.
343 
344  // Strongly owned internal data for the column visibility.
346 
347  // The number of bins in the histograms.
349 
350  // The title of the scatter plot matrix.
353 
354  // The mode when the chart is doing selection.
356 
357  // How many frames should animations consist of, 0 means no transitions.
359 
360 private:
361  vtkScatterPlotMatrix(const vtkScatterPlotMatrix &); // Not implemented.
362  void operator=(const vtkScatterPlotMatrix &); // Not implemented.
363 
364  class PIMPL;
365  PIMPL *Private;
366  friend class PIMPL;
367 
368  // Go through the process of calculating axis ranges, etc...
369  void UpdateAxes();
370  void ApplyAxisSetting(vtkChart *chart, const vtkStdString &x,
371  const vtkStdString &y);
372 };
373 
374 #endif //vtkScatterPlotMatrix_h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:46
abstract base class for most VTK objects
Definition: vtkObject.h:61
container for a matrix of charts.
virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse)
virtual void Update()
a vtkAbstractArray subclass for strings
vtkSmartPointer< vtkTextProperty > TitleProperties
int vtkIdType
Definition: vtkType.h:275
platform-independent render window interaction including picking and frame rate control.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:56
Factory class for drawing 2D charts.
Definition: vtkChart.h:49
virtual void SetScene(vtkContextScene *scene)
takes care of drawing 2D axes
Definition: vtkAxis.h:70
Provides a 2D scene for vtkContextItem objects.
data structure to represent mouse events.
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
represent text properties.
virtual bool Paint(vtkContext2D *painter)
container for a matrix of charts.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:67
static vtkChartMatrix * New()
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
vtkSmartPointer< vtkTable > Input
virtual bool Hit(const vtkContextMouseEvent &mouse)
vtkNew< vtkStringArray > VisibleColumns
takes care of drawing 2D axes
virtual void PrintSelf(ostream &os, vtkIndent indent)
virtual int GetNumberOfBins() const
#define VTKCHARTSCORE_EXPORT