ParaView
vtkPVPlotMatrixView.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkPVPlotMatrixView.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 
16 #ifndef vtkPVPlotMatrixView_h
17 #define vtkPVPlotMatrixView_h
18 
19 #include "vtkPVClientServerCoreRenderingModule.h" //needed for exports
20 #include "vtkPVContextView.h"
21 
22 class vtkScatterPlotMatrix;
23 
24 #define GENERATE_PLOT_TYPE_DECLARATION(name, type) \
25  void SetScatterPlot##name(type value); \
26  void SetHistogram##name(type value); \
27  void SetActivePlot##name(type value);
28 
29 #define GENERATE_PLOT_TYPE_DECLARATION2(name, type1, type2) \
30  void SetScatterPlot##name(type1 value1, type2 value2); \
31  void SetHistogram##name(type1 value1, type2 value2); \
32  void SetActivePlot##name(type1 value1, type2 value2);
33 
34 #define GENERATE_PLOT_TYPE_DECLARATION3(name, type1, type2, type3) \
35  void SetScatterPlot##name(type1 value1, type2 value2, type3 value3); \
36  void SetHistogram##name(type1 value1, type2 value2, type3 value3); \
37  void SetActivePlot##name(type1 value1, type2 value2, type3 value3);
38 
39 #define GENERATE_PLOT_TYPE_DECLARATION4(name, type1, type2, type3, type4) \
40  void SetScatterPlot##name(type1 value1, type2 value2, type3 value3, type4 value4); \
41  void SetHistogram##name(type1 value1, type2 value2, type3 value3, type4 value4); \
42  void SetActivePlot##name(type1 value1, type2 value2, type3 value3, type4 value4);
43 
44 class VTKPVCLIENTSERVERCORERENDERING_EXPORT vtkPVPlotMatrixView : public vtkPVContextView
45 {
46 public:
47  static vtkPVPlotMatrixView* New();
49  void PrintSelf(ostream& os, vtkIndent indent);
50 
51  vtkAbstractContextItem* GetContextItem();
52 
53  // Description:
54  // Representations can use this method to set the selection for a particular
55  // representation. Subclasses override this method to pass on the selection to
56  // the chart using annotation link. Note this is meant to pass selection for
57  // the local process alone. The view does not manage data movement for the
58  // selection.
59  virtual void SetSelection(vtkChartRepresentation* repr, vtkSelection* selection);
60 
61  // Description:
62  // Get/set the active plot in the scatter plot matrix.
63  void SetActivePlot(int i, int j);
64  int GetActiveRow();
65  int GetActiveColumn();
66 
67  // Description:
68  // Clear the animation path, ensuring it is empty.
69  void ClearAnimationPath();
70 
71  // Description:
72  // Append to the animation path of the scatter plot matrix.
73  void AddAnimationPath(int i, int j);
74 
75  // Description:
76  // Append to the animation path of the scatter plot matrix.
77  void StartAnimationPath();
78 
79  // Description:
80  // Push the animation forward a frame.
81  void AdvanceAnimationPath();
82 
83  // Description:
84  // Set the title of the active plot.
85  // These methods should not be called directly. They are made public only so
86  // that the client-server-stream-interpreter can invoke them. Use the
87  // corresponding properties to change these values.
88  void SetTitle(const char* title);
89  const char* GetTitle();
90 
91  // Description:
92  // Set the active plot title's font.
93  // These methods should not be called directly. They are made public only so
94  // that the client-server-stream-interpreter can invoke them. Use the
95  // corresponding properties to change these values.
96  void SetTitleFont(const char* family, int pointSize, bool bold, bool italic);
97  void SetTitleFontFamily(const char* family);
98  void SetTitleFontSize(int pointSize);
99  void SetTitleBold(bool bold);
100  void SetTitleItalic(bool italic);
101  const char* GetTitleFontFamily();
102  int GetTitleFontSize();
103  int GetTitleFontBold();
104  int GetTitleFontItalic();
105 
106  // Description:
107  // Set the active plot title's color.
108  // These methods should not be called directly. They are made public only so
109  // that the client-server-stream-interpreter can invoke them. Use the
110  // corresponding properties to change these values.
111  void SetTitleColor(double red, double green, double blue);
112  double* GetTitleColor();
113 
114  // Description:
115  // Set the active plot title's alignment.
116  // These methods should not be called directly. They are made public only so
117  // that the client-server-stream-interpreter can invoke them. Use the
118  // corresponding properties to change these values.
119  void SetTitleAlignment(int alignment);
120  int GetTitleAlignment();
121 
122  // Description:
123  // Set the number of animation frames used when changing the active
124  // scatterplot.
125  void SetNumberOfAnimationFrames(int value);
126 
127  // Description:
128  // Set the gutter that should be left between the charts in the matrix.
129  // These methods should not be called directly. They are made public only so
130  // that the client-server-stream-interpreter can invoke them. Use the
131  // corresponding properties to change these values.
132  virtual void SetGutter(float x, float y);
133  void SetGutterX(float value);
134  void SetGutterY(float value);
135 
136  // Description:
137  // Set/get the borders of the chart matrix (space in pixels around each chart).
138  // These methods should not be called directly. They are made public only so
139  // that the client-server-stream-interpreter can invoke them. Use the
140  // corresponding properties to change these values.
141  virtual void SetBorders(int left, int bottom, int right, int top);
142  virtual void SetBorderLeft(int value);
143  virtual void SetBorderBottom(int value);
144  virtual void SetBorderRight(int value);
145  virtual void SetBorderTop(int value);
146 
147  // Description:
148  // Sets whether or not the grid for the given axis is visible given a plot type, which refers to
149  // vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
150  // These methods should not be called directly. They are made public only so
151  // that the client-server-stream-interpreter can invoke them. Use the
152  // corresponding properties to change these values.
153  void SetGridVisibility(int plotType, bool visible);
154  GENERATE_PLOT_TYPE_DECLARATION(GridVisibility, bool);
155  int GetGridVisibility(int plotType);
156 
157  // Description:
158  // Sets the background color for the chart given a plot type, which refers to
159  // vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
160  // These methods should not be called directly. They are made public only so
161  // that the client-server-stream-interpreter can invoke them. Use the
162  // corresponding properties to change these values.
163  void SetBackgroundColor(int plotType, double red, double green, double blue, double alpha);
164  double* GetBackgroundColor(int plotType);
165  GENERATE_PLOT_TYPE_DECLARATION4(BackgroundColor, double, double, double, double);
166 
167  // Description:
168  // Sets the color for the axes given a plot type, which refers to
169  // vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
170  // These methods should not be called directly. They are made public only so
171  // that the client-server-stream-interpreter can invoke them. Use the
172  // corresponding properties to change these values.
173  void SetAxisColor(int plotType, double red, double green, double blue);
174  double* GetAxisColor(int plotType);
175  GENERATE_PLOT_TYPE_DECLARATION3(AxisColor, double, double, double);
176 
177  // Description:
178  // Sets the color for the axes given a plot type, which refers to
179  // vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
180  // These methods should not be called directly. They are made public only so
181  // that the client-server-stream-interpreter can invoke them. Use the
182  // corresponding properties to change these values.
183  void SetGridColor(int plotType, double red, double green, double blue);
184  double* GetGridColor(int plotType);
185  GENERATE_PLOT_TYPE_DECLARATION3(GridColor, double, double, double);
186 
187  // Description:
188  // Sets whether or not the labels for the axes are visible, given a plot type, which refers to
189  // vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
190  // These methods should not be called directly. They are made public only so
191  // that the client-server-stream-interpreter can invoke them. Use the
192  // corresponding properties to change these values.
193  void SetAxisLabelVisibility(int plotType, bool visible);
194  int GetAxisLabelVisibility(int plotType);
195  GENERATE_PLOT_TYPE_DECLARATION(AxisLabelVisibility, bool);
196 
197  // Description:
198  // Set the axis label font for the axes given a plot type, which refers to
199  // vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
200  // These methods should not be called directly. They are made public only so
201  // that the client-server-stream-interpreter can invoke them. Use the
202  // corresponding properties to change these values.
203  void SetAxisLabelFont(int plotType, const char* family, int pointSize, bool bold, bool italic);
204  void SetAxisLabelFontFamily(int plotType, const char* family);
205  GENERATE_PLOT_TYPE_DECLARATION(AxisLabelFontFamily, const char*);
206  void SetAxisLabelFontSize(int plotType, int pointSize);
207  GENERATE_PLOT_TYPE_DECLARATION(AxisLabelFontSize, int);
208  void SetAxisLabelBold(int plotType, bool bold);
209  GENERATE_PLOT_TYPE_DECLARATION(AxisLabelBold, bool);
210  void SetAxisLabelItalic(int plotType, bool italic);
211  GENERATE_PLOT_TYPE_DECLARATION(AxisLabelItalic, bool);
212  const char* GetAxisLabelFontFamily(int plotType);
213  int GetAxisLabelFontSize(int plotType);
214  int GetAxisLabelFontBold(int plotType);
215  int GetAxisLabelFontItalic(int plotType);
216 
217  // Description:
218  // Sets the axis label color for the axes given a plot type, which refers to
219  // vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
220  // These methods should not be called directly. They are made public only so
221  // that the client-server-stream-interpreter can invoke them. Use the
222  // corresponding properties to change these values.
223  void SetAxisLabelColor(int plotType, double red, double green, double blue);
224  GENERATE_PLOT_TYPE_DECLARATION3(AxisLabelColor, double, double, double);
225  double* GetAxisLabelColor(int plotType);
226 
227  // Description:
228  // Sets the axis label notation for the axes given a plot type, which refers to
229  // vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
230  // These methods should not be called directly. They are made public only so
231  // that the client-server-stream-interpreter can invoke them. Use the
232  // corresponding properties to change these values.
233  void SetAxisLabelNotation(int plotType, int notation);
234  GENERATE_PLOT_TYPE_DECLARATION(AxisLabelNotation, int);
235  int GetAxisLabelNotation(int plotType);
236 
237  // Description:
238  // Sets the axis label precision for the axes given a plot type, which refers to
239  // vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
240  // These methods should not be called directly. They are made public only so
241  // that the client-server-stream-interpreter can invoke them. Use the
242  // corresponding properties to change these values.
243  void SetAxisLabelPrecision(int plotType, int precision);
244  GENERATE_PLOT_TYPE_DECLARATION(AxisLabelPrecision, int);
245  int GetAxisLabelPrecision(int plotType);
246 
247  // Description:
248  // Set chart's tooltip notation and precision, given a plot type, which refers to
249  // vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
250  // These methods should not be called directly. They are made public only so
251  // that the client-server-stream-interpreter can invoke them. Use the
252  // corresponding properties to change these values.
253  void SetTooltipNotation(int plotType, int notation);
254  GENERATE_PLOT_TYPE_DECLARATION(TooltipNotation, int);
255  void SetTooltipPrecision(int plotType, int precision);
256  GENERATE_PLOT_TYPE_DECLARATION(TooltipPrecision, int);
257  int GetTooltipNotation(int plotType);
258  int GetTooltipPrecision(int plotType);
259 
260  // Description:
261  // Set the scatter plot title's color.
262  // These methods should not be called directly. They are made public only so
263  // that the client-server-stream-interpreter can invoke them. Use the
264  // corresponding properties to change these values.
265  void SetScatterPlotSelectedRowColumnColor(double red, double green, double blue, double alpha);
266  double* GetScatterPlotSelectedRowColumnColor();
267 
268  // Description:
269  // Set the scatter plot title's color.
270  // These methods should not be called directly. They are made public only so
271  // that the client-server-stream-interpreter can invoke them. Use the
272  // corresponding properties to change these values.
273  void SetScatterPlotSelectedActiveColor(double red, double green, double blue, double alpha);
274  double* GetScatterPlotSelectedActiveColor();
275 
276  // Description:
277  // Update all the settings
278  void UpdateSettings();
279 
280 protected:
283 
284  // Description:
285  // The callback function when SelectionChangedEvent is invoked from
286  // the Big chart in vtkScatterPlotMatrix.
287  void PlotMatrixSelectionCallback(vtkObject*, unsigned long, void*);
288 
289 private:
290  vtkPVPlotMatrixView(const vtkPVPlotMatrixView&) VTK_DELETE_FUNCTION;
291  void operator=(const vtkPVPlotMatrixView&) VTK_DELETE_FUNCTION;
292 
293  vtkScatterPlotMatrix* PlotMatrix;
294 };
295 
296 #endif
#define GENERATE_PLOT_TYPE_DECLARATION(name, type)
virtual void SetSelection(vtkChartRepresentation *repr, vtkSelection *selection)=0
Representations can use this method to set the selection for a particular representation.
#define GENERATE_PLOT_TYPE_DECLARATION4(name, type1, type2, type3, type4)
void PrintSelf(ostream &os, vtkIndent indent)
vtkPVContextView adopts vtkContextView so that it can be used in ParaView configurations.
vtkChartRepresentation is the base representation for charting representations.
#define GENERATE_PLOT_TYPE_DECLARATION3(name, type1, type2, type3)
virtual vtkAbstractContextItem * GetContextItem()=0
Get the context item.