vtkXYChartRepresentation.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
19 #ifndef vtkXYChartRepresentation_h
20 #define vtkXYChartRepresentation_h
21 
22 #include "vtkChartRepresentation.h"
23 #include "vtkParaViewDeprecation.h" // for deprecation
24 
25 class vtkChartXY;
26 class vtkScalarsToColors;
27 
29 {
30 public:
31  static vtkXYChartRepresentation* New();
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
39  void SetVisibility(bool visible) override;
40 
42 
48  vtkSetMacro(ChartType, int);
49  vtkGetMacro(ChartType, int);
51 
52  void SetChartTypeToLine();
53  void SetChartTypeToPoints();
54  void SetChartTypeToBar();
55  void SetChartTypeToStacked();
56  void SetChartTypeToBag();
57  void SetChartTypeToFunctionalBag();
58  void SetChartTypeToArea();
59 
65  vtkChartXY* GetChart();
66 
68 
71  vtkSetStringMacro(XAxisSeriesName);
72  vtkGetStringMacro(XAxisSeriesName);
74 
76 
80  vtkSetMacro(UseIndexForXAxis, bool);
81  vtkGetMacro(UseIndexForXAxis, bool);
83 
85 
90  void SetSortDataByXAxis(bool val);
91  vtkGetMacro(SortDataByXAxis, bool);
93 
95 
98  void SetSeriesVisibility(const char* seriesname, bool visible);
99  void SetLineThickness(const char* name, double value);
100  void SetLineStyle(const char* name, int value);
101  void SetColor(const char* name, double r, double g, double b);
102  void SetOpacity(const char* seriesname, double opacity);
103  void SetAxisCorner(const char* name, int corner);
104  void SetMarkerStyle(const char* name, int style);
105  void SetMarkerSize(const char* name, double value);
106  void SetLabel(const char* name, const char* label);
107  void SetUseColorMapping(const char* name, bool useColorMapping);
108  void SetLookupTable(const char* name, vtkScalarsToColors* lut);
109  const char* GetLabel(const char* name) const;
111 
112  void ClearSeriesVisibilities();
113  void ClearLineThicknesses();
114  void ClearLineStyles();
115  void ClearColors();
116  void ClearOpacities();
117  void ClearAxisCorners();
118  void ClearMarkerSizes();
119  void ClearMarkerStyles();
120  void ClearLabels();
121 
122  vtkSetVector3Macro(SelectionColor, double);
123  vtkGetVector3Macro(SelectionColor, double);
124 
126 
129  vtkSetStringMacro(SeriesLabelPrefix);
130  vtkGetStringMacro(SeriesLabelPrefix);
132 
134 
139  bool Export(vtkAbstractChartExporter* exporter) override;
140 
141  PARAVIEW_DEPRECATED_IN_5_12_0("Use Export(vtkAbstractChartExporter* exporter) instead")
142  bool Export(vtkCSVExporter* exporter) override;
144 
145 protected:
147  ~vtkXYChartRepresentation() override;
148 
152  bool RemoveFromView(vtkView* view) override;
153 
154  int ProcessViewRequest(vtkInformationRequestKey* request_type, vtkInformation* inInfo,
155  vtkInformation* outInfo) override;
156 
157  int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
158 
159  vtkSmartPointer<vtkDataObject> TransformTable(vtkSmartPointer<vtkDataObject>) override;
160 
161  void PrepareForRendering() override;
162 
164  friend class vtkInternals;
165  vtkInternals* Internals;
166 
167  class SortTableFilter;
168 
169 private:
170  vtkXYChartRepresentation(const vtkXYChartRepresentation&) = delete;
171  void operator=(const vtkXYChartRepresentation&) = delete;
172 
173  int ChartType;
174  char* XAxisSeriesName;
175  bool UseIndexForXAxis;
176  bool SortDataByXAxis;
177  bool PlotDataHasChanged;
178  double SelectionColor[3];
179  char* SeriesLabelPrefix;
180 };
181 
182 #endif
#define PARAVIEW_DEPRECATED_IN_5_12_0(reason)
static vtkChartRepresentation * New()
#define VTKREMOTINGVIEWS_EXPORT
vtkXYChartRepresentation is representation that is used to add vtkPlot subclasses to a vtkChartXY ins...
void SetVisibility(bool visible) override
Set visibility of the representation.
virtual bool Export(vtkAbstractChartExporter *vtkNotUsed(exporter))
Called by vtkPVContextView::Export() to export the representation&#39;s data to a CSV file...
vtkChartRepresentation is the base representation for charting representations.
exporter used by certain views to export data as CSV.
void PrintSelf(ostream &os, vtkIndent indent) override
#define const
Definition: zconf.h:238
exporter used by certain views to export data into a file or stream.