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 "vtkParaViewDeprecation.h"
18 #include "vtkRemotingViewsModule.h" //needed for exports
19 
20 class vtkChart;
21 class vtkPVPlotTime;
22 class vtkChartWarning;
23 
24 #define GENERATE_AXIS_FUNCTIONS(name, type) \
25  void SetLeft##name(type value) \
26  { \
27  Set##name(vtkAxis::LEFT, value); \
28  } \
29  void SetBottom##name(type value) \
30  { \
31  Set##name(vtkAxis::BOTTOM, value); \
32  } \
33  void SetRight##name(type value) \
34  { \
35  Set##name(vtkAxis::RIGHT, value); \
36  } \
37  void SetTop##name(type value) \
38  { \
39  Set##name(vtkAxis::TOP, value); \
40  }
41 
42 #define GENERATE_AXIS_FUNCTIONS2(name, type1, type2) \
43  void SetLeft##name(type1 value1, type2 value2) \
44  { \
45  Set##name(vtkAxis::LEFT, value1, value2); \
46  } \
47  void SetBottom##name(type1 value1, type2 value2) \
48  { \
49  Set##name(vtkAxis::BOTTOM, value1, value2); \
50  } \
51  void SetRight##name(type1 value1, type2 value2) \
52  { \
53  Set##name(vtkAxis::RIGHT, value1, value2); \
54  } \
55  void SetTop##name(type1 value1, type2 value2) \
56  { \
57  Set##name(vtkAxis::TOP, value1, value2); \
58  }
59 
60 #define GENERATE_AXIS_FUNCTIONS3(name, type1, type2, type3) \
61  void SetLeft##name(type1 value1, type2 value2, type3 value3) \
62  { \
63  Set##name(vtkAxis::LEFT, value1, value2, value3); \
64  } \
65  void SetBottom##name(type1 value1, type2 value2, type3 value3) \
66  { \
67  Set##name(vtkAxis::BOTTOM, value1, value2, value3); \
68  } \
69  void SetRight##name(type1 value1, type2 value2, type3 value3) \
70  { \
71  Set##name(vtkAxis::RIGHT, value1, value2, value3); \
72  } \
73  void SetTop##name(type1 value1, type2 value2, type3 value3) \
74  { \
75  Set##name(vtkAxis::TOP, value1, value2, value3); \
76  }
77 
79 {
80 public:
81  static vtkPVXYChartView* New();
83  void PrintSelf(ostream& os, vtkIndent indent) override;
84 
88  void SetChartType(const char* type);
89  void SetChartTypeToLine() { this->SetChartType("Line"); }
90  void SetChartTypeToPoint() { this->SetChartType("Point"); }
91  void SetChartTypeToBar() { this->SetChartType("Bar"); }
92  void SetChartTypeToBag() { this->SetChartType("Bag"); }
93  void SetChartTypeToBox() { this->SetChartType("Box"); }
94  void SetChartTypeToArea() { this->SetChartType("Area"); }
95  void SetChartTypeToFunctionalBag() { this->SetChartType("FunctionalBag"); }
96  void SetChartTypeToImage() { this->SetChartType("Image"); }
97  void SetChartTypeToParallelCoordinates() { this->SetChartType("ParallelCoordinates"); }
98 
100 
106  void SetTitleFont(const char* family, int pointSize, bool bold, bool italic) override;
107  void SetTitleFontFamily(const char* family) override;
108  void SetTitleFontSize(int pointSize) override;
109  void SetTitleBold(bool bold) override;
110  void SetTitleItalic(bool italic) override;
111  void SetTitleFontFile(const char* file) override;
112  const char* GetTitleFontFamily() override;
113  int GetTitleFontSize() override;
114  int GetTitleFontBold() override;
115  int GetTitleFontItalic() override;
117 
119 
125  void SetTitleColor(double red, double green, double blue) override;
126  double* GetTitleColor() override;
128 
130 
136  void SetTitleAlignment(int alignment) override;
137  int GetTitleAlignment() override;
139 
146  void SetLegendVisibility(int visible);
147 
154  void SetLegendLocation(int location);
155 
159  void SetLegendPosition(int x, int y);
160 
164  void SetLegendFontFamily(const char* family);
165 
169  void SetLegendFontFile(const char* file);
170 
174  void SetLegendFontSize(int pointSize);
175 
179  void SetLegendBold(bool bold);
180 
184  void SetLegendItalic(bool italic);
185 
189  void SetLegendSymbolWidth(int width);
190 
192 
198  void SetGridVisibility(int index, bool visible);
199  GENERATE_AXIS_FUNCTIONS(GridVisibility, bool);
201 
203 
209  void SetAxisColor(int index, double red, double green, double blue);
210  GENERATE_AXIS_FUNCTIONS3(AxisColor, double, double, double);
212 
214 
220  void SetGridColor(int index, double red, double green, double blue);
221  GENERATE_AXIS_FUNCTIONS3(GridColor, double, double, double);
223 
225 
231  void SetAxisLabelVisibility(int index, bool visible);
232  GENERATE_AXIS_FUNCTIONS(AxisLabelVisibility, bool);
234 
241  void SetAxisLabelFont(int index, const char* family, int pointSize, bool bold, bool italic);
242 
244 
247  void SetAxisLabelFontFamily(int index, const char* family);
248  GENERATE_AXIS_FUNCTIONS(AxisLabelFontFamily, const char*);
250 
252 
255  void SetAxisLabelFontFile(int index, const char* file);
256  GENERATE_AXIS_FUNCTIONS(AxisLabelFontFile, const char*);
258 
260 
263  void SetAxisLabelFontSize(int index, int pointSize);
264  GENERATE_AXIS_FUNCTIONS(AxisLabelFontSize, int);
266 
268 
271  void SetAxisLabelBold(int index, bool bold);
272  GENERATE_AXIS_FUNCTIONS(AxisLabelBold, bool);
274 
276 
279  void SetAxisLabelItalic(int index, bool italic);
280  GENERATE_AXIS_FUNCTIONS(AxisLabelItalic, bool);
282 
284 
290  void SetAxisLabelColor(int index, double red, double green, double blue);
291  GENERATE_AXIS_FUNCTIONS3(AxisLabelColor, double, double, double);
293 
295 
301  void SetAxisLabelNotation(int index, int notation);
302  GENERATE_AXIS_FUNCTIONS(AxisLabelNotation, int);
304 
306 
312  void SetAxisLabelPrecision(int index, int precision);
313  GENERATE_AXIS_FUNCTIONS(AxisLabelPrecision, int);
315 
317 
325  GENERATE_AXIS_FUNCTIONS(AxisRangeMinimum, double);
326  GENERATE_AXIS_FUNCTIONS(AxisRangeMaximum, double);
328 
330 
335  void SetAxisUseCustomRange(int index, bool useCustomRange);
336  GENERATE_AXIS_FUNCTIONS(AxisUseCustomRange, bool);
338 
340 
346  void SetAxisLogScale(int index, bool logScale);
347  GENERATE_AXIS_FUNCTIONS(AxisLogScale, bool);
349 
351 
357  void SetAxisTitle(int index, const char* title);
358  GENERATE_AXIS_FUNCTIONS(AxisTitle, const char*);
360 
367  void SetAxisTitleFont(int index, const char* family, int pointSize, bool bold, bool italic);
368 
370 
376  void SetAxisTitleFontFamily(int index, const char* family);
377  GENERATE_AXIS_FUNCTIONS(AxisTitleFontFamily, const char*);
379 
381 
387  void SetAxisTitleFontFile(int index, const char* file);
388  GENERATE_AXIS_FUNCTIONS(AxisTitleFontFile, const char*);
390 
392 
398  void SetAxisTitleFontSize(int index, int pointSize);
399  GENERATE_AXIS_FUNCTIONS(AxisTitleFontSize, int);
401 
403 
409  void SetAxisTitleBold(int index, bool bold);
410  GENERATE_AXIS_FUNCTIONS(AxisTitleBold, bool);
412 
414 
420  void SetAxisTitleItalic(int index, bool italic);
421  GENERATE_AXIS_FUNCTIONS(AxisTitleItalic, bool);
423 
425 
431  void SetAxisTitleColor(int index, double red, double green, double blue);
432  GENERATE_AXIS_FUNCTIONS3(AxisTitleColor, double, double, double);
434 
436 
440  void SetAxisUseCustomLabels(int index, bool useCustomLabels);
441  GENERATE_AXIS_FUNCTIONS(AxisUseCustomLabels, bool);
443 
445 
448  void SetAxisLabelsNumber(int axis, int number);
449  GENERATE_AXIS_FUNCTIONS(AxisLabelsNumber, int);
451 
453 
456  void SetAxisLabels(int axis, int index, const std::string& value, const std::string& label);
457  GENERATE_AXIS_FUNCTIONS3(AxisLabels, int, const std::string&, const std::string&);
459 
460  void SetTooltipLabelFormat(const vtkStdString& labelFormat);
461  void SetTooltipNotation(int notation);
462  void SetTooltipPrecision(int precision);
463 
465 
470  vtkSetMacro(HideTimeMarker, bool);
471  vtkGetMacro(HideTimeMarker, bool);
473 
475 
479  vtkGetMacro(SortByXAxis, bool);
480  vtkSetMacro(SortByXAxis, bool);
482 
487  PARAVIEW_DEPRECATED_IN_6_0_0("Use vtkPVGeneralSettings::SetIgnoreNegativeLogAxisWarning instead")
488  static void SetIgnoreNegativeLogAxisWarning(bool val);
489  PARAVIEW_DEPRECATED_IN_6_0_0("Use vtkPVGeneralSettings::GetIgnoreNegativeLogAxisWarning instead")
490  static bool GetIgnoreNegativeLogAxisWarning();
491 
495  virtual vtkChart* GetChart();
496 
501 
509  void SetSelection(vtkChartRepresentation* repr, vtkSelection* selection) override;
510 
514  void Update() override;
515 
516 protected:
518  ~vtkPVXYChartView() override;
519 
520  void SetAxisRangeMinimum(int index, double min);
521  void SetAxisRangeMaximum(int index, double max);
522 
526  void Render(bool interactive) override;
527 
529 
536 
537  void SelectionChanged();
538 
541 
542  // PARAVIEW_DEPRECATED_IN_6_0_0
544 
545 private:
546  vtkPVXYChartView(const vtkPVXYChartView&) = delete;
547  void operator=(const vtkPVXYChartView&) = delete;
548 
549  class vtkInternals;
550  vtkInternals* Internals;
551 };
552 
553 #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.
static bool IgnoreNegativeLogAxisWarning
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
#define PARAVIEW_DEPRECATED_IN_6_0_0(reason)
index
virtual vtkAbstractContextItem * GetContextItem()=0
Get the context item.
#define max(a, b)
title