ParaView
vtkPVXYChartView.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkPVXYChartView.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 =========================================================================*/
24 #ifndef vtkPVXYChartView_h
25 #define vtkPVXYChartView_h
26 
27 #include "vtkAxis.h" //for enums.
28 #include "vtkPVClientServerCoreRenderingModule.h" //needed for exports
29 #include "vtkPVContextView.h"
30 
31 class vtkChart;
32 class vtkPVPlotTime;
33 class vtkChartWarning;
34 
35 #define GENERATE_AXIS_FUNCTIONS(name, type) \
36  void SetLeft##name(type value) { Set##name(vtkAxis::LEFT, value); } \
37  void SetBottom##name(type value) { Set##name(vtkAxis::BOTTOM, value); } \
38  void SetRight##name(type value) { Set##name(vtkAxis::RIGHT, value); } \
39  void SetTop##name(type value) { Set##name(vtkAxis::TOP, value); }
40 
41 #define GENERATE_AXIS_FUNCTIONS2(name, type1, type2) \
42  void SetLeft##name(type1 value1, type2 value2) { Set##name(vtkAxis::LEFT, value1, value2); } \
43  void SetBottom##name(type1 value1, type2 value2) { Set##name(vtkAxis::BOTTOM, value1, value2); } \
44  void SetRight##name(type1 value1, type2 value2) { Set##name(vtkAxis::RIGHT, value1, value2); } \
45  void SetTop##name(type1 value1, type2 value2) { Set##name(vtkAxis::TOP, value1, value2); }
46 
47 #define GENERATE_AXIS_FUNCTIONS3(name, type1, type2, type3) \
48  void SetLeft##name(type1 value1, type2 value2, type3 value3) \
49  { \
50  Set##name(vtkAxis::LEFT, value1, value2, value3); \
51  } \
52  void SetBottom##name(type1 value1, type2 value2, type3 value3) \
53  { \
54  Set##name(vtkAxis::BOTTOM, value1, value2, value3); \
55  } \
56  void SetRight##name(type1 value1, type2 value2, type3 value3) \
57  { \
58  Set##name(vtkAxis::RIGHT, value1, value2, value3); \
59  } \
60  void SetTop##name(type1 value1, type2 value2, type3 value3) \
61  { \
62  Set##name(vtkAxis::TOP, value1, value2, value3); \
63  }
64 
65 class VTKPVCLIENTSERVERCORERENDERING_EXPORT vtkPVXYChartView : public vtkPVContextView
66 {
67 public:
68  static vtkPVXYChartView* New();
70  void PrintSelf(ostream& os, vtkIndent indent);
71 
75  void SetChartType(const char* type);
76  void SetChartTypeToLine() { this->SetChartType("Line"); }
77  void SetChartTypeToBar() { this->SetChartType("Bar"); }
78  void SetChartTypeToBag() { this->SetChartType("Bag"); }
79  void SetChartTypeToBox() { this->SetChartType("Box"); }
80  void SetChartTypeToArea() { this->SetChartType("Area"); }
81  void SetChartTypeToFunctionalBag() { this->SetChartType("FunctionalBag"); }
82  void SetChartTypeToParallelCoordinates() { this->SetChartType("ParallelCoordinates"); }
83 
90  void SetTitle(const char* title);
91 
93 
99  void SetTitleFont(const char* family, int pointSize, bool bold, bool italic);
100  void SetTitleFontFamily(const char* family);
101  void SetTitleFontSize(int pointSize);
102  void SetTitleBold(bool bold);
103  void SetTitleItalic(bool bold);
105 
112  void SetTitleColor(double red, double green, double blue);
113 
120  void SetTitleAlignment(int alignment);
121 
128  void SetLegendVisibility(int visible);
129 
136  void SetLegendLocation(int location);
137 
141  void SetLegendPosition(int x, int y);
142 
146  void SetLegendFontFamily(const char* family);
147 
151  void SetLegendFontSize(int pointSize);
152 
156  void SetLegendBold(bool bold);
157 
161  void SetLegendItalic(bool italic);
162 
164 
170  void SetGridVisibility(int index, bool visible);
171  GENERATE_AXIS_FUNCTIONS(GridVisibility, bool);
173 
175 
181  void SetAxisColor(int index, double red, double green, double blue);
182  GENERATE_AXIS_FUNCTIONS3(AxisColor, double, double, double);
184 
186 
192  void SetGridColor(int index, double red, double green, double blue);
193  GENERATE_AXIS_FUNCTIONS3(GridColor, double, double, double);
195 
197 
203  void SetAxisLabelVisibility(int index, bool visible);
204  GENERATE_AXIS_FUNCTIONS(AxisLabelVisibility, bool);
206 
213  void SetAxisLabelFont(int index, const char* family, int pointSize, bool bold, bool italic);
214 
216 
219  void SetAxisLabelFontFamily(int index, const char* family);
220  GENERATE_AXIS_FUNCTIONS(AxisLabelFontFamily, const char*);
222 
224 
227  void SetAxisLabelFontSize(int index, int pointSize);
228  GENERATE_AXIS_FUNCTIONS(AxisLabelFontSize, int);
230 
232 
235  void SetAxisLabelBold(int index, bool bold);
236  GENERATE_AXIS_FUNCTIONS(AxisLabelBold, bool);
238 
240 
243  void SetAxisLabelItalic(int index, bool italic);
244  GENERATE_AXIS_FUNCTIONS(AxisLabelItalic, bool);
246 
248 
254  void SetAxisLabelColor(int index, double red, double green, double blue);
255  GENERATE_AXIS_FUNCTIONS3(AxisLabelColor, double, double, double);
257 
259 
265  void SetAxisLabelNotation(int index, int notation);
266  GENERATE_AXIS_FUNCTIONS(AxisLabelNotation, int);
268 
270 
276  void SetAxisLabelPrecision(int index, int precision);
277  GENERATE_AXIS_FUNCTIONS(AxisLabelPrecision, int);
279 
281 
289  GENERATE_AXIS_FUNCTIONS(AxisRangeMinimum, double);
290  GENERATE_AXIS_FUNCTIONS(AxisRangeMaximum, double);
292 
294 
299  void SetAxisUseCustomRange(int index, bool useCustomRange);
300  GENERATE_AXIS_FUNCTIONS(AxisUseCustomRange, bool);
302 
304 
310  void SetAxisLogScale(int index, bool logScale);
311  GENERATE_AXIS_FUNCTIONS(AxisLogScale, bool);
313 
315 
321  void SetAxisTitle(int index, const char* title);
322  GENERATE_AXIS_FUNCTIONS(AxisTitle, const char*);
324 
331  void SetAxisTitleFont(int index, const char* family, int pointSize, bool bold, bool italic);
332 
334 
340  void SetAxisTitleFontFamily(int index, const char* family);
341  GENERATE_AXIS_FUNCTIONS(AxisTitleFontFamily, const char*);
343 
345 
351  void SetAxisTitleFontSize(int index, int pointSize);
352  GENERATE_AXIS_FUNCTIONS(AxisTitleFontSize, int);
354 
356 
362  void SetAxisTitleBold(int index, bool bold);
363  GENERATE_AXIS_FUNCTIONS(AxisTitleBold, bool);
365 
367 
373  void SetAxisTitleItalic(int index, bool italic);
374  GENERATE_AXIS_FUNCTIONS(AxisTitleItalic, bool);
376 
378 
384  void SetAxisTitleColor(int index, double red, double green, double blue);
385  GENERATE_AXIS_FUNCTIONS3(AxisTitleColor, double, double, double);
387 
389 
393  void SetAxisUseCustomLabels(int index, bool useCustomLabels);
394  GENERATE_AXIS_FUNCTIONS(AxisUseCustomLabels, bool);
396 
398 
401  void SetAxisLabelsNumber(int axis, int number);
402  GENERATE_AXIS_FUNCTIONS(AxisLabelsNumber, int);
404 
406 
409  void SetAxisLabels(int axis, int index, double value);
410  GENERATE_AXIS_FUNCTIONS2(AxisLabels, int, double);
412 
413  void SetTooltipNotation(int notation);
414  void SetTooltipPrecision(int precision);
415 
417 
422  vtkSetMacro(HideTimeMarker, bool);
423  vtkGetMacro(HideTimeMarker, bool);
425 
429  virtual vtkChart* GetChart();
430 
434  virtual vtkAbstractContextItem* GetContextItem();
435 
443  virtual void SetSelection(vtkChartRepresentation* repr, vtkSelection* selection);
444 
448  virtual void Update();
449 
450 protected:
452  ~vtkPVXYChartView();
453 
454  void SetAxisRangeMinimum(int index, double min);
455  void SetAxisRangeMaximum(int index, double max);
456 
460  virtual void Render(bool interactive);
461 
463 
466  vtkSetStringMacro(InternalTitle);
468 
472  char* InternalTitle;
473 
475 
478  vtkChart* Chart;
482 
483  void SelectionChanged();
484 
486 
487 private:
488  vtkPVXYChartView(const vtkPVXYChartView&) VTK_DELETE_FUNCTION;
489  void operator=(const vtkPVXYChartView&) VTK_DELETE_FUNCTION;
490 
491  class vtkInternals;
492  vtkInternals* Internals;
493 };
494 
495 #endif
virtual void Update()
Overridden to ensure that in multi-client configurations, same set of representations are "dirty" on ...
vtkChartWarning * LogScaleWarningLabel
Pointer to the proxy's chart instance.
virtual void SetSelection(vtkChartRepresentation *repr, vtkSelection *selection)=0
Representations can use this method to set the selection for a particular representation.
a vtkContextItem that draws a block (optional label).
void SetChartTypeToFunctionalBag()
#define GENERATE_AXIS_FUNCTIONS3(name, type1, type2, type3)
vtkPVPlotTime * PlotTime
Pointer to the proxy's chart instance.
void SetChartTypeToParallelCoordinates()
vtkPVView subclass for drawing charts
void PrintSelf(ostream &os, vtkIndent indent)
takes care of drawing a "time" marker in the plot.
Definition: vtkPVPlotTime.h:29
char * InternalTitle
Store the unreplaced chart title in the case where ${TIME} is used...
vtkChart * Chart
Pointer to the proxy's chart instance.
vtkPVContextView adopts vtkContextView so that it can be used in ParaView configurations.
vtkChartRepresentation is the base representation for charting representations.
#define GENERATE_AXIS_FUNCTIONS2(name, type1, type2)
#define GENERATE_AXIS_FUNCTIONS(name, type)
virtual void Render(bool interactive)
Actual rendering implementation.
virtual vtkAbstractContextItem * GetContextItem()=0
Get the context item.