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 "vtkPVContextView.h"
29 #include "vtkRemotingViewsModule.h" //needed for exports
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 
66 {
67 public:
68  static vtkPVXYChartView* New();
70  void PrintSelf(ostream& os, vtkIndent indent) override;
71 
75  void SetChartType(const char* type);
76  void SetChartTypeToLine() { this->SetChartType("Line"); }
77  void SetChartTypeToPoint() { this->SetChartType("Point"); }
78  void SetChartTypeToBar() { this->SetChartType("Bar"); }
79  void SetChartTypeToBag() { this->SetChartType("Bag"); }
80  void SetChartTypeToBox() { this->SetChartType("Box"); }
81  void SetChartTypeToArea() { this->SetChartType("Area"); }
82  void SetChartTypeToFunctionalBag() { this->SetChartType("FunctionalBag"); }
83  void SetChartTypeToParallelCoordinates() { this->SetChartType("ParallelCoordinates"); }
84 
86 
92  void SetTitleFont(const char* family, int pointSize, bool bold, bool italic) override;
93  void SetTitleFontFamily(const char* family) override;
94  void SetTitleFontSize(int pointSize) override;
95  void SetTitleBold(bool bold) override;
96  void SetTitleItalic(bool italic) override;
97  void SetTitleFontFile(const char* file) override;
98  const char* GetTitleFontFamily() override;
99  int GetTitleFontSize() override;
100  int GetTitleFontBold() override;
101  int GetTitleFontItalic() override;
103 
105 
111  void SetTitleColor(double red, double green, double blue) override;
112  double* GetTitleColor() override;
114 
116 
122  void SetTitleAlignment(int alignment) override;
123  int GetTitleAlignment() override;
125 
132  void SetLegendVisibility(int visible);
133 
140  void SetLegendLocation(int location);
141 
145  void SetLegendPosition(int x, int y);
146 
150  void SetLegendFontFamily(const char* family);
151 
155  void SetLegendFontFile(const char* file);
156 
160  void SetLegendFontSize(int pointSize);
161 
165  void SetLegendBold(bool bold);
166 
170  void SetLegendItalic(bool italic);
171 
175  void SetLegendSymbolWidth(int width);
176 
178 
184  void SetGridVisibility(int index, bool visible);
185  GENERATE_AXIS_FUNCTIONS(GridVisibility, bool);
187 
189 
195  void SetAxisColor(int index, double red, double green, double blue);
196  GENERATE_AXIS_FUNCTIONS3(AxisColor, double, double, double);
198 
200 
206  void SetGridColor(int index, double red, double green, double blue);
207  GENERATE_AXIS_FUNCTIONS3(GridColor, double, double, double);
209 
211 
217  void SetAxisLabelVisibility(int index, bool visible);
218  GENERATE_AXIS_FUNCTIONS(AxisLabelVisibility, bool);
220 
227  void SetAxisLabelFont(int index, const char* family, int pointSize, bool bold, bool italic);
228 
230 
233  void SetAxisLabelFontFamily(int index, const char* family);
234  GENERATE_AXIS_FUNCTIONS(AxisLabelFontFamily, const char*);
236 
238 
241  void SetAxisLabelFontFile(int index, const char* file);
242  GENERATE_AXIS_FUNCTIONS(AxisLabelFontFile, const char*);
244 
246 
249  void SetAxisLabelFontSize(int index, int pointSize);
250  GENERATE_AXIS_FUNCTIONS(AxisLabelFontSize, int);
252 
254 
257  void SetAxisLabelBold(int index, bool bold);
258  GENERATE_AXIS_FUNCTIONS(AxisLabelBold, bool);
260 
262 
265  void SetAxisLabelItalic(int index, bool italic);
266  GENERATE_AXIS_FUNCTIONS(AxisLabelItalic, bool);
268 
270 
276  void SetAxisLabelColor(int index, double red, double green, double blue);
277  GENERATE_AXIS_FUNCTIONS3(AxisLabelColor, double, double, double);
279 
281 
287  void SetAxisLabelNotation(int index, int notation);
288  GENERATE_AXIS_FUNCTIONS(AxisLabelNotation, int);
290 
292 
298  void SetAxisLabelPrecision(int index, int precision);
299  GENERATE_AXIS_FUNCTIONS(AxisLabelPrecision, int);
301 
303 
311  GENERATE_AXIS_FUNCTIONS(AxisRangeMinimum, double);
312  GENERATE_AXIS_FUNCTIONS(AxisRangeMaximum, double);
314 
316 
321  void SetAxisUseCustomRange(int index, bool useCustomRange);
322  GENERATE_AXIS_FUNCTIONS(AxisUseCustomRange, bool);
324 
326 
332  void SetAxisLogScale(int index, bool logScale);
333  GENERATE_AXIS_FUNCTIONS(AxisLogScale, bool);
335 
337 
343  void SetAxisTitle(int index, const char* title);
344  GENERATE_AXIS_FUNCTIONS(AxisTitle, const char*);
346 
353  void SetAxisTitleFont(int index, const char* family, int pointSize, bool bold, bool italic);
354 
356 
362  void SetAxisTitleFontFamily(int index, const char* family);
363  GENERATE_AXIS_FUNCTIONS(AxisTitleFontFamily, const char*);
365 
367 
373  void SetAxisTitleFontFile(int index, const char* file);
374  GENERATE_AXIS_FUNCTIONS(AxisTitleFontFile, const char*);
376 
378 
384  void SetAxisTitleFontSize(int index, int pointSize);
385  GENERATE_AXIS_FUNCTIONS(AxisTitleFontSize, int);
387 
389 
395  void SetAxisTitleBold(int index, bool bold);
396  GENERATE_AXIS_FUNCTIONS(AxisTitleBold, bool);
398 
400 
406  void SetAxisTitleItalic(int index, bool italic);
407  GENERATE_AXIS_FUNCTIONS(AxisTitleItalic, bool);
409 
411 
417  void SetAxisTitleColor(int index, double red, double green, double blue);
418  GENERATE_AXIS_FUNCTIONS3(AxisTitleColor, double, double, double);
420 
422 
426  void SetAxisUseCustomLabels(int index, bool useCustomLabels);
427  GENERATE_AXIS_FUNCTIONS(AxisUseCustomLabels, bool);
429 
431 
434  void SetAxisLabelsNumber(int axis, int number);
435  GENERATE_AXIS_FUNCTIONS(AxisLabelsNumber, int);
437 
439 
442  void SetAxisLabels(int axis, int index, const std::string& value, const std::string& label);
443  GENERATE_AXIS_FUNCTIONS3(AxisLabels, int, const std::string&, const std::string&);
445 
446  void SetTooltipNotation(int notation);
447  void SetTooltipPrecision(int precision);
448 
450 
455  vtkSetMacro(HideTimeMarker, bool);
456  vtkGetMacro(HideTimeMarker, bool);
458 
460 
464  vtkGetMacro(SortByXAxis, bool);
465  vtkSetMacro(SortByXAxis, bool);
467 
472  static void SetIgnoreNegativeLogAxisWarning(bool val)
473  {
475  }
477  {
479  }
480 
484  virtual vtkChart* GetChart();
485 
490 
498  void SetSelection(vtkChartRepresentation* repr, vtkSelection* selection) override;
499 
503  void Update() override;
504 
505 protected:
507  ~vtkPVXYChartView() override;
508 
509  void SetAxisRangeMinimum(int index, double min);
510  void SetAxisRangeMaximum(int index, double max);
511 
515  void Render(bool interactive) override;
516 
518 
525 
526  void SelectionChanged();
527 
530 
532 
533 private:
534  vtkPVXYChartView(const vtkPVXYChartView&) = delete;
535  void operator=(const vtkPVXYChartView&) = delete;
536 
537  class vtkInternals;
538  vtkInternals* Internals;
539 };
540 
541 #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:29
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