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) { Set##name(vtkAxis::LEFT, value); } \
25  void SetBottom##name(type value) { Set##name(vtkAxis::BOTTOM, value); } \
26  void SetRight##name(type value) { Set##name(vtkAxis::RIGHT, value); } \
27  void SetTop##name(type value) { Set##name(vtkAxis::TOP, value); }
28 
29 #define GENERATE_AXIS_FUNCTIONS2(name, type1, type2) \
30  void SetLeft##name(type1 value1, type2 value2) { Set##name(vtkAxis::LEFT, value1, value2); } \
31  void SetBottom##name(type1 value1, type2 value2) { Set##name(vtkAxis::BOTTOM, value1, value2); } \
32  void SetRight##name(type1 value1, type2 value2) { Set##name(vtkAxis::RIGHT, value1, value2); } \
33  void SetTop##name(type1 value1, type2 value2) { Set##name(vtkAxis::TOP, value1, value2); }
34 
35 #define GENERATE_AXIS_FUNCTIONS3(name, type1, type2, type3) \
36  void SetLeft##name(type1 value1, type2 value2, type3 value3) \
37  { \
38  Set##name(vtkAxis::LEFT, value1, value2, value3); \
39  } \
40  void SetBottom##name(type1 value1, type2 value2, type3 value3) \
41  { \
42  Set##name(vtkAxis::BOTTOM, value1, value2, value3); \
43  } \
44  void SetRight##name(type1 value1, type2 value2, type3 value3) \
45  { \
46  Set##name(vtkAxis::RIGHT, value1, value2, value3); \
47  } \
48  void SetTop##name(type1 value1, type2 value2, type3 value3) \
49  { \
50  Set##name(vtkAxis::TOP, value1, value2, value3); \
51  }
52 
54 {
55 public:
56  static vtkPVXYChartView* New();
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
63  void SetChartType(const char* type);
64  void SetChartTypeToLine() { this->SetChartType("Line"); }
65  void SetChartTypeToPoint() { this->SetChartType("Point"); }
66  void SetChartTypeToBar() { this->SetChartType("Bar"); }
67  void SetChartTypeToBag() { this->SetChartType("Bag"); }
68  void SetChartTypeToBox() { this->SetChartType("Box"); }
69  void SetChartTypeToArea() { this->SetChartType("Area"); }
70  void SetChartTypeToFunctionalBag() { this->SetChartType("FunctionalBag"); }
71  void SetChartTypeToImage() { this->SetChartType("Image"); }
72  void SetChartTypeToParallelCoordinates() { this->SetChartType("ParallelCoordinates"); }
73 
75 
81  void SetTitleFont(const char* family, int pointSize, bool bold, bool italic) override;
82  void SetTitleFontFamily(const char* family) override;
83  void SetTitleFontSize(int pointSize) override;
84  void SetTitleBold(bool bold) override;
85  void SetTitleItalic(bool italic) override;
86  void SetTitleFontFile(const char* file) override;
87  const char* GetTitleFontFamily() override;
88  int GetTitleFontSize() override;
89  int GetTitleFontBold() override;
90  int GetTitleFontItalic() override;
92 
94 
100  void SetTitleColor(double red, double green, double blue) override;
101  double* GetTitleColor() override;
103 
105 
111  void SetTitleAlignment(int alignment) override;
112  int GetTitleAlignment() override;
114 
121  void SetLegendVisibility(int visible);
122 
129  void SetLegendLocation(int location);
130 
134  void SetLegendPosition(int x, int y);
135 
139  void SetLegendFontFamily(const char* family);
140 
144  void SetLegendFontFile(const char* file);
145 
149  void SetLegendFontSize(int pointSize);
150 
154  void SetLegendBold(bool bold);
155 
159  void SetLegendItalic(bool italic);
160 
164  void SetLegendSymbolWidth(int width);
165 
167 
173  void SetGridVisibility(int index, bool visible);
174  GENERATE_AXIS_FUNCTIONS(GridVisibility, bool);
176 
178 
184  void SetAxisColor(int index, double red, double green, double blue);
185  GENERATE_AXIS_FUNCTIONS3(AxisColor, double, double, double);
187 
189 
195  void SetGridColor(int index, double red, double green, double blue);
196  GENERATE_AXIS_FUNCTIONS3(GridColor, double, double, double);
198 
200 
206  void SetAxisLabelVisibility(int index, bool visible);
207  GENERATE_AXIS_FUNCTIONS(AxisLabelVisibility, bool);
209 
216  void SetAxisLabelFont(int index, const char* family, int pointSize, bool bold, bool italic);
217 
219 
222  void SetAxisLabelFontFamily(int index, const char* family);
223  GENERATE_AXIS_FUNCTIONS(AxisLabelFontFamily, const char*);
225 
227 
230  void SetAxisLabelFontFile(int index, const char* file);
231  GENERATE_AXIS_FUNCTIONS(AxisLabelFontFile, const char*);
233 
235 
238  void SetAxisLabelFontSize(int index, int pointSize);
239  GENERATE_AXIS_FUNCTIONS(AxisLabelFontSize, int);
241 
243 
246  void SetAxisLabelBold(int index, bool bold);
247  GENERATE_AXIS_FUNCTIONS(AxisLabelBold, bool);
249 
251 
254  void SetAxisLabelItalic(int index, bool italic);
255  GENERATE_AXIS_FUNCTIONS(AxisLabelItalic, bool);
257 
259 
265  void SetAxisLabelColor(int index, double red, double green, double blue);
266  GENERATE_AXIS_FUNCTIONS3(AxisLabelColor, double, double, double);
268 
270 
276  void SetAxisLabelNotation(int index, int notation);
277  GENERATE_AXIS_FUNCTIONS(AxisLabelNotation, int);
279 
281 
287  void SetAxisLabelPrecision(int index, int precision);
288  GENERATE_AXIS_FUNCTIONS(AxisLabelPrecision, int);
290 
292 
300  GENERATE_AXIS_FUNCTIONS(AxisRangeMinimum, double);
301  GENERATE_AXIS_FUNCTIONS(AxisRangeMaximum, double);
303 
305 
310  void SetAxisUseCustomRange(int index, bool useCustomRange);
311  GENERATE_AXIS_FUNCTIONS(AxisUseCustomRange, bool);
313 
315 
321  void SetAxisLogScale(int index, bool logScale);
322  GENERATE_AXIS_FUNCTIONS(AxisLogScale, bool);
324 
326 
332  void SetAxisTitle(int index, const char* title);
333  GENERATE_AXIS_FUNCTIONS(AxisTitle, const char*);
335 
342  void SetAxisTitleFont(int index, const char* family, int pointSize, bool bold, bool italic);
343 
345 
351  void SetAxisTitleFontFamily(int index, const char* family);
352  GENERATE_AXIS_FUNCTIONS(AxisTitleFontFamily, const char*);
354 
356 
362  void SetAxisTitleFontFile(int index, const char* file);
363  GENERATE_AXIS_FUNCTIONS(AxisTitleFontFile, const char*);
365 
367 
373  void SetAxisTitleFontSize(int index, int pointSize);
374  GENERATE_AXIS_FUNCTIONS(AxisTitleFontSize, int);
376 
378 
384  void SetAxisTitleBold(int index, bool bold);
385  GENERATE_AXIS_FUNCTIONS(AxisTitleBold, bool);
387 
389 
395  void SetAxisTitleItalic(int index, bool italic);
396  GENERATE_AXIS_FUNCTIONS(AxisTitleItalic, bool);
398 
400 
406  void SetAxisTitleColor(int index, double red, double green, double blue);
407  GENERATE_AXIS_FUNCTIONS3(AxisTitleColor, double, double, double);
409 
411 
415  void SetAxisUseCustomLabels(int index, bool useCustomLabels);
416  GENERATE_AXIS_FUNCTIONS(AxisUseCustomLabels, bool);
418 
420 
423  void SetAxisLabelsNumber(int axis, int number);
424  GENERATE_AXIS_FUNCTIONS(AxisLabelsNumber, int);
426 
428 
431  void SetAxisLabels(int axis, int index, const std::string& value, const std::string& label);
432  GENERATE_AXIS_FUNCTIONS3(AxisLabels, int, const std::string&, const std::string&);
434 
435  void SetTooltipLabelFormat(const vtkStdString& labelFormat);
436  void SetTooltipNotation(int notation);
437  void SetTooltipPrecision(int precision);
438 
440 
445  vtkSetMacro(HideTimeMarker, bool);
446  vtkGetMacro(HideTimeMarker, bool);
448 
450 
454  vtkGetMacro(SortByXAxis, bool);
455  vtkSetMacro(SortByXAxis, bool);
457 
462  static void SetIgnoreNegativeLogAxisWarning(bool val)
463  {
465  }
467  {
469  }
470 
474  virtual vtkChart* GetChart();
475 
480 
488  void SetSelection(vtkChartRepresentation* repr, vtkSelection* selection) override;
489 
493  void Update() override;
494 
495 protected:
497  ~vtkPVXYChartView() override;
498 
499  void SetAxisRangeMinimum(int index, double min);
500  void SetAxisRangeMaximum(int index, double max);
501 
505  void Render(bool interactive) override;
506 
508 
515 
516  void SelectionChanged();
517 
520 
522 
523 private:
524  vtkPVXYChartView(const vtkPVXYChartView&) = delete;
525  void operator=(const vtkPVXYChartView&) = delete;
526 
527  class vtkInternals;
528  vtkInternals* Internals;
529 };
530 
531 #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.
static bool GetIgnoreNegativeLogAxisWarning()
static void SetIgnoreNegativeLogAxisWarning(bool val)
When plotting data with nonpositive values, ignore the standard warning and draw only the data with p...
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