VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
72  virtual bool SetActivePlot(const vtkVector2i& position);
73 
75  virtual vtkVector2i GetActivePlot();
76 
80  VTK_LEGACY(vtkAnnotationLink* GetActiveAnnotationLink());
81 
84  vtkAnnotationLink* GetAnnotationLink();
85 
89  virtual void SetInput(vtkTable *table);
90 
92  void SetColumnVisibility(const vtkStdString& name, bool visible);
93 
96  void InsertVisibleColumn(const vtkStdString& name, int index);
97 
99  bool GetColumnVisibility(const vtkStdString& name);
100 
103  void SetColumnVisibilityAll(bool visible);
104 
106  virtual vtkStringArray* GetVisibleColumns();
107 
110  virtual void SetVisibleColumns(vtkStringArray* visColumns);
111 
114  virtual void SetNumberOfBins(int numberOfBins);
115 
118  virtual int GetNumberOfBins() const { return this->NumberOfBins; }
119 
121  void SetPlotColor(int plotType, const vtkColor4ub& color);
122 
124  void SetPlotMarkerStyle(int plotType, int style);
125 
127  void SetPlotMarkerSize(int plotType, float size);
128 
130  bool Hit(const vtkContextMouseEvent &mouse);
131 
133  bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
134 
136  bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
137 
140 
142 
144  int GetPlotType(const vtkVector2i &pos);
145  int GetPlotType(int row, int column);
147 
149 
150  void SetTitle(const vtkStdString& title);
151  vtkStdString GetTitle();
153 
155 
157  void SetTitleProperties(vtkTextProperty *prop);
158  vtkTextProperty* GetTitleProperties();
160 
162 
165  void SetGridVisibility(int plotType, bool visible);
166  bool GetGridVisibility(int plotType);
168 
170 
172  void SetBackgroundColor(int plotType, const vtkColor4ub& color);
173  vtkColor4ub GetBackgroundColor(int plotType);
175 
177 
179  void SetAxisColor(int plotType, const vtkColor4ub& color);
180  vtkColor4ub GetAxisColor(int plotType);
182 
184 
186  void SetGridColor(int plotType, const vtkColor4ub& color);
187  vtkColor4ub GetGridColor(int plotType);
189 
191 
194  void SetAxisLabelVisibility(int plotType, bool visible);
195  bool GetAxisLabelVisibility(int plotType);
197 
199 
202  void SetAxisLabelProperties(int plotType, vtkTextProperty *prop);
203  vtkTextProperty* GetAxisLabelProperties(int plotType);
205 
207 
209  void SetAxisLabelNotation(int plotType, int notation);
210  int GetAxisLabelNotation(int plotType);
212 
214 
216  void SetAxisLabelPrecision(int plotType, int precision);
217  int GetAxisLabelPrecision(int plotType);
219 
221 
223  void SetTooltipNotation(int plotType, int notation);
224  void SetTooltipPrecision(int plotType, int precision);
225  int GetTooltipNotation(int plotType);
226  int GetTooltipPrecision(int plotType);
228 
231  void SetTooltip(vtkTooltipItem *tooltip);
232 
235  vtkTooltipItem* GetTooltip() const;
236 
238  void SetIndexedLabels(vtkStringArray *labels);
239 
241  vtkStringArray* GetIndexedLabels() const;
242 
244 
245  void SetScatterPlotSelectedRowColumnColor(const vtkColor4ub& color);
246  vtkColor4ub GetScatterPlotSelectedRowColumnColor();
248 
250 
251  void SetScatterPlotSelectedActiveColor(const vtkColor4ub& color);
252  vtkColor4ub GetScatterPlotSelectedActiveColor();
254 
256  void UpdateSettings();
257 
259  void UpdateChartSettings(int plotType);
260 
262 
266  virtual void SetSelectionMode(int);
267  vtkGetMacro(SelectionMode, int);
269 
271  vtkStdString GetColumnName(int column);
272 
274  vtkStdString GetRowName(int row);
275 
278  void SetNumberOfFrames(int frames);
279 
282  int GetNumberOfFrames();
283 
285  void ClearAnimationPath();
286 
290  bool AddAnimationPath(const vtkVector2i &move);
291 
293  vtkIdType GetNumberOfAnimationPathElements();
294 
296  vtkVector2i GetAnimationPathElement(vtkIdType i);
297 
299  bool BeginAnimationPath(vtkRenderWindowInteractor* interactor);
300 
303  virtual void AdvanceAnimation();
304 
306  virtual vtkChart * GetMainChart();
307 
308 protected:
311 
314  void UpdateLayout();
315 
317 
319  void AttachAxisRangeListener(vtkAxis*);
320  void AxisRangeForwarderCallback(vtkObject*, unsigned long, void*);
322 
325  void BigChartSelectionCallback(vtkObject*, unsigned long, void*);
326 
329  virtual void UpdateAnimationPath(const vtkVector2i& newActivePos);
330 
333  virtual void StartAnimation(vtkRenderWindowInteractor* interactor);
334 
336 
337  static void ProcessEvents(vtkObject *caller, unsigned long event,
338  void *clientData, void *callerData);
340 
341  // The position of the active plot (defaults to 0, 1).
343 
344  // Weakly owned input data for the scatter plot matrix.
346 
347  // Strongly owned internal data for the column visibility.
349 
350  // The number of bins in the histograms.
352 
353  // The title of the scatter plot matrix.
356 
357  // The mode when the chart is doing selection.
359 
360  // How many frames should animations consist of, 0 means no transitions.
362 
363 private:
364  vtkScatterPlotMatrix(const vtkScatterPlotMatrix &); // Not implemented.
365  void operator=(const vtkScatterPlotMatrix &); // Not implemented.
366 
367  class PIMPL;
368  PIMPL *Private;
369  friend class PIMPL;
370 
371  // Go through the process of calculating axis ranges, etc...
372  void UpdateAxes();
373  void ApplyAxisSetting(vtkChart *chart, const vtkStdString &x,
374  const vtkStdString &y);
375 };
376 
377 #endif //__vtkScatterPlotMatrix_h
GLsizeiptr size
Definition: vtkgl.h:11843
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:46
abstract base class for most VTK objects
Definition: vtkObject.h:61
GLenum GLenum GLvoid GLvoid * column
Definition: vtkgl.h:11352
GLuint index
Definition: vtkgl.h:11983
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:268
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: vtkgl.h:11332
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
GLenum GLenum GLvoid * row
Definition: vtkgl.h:11352
platform-independent render window interaction including picking and frame rate control.
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:56
Factory class for drawing 2D charts.
Definition: vtkChart.h:49
GLuint const GLchar * name
Definition: vtkgl.h:11983
takes care of drawing 2D axes
Definition: vtkAxis.h:70
data structure to represent mouse events.
struct _cl_event * event
Definition: vtkgl.h:14387
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)
GLuint color
Definition: vtkgl.h:12351
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
GLenum GLint GLint * precision
Definition: vtkgl.h:14180
#define VTKCHARTSCORE_EXPORT