vtkPVXYChartView.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
12 #ifndef vtkPVXYChartView_h
13 #define vtkPVXYChartView_h
14 
15 #include "vtkAxis.h" //for enums.
16 #include "vtkPVContextView.h"
17 #include "vtkRemotingViewsModule.h" //needed for exports
18 
19 class vtkChart;
20 class vtkPVPlotTime;
21 class vtkChartWarning;
22 
23 #define GENERATE_AXIS_FUNCTIONS(name, type) \
24  void SetLeft##name(type value) \
25  { \
26  Set##name(vtkAxis::LEFT, value); \
27  } \
28  void SetBottom##name(type value) \
29  { \
30  Set##name(vtkAxis::BOTTOM, value); \
31  } \
32  void SetRight##name(type value) \
33  { \
34  Set##name(vtkAxis::RIGHT, value); \
35  } \
36  void SetTop##name(type value) \
37  { \
38  Set##name(vtkAxis::TOP, value); \
39  }
40 
41 #define GENERATE_AXIS_FUNCTIONS2(name, type1, type2) \
42  void SetLeft##name(type1 value1, type2 value2) \
43  { \
44  Set##name(vtkAxis::LEFT, value1, value2); \
45  } \
46  void SetBottom##name(type1 value1, type2 value2) \
47  { \
48  Set##name(vtkAxis::BOTTOM, value1, value2); \
49  } \
50  void SetRight##name(type1 value1, type2 value2) \
51  { \
52  Set##name(vtkAxis::RIGHT, value1, value2); \
53  } \
54  void SetTop##name(type1 value1, type2 value2) \
55  { \
56  Set##name(vtkAxis::TOP, value1, value2); \
57  }
58 
59 #define GENERATE_AXIS_FUNCTIONS3(name, type1, type2, type3) \
60  void SetLeft##name(type1 value1, type2 value2, type3 value3) \
61  { \
62  Set##name(vtkAxis::LEFT, value1, value2, value3); \
63  } \
64  void SetBottom##name(type1 value1, type2 value2, type3 value3) \
65  { \
66  Set##name(vtkAxis::BOTTOM, value1, value2, value3); \
67  } \
68  void SetRight##name(type1 value1, type2 value2, type3 value3) \
69  { \
70  Set##name(vtkAxis::RIGHT, value1, value2, value3); \
71  } \
72  void SetTop##name(type1 value1, type2 value2, type3 value3) \
73  { \
74  Set##name(vtkAxis::TOP, value1, value2, value3); \
75  }
76 
78 {
79 public:
80  static vtkPVXYChartView* New();
82  void PrintSelf(ostream& os, vtkIndent indent) override;
83 
87  void SetChartType(const char* type);
88  void SetChartTypeToLine() { this->SetChartType("Line"); }
89  void SetChartTypeToPoint() { this->SetChartType("Point"); }
90  void SetChartTypeToBar() { this->SetChartType("Bar"); }
91  void SetChartTypeToBag() { this->SetChartType("Bag"); }
92  void SetChartTypeToBox() { this->SetChartType("Box"); }
93  void SetChartTypeToArea() { this->SetChartType("Area"); }
94  void SetChartTypeToFunctionalBag() { this->SetChartType("FunctionalBag"); }
95  void SetChartTypeToImage() { this->SetChartType("Image"); }
96  void SetChartTypeToParallelCoordinates() { this->SetChartType("ParallelCoordinates"); }
97 
99 
105  void SetTitleFont(const char* family, int pointSize, bool bold, bool italic) override;
106  void SetTitleFontFamily(const char* family) override;
107  void SetTitleFontSize(int pointSize) override;
108  void SetTitleBold(bool bold) override;
109  void SetTitleItalic(bool italic) override;
110  void SetTitleFontFile(const char* file) override;
111  const char* GetTitleFontFamily() override;
112  int GetTitleFontSize() override;
113  int GetTitleFontBold() override;
114  int GetTitleFontItalic() override;
116 
118 
124  void SetTitleColor(double red, double green, double blue) override;
125  double* GetTitleColor() override;
127 
129 
135  void SetTitleAlignment(int alignment) override;
136  int GetTitleAlignment() override;
138 
145  void SetLegendVisibility(int visible);
146 
153  void SetLegendLocation(int location);
154 
158  void SetLegendPosition(int x, int y);
159 
163  void SetLegendFontFamily(const char* family);
164 
168  void SetLegendFontFile(const char* file);
169 
173  void SetLegendFontSize(int pointSize);
174 
178  void SetLegendBold(bool bold);
179 
183  void SetLegendItalic(bool italic);
184 
188  void SetLegendSymbolWidth(int width);
189 
191 
197  void SetGridVisibility(int index, bool visible);
198  GENERATE_AXIS_FUNCTIONS(GridVisibility, bool);
200 
202 
208  void SetAxisColor(int index, double red, double green, double blue);
209  GENERATE_AXIS_FUNCTIONS3(AxisColor, double, double, double);
211 
213 
219  void SetGridColor(int index, double red, double green, double blue);
220  GENERATE_AXIS_FUNCTIONS3(GridColor, double, double, double);
222 
224 
230  void SetAxisLabelVisibility(int index, bool visible);
231  GENERATE_AXIS_FUNCTIONS(AxisLabelVisibility, bool);
233 
240  void SetAxisLabelFont(int index, const char* family, int pointSize, bool bold, bool italic);
241 
243 
246  void SetAxisLabelFontFamily(int index, const char* family);
247  GENERATE_AXIS_FUNCTIONS(AxisLabelFontFamily, const char*);
249 
251 
254  void SetAxisLabelFontFile(int index, const char* file);
255  GENERATE_AXIS_FUNCTIONS(AxisLabelFontFile, const char*);
257 
259 
262  void SetAxisLabelFontSize(int index, int pointSize);
263  GENERATE_AXIS_FUNCTIONS(AxisLabelFontSize, int);
265 
267 
270  void SetAxisLabelBold(int index, bool bold);
271  GENERATE_AXIS_FUNCTIONS(AxisLabelBold, bool);
273 
275 
278  void SetAxisLabelItalic(int index, bool italic);
279  GENERATE_AXIS_FUNCTIONS(AxisLabelItalic, bool);
281 
283 
289  void SetAxisLabelColor(int index, double red, double green, double blue);
290  GENERATE_AXIS_FUNCTIONS3(AxisLabelColor, double, double, double);
292 
294 
300  void SetAxisLabelNotation(int index, int notation);
301  GENERATE_AXIS_FUNCTIONS(AxisLabelNotation, int);
303 
305 
311  void SetAxisLabelPrecision(int index, int precision);
312  GENERATE_AXIS_FUNCTIONS(AxisLabelPrecision, int);
314 
316 
324  GENERATE_AXIS_FUNCTIONS(AxisRangeMinimum, double);
325  GENERATE_AXIS_FUNCTIONS(AxisRangeMaximum, double);
327 
329 
334  void SetAxisUseCustomRange(int index, bool useCustomRange);
335  GENERATE_AXIS_FUNCTIONS(AxisUseCustomRange, bool);
337 
339 
345  void SetAxisLogScale(int index, bool logScale);
346  GENERATE_AXIS_FUNCTIONS(AxisLogScale, bool);
348 
350 
356  void SetAxisTitle(int index, const char* title);
357  GENERATE_AXIS_FUNCTIONS(AxisTitle, const char*);
359 
366  void SetAxisTitleFont(int index, const char* family, int pointSize, bool bold, bool italic);
367 
369 
375  void SetAxisTitleFontFamily(int index, const char* family);
376  GENERATE_AXIS_FUNCTIONS(AxisTitleFontFamily, const char*);
378 
380 
386  void SetAxisTitleFontFile(int index, const char* file);
387  GENERATE_AXIS_FUNCTIONS(AxisTitleFontFile, const char*);
389 
391 
397  void SetAxisTitleFontSize(int index, int pointSize);
398  GENERATE_AXIS_FUNCTIONS(AxisTitleFontSize, int);
400 
402 
408  void SetAxisTitleBold(int index, bool bold);
409  GENERATE_AXIS_FUNCTIONS(AxisTitleBold, bool);
411 
413 
419  void SetAxisTitleItalic(int index, bool italic);
420  GENERATE_AXIS_FUNCTIONS(AxisTitleItalic, bool);
422 
424 
430  void SetAxisTitleColor(int index, double red, double green, double blue);
431  GENERATE_AXIS_FUNCTIONS3(AxisTitleColor, double, double, double);
433 
435 
439  void SetAxisUseCustomLabels(int index, bool useCustomLabels);
440  GENERATE_AXIS_FUNCTIONS(AxisUseCustomLabels, bool);
442 
444 
447  void SetAxisLabelsNumber(int axis, int number);
448  GENERATE_AXIS_FUNCTIONS(AxisLabelsNumber, int);
450 
452 
455  void SetAxisLabels(int axis, int index, const std::string& value, const std::string& label);
456  GENERATE_AXIS_FUNCTIONS3(AxisLabels, int, const std::string&, const std::string&);
458 
459  void SetTooltipLabelFormat(const vtkStdString& labelFormat);
460  void SetTooltipNotation(int notation);
461  void SetTooltipPrecision(int precision);
462 
464 
469  vtkSetMacro(HideTimeMarker, bool);
470  vtkGetMacro(HideTimeMarker, bool);
472 
474 
478  vtkGetMacro(SortByXAxis, bool);
479  vtkSetMacro(SortByXAxis, bool);
481 
485  virtual vtkChart* GetChart();
486 
491 
499  void SetSelection(vtkChartRepresentation* repr, vtkSelection* selection) override;
500 
504  void Update() override;
505 
506 protected:
508  ~vtkPVXYChartView() override;
509 
510  void SetAxisRangeMinimum(int index, double min);
511  void SetAxisRangeMaximum(int index, double max);
512 
516  void Render(bool interactive) override;
517 
519 
526 
527  void SelectionChanged();
528 
531 
532 private:
533  vtkPVXYChartView(const vtkPVXYChartView&) = delete;
534  void operator=(const vtkPVXYChartView&) = delete;
535 
536  class vtkInternals;
537  vtkInternals* Internals;
538 };
539 
540 #endif
location
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).
static vtkView * New()
virtual void SetTitleFontSize(int pointSize)=0
Get/Set the font of the title.
virtual void SetTitleBold(bool bold)=0
Get/Set the font of the title.
#define VTKREMOTINGVIEWS_EXPORT
void SetChartTypeToFunctionalBag()
#define GENERATE_AXIS_FUNCTIONS3(name, type1, type2, type3)
vtkPVPlotTime * PlotTime
Pointer to the proxy's chart instance.
void Update() override
Overridden to not call Update() directly on the input representations, instead use ProcessViewRequest...
virtual int GetTitleFontBold()=0
Get/Set the font of the title.
void SetChartTypeToParallelCoordinates()
virtual int GetTitleFontItalic()=0
Get/Set the font of the title.
virtual void SetTitleFontFile(const char *file)=0
Get/Set the font of the title.
vtkPVView subclass for drawing charts
void PrintSelf(ostream &os, vtkIndent indent) override
virtual int GetTitleFontSize()=0
Get/Set the font of the title.
virtual int GetTitleAlignment()=0
Get/Set the alignement of the title.
virtual double * GetTitleColor()=0
Get/Set the color of the title.
takes care of drawing a "time" marker in the plot.
Definition: vtkPVPlotTime.h:17
virtual const char * GetTitleFontFamily()=0
Get/Set the font of the title.
virtual void SetTitleColor(double red, double green, double blue)=0
Get/Set the color of the title.
vtkChart * Chart
Pointer to the proxy's chart instance.
virtual void SetTitleAlignment(int alignment)=0
Get/Set the alignement of the title.
virtual void SetTitleFontFamily(const char *family)=0
Get/Set the font of the title.
value
vtkPVContextView adopts vtkContextView so that it can be used in ParaView configurations.
vtkChartRepresentation is the base representation for charting representations.
virtual void SetTitleFont(const char *family, int pointSize, bool bold, bool italic)=0
Get/Set the font of the title.
#define GENERATE_AXIS_FUNCTIONS(name, type)
virtual void SetTitleItalic(bool italic)=0
Get/Set the font of the title.
virtual void Render(bool interactive)
Actual rendering implementation.
family
index
virtual vtkAbstractContextItem * GetContextItem()=0
Get the context item.
#define max(a, b)
title