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 
24 class vtkChartXY;
25 class vtkScalarsToColors;
26 
28 {
29 public:
30  static vtkXYChartRepresentation* New();
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
38  void SetVisibility(bool visible) override;
39 
41 
47  vtkSetMacro(ChartType, int);
48  vtkGetMacro(ChartType, int);
50 
51  void SetChartTypeToLine();
52  void SetChartTypeToPoints();
53  void SetChartTypeToBar();
54  void SetChartTypeToStacked();
55  void SetChartTypeToBag();
56  void SetChartTypeToFunctionalBag();
57  void SetChartTypeToArea();
58 
64  vtkChartXY* GetChart();
65 
67 
70  vtkSetStringMacro(XAxisSeriesName);
71  vtkGetStringMacro(XAxisSeriesName);
73 
75 
79  vtkSetMacro(UseIndexForXAxis, bool);
80  vtkGetMacro(UseIndexForXAxis, bool);
82 
84 
89  void SetSortDataByXAxis(bool val);
90  vtkGetMacro(SortDataByXAxis, bool);
92 
94 
97  void SetSeriesVisibility(const char* seriesname, bool visible);
98  void SetLineThickness(const char* name, double value);
99  void SetLineStyle(const char* name, int value);
100  void SetColor(const char* name, double r, double g, double b);
101  void SetOpacity(const char* seriesname, double opacity);
102  void SetAxisCorner(const char* name, int corner);
103  void SetMarkerStyle(const char* name, int style);
104  void SetMarkerSize(const char* name, double value);
105  void SetLabel(const char* name, const char* label);
106  void SetUseColorMapping(const char* name, bool useColorMapping);
107  void SetLookupTable(const char* name, vtkScalarsToColors* lut);
108  const char* GetLabel(const char* name) const;
110 
111  void ClearSeriesVisibilities();
112  void ClearLineThicknesses();
113  void ClearLineStyles();
114  void ClearColors();
115  void ClearOpacities();
116  void ClearAxisCorners();
117  void ClearMarkerSizes();
118  void ClearMarkerStyles();
119  void ClearLabels();
120 
121  vtkSetVector3Macro(SelectionColor, double);
122  vtkGetVector3Macro(SelectionColor, double);
123 
125 
128  vtkSetStringMacro(SeriesLabelPrefix);
129  vtkGetStringMacro(SeriesLabelPrefix);
131 
137  bool Export(vtkAbstractChartExporter* exporter) override;
138 
139 protected:
141  ~vtkXYChartRepresentation() override;
142 
146  bool RemoveFromView(vtkView* view) override;
147 
149  vtkInformation* outInfo) override;
150 
152 
154 
155  void PrepareForRendering() override;
156 
158  friend class vtkInternals;
160 
161  class SortTableFilter;
162 
163 private:
165  void operator=(const vtkXYChartRepresentation&) = delete;
166 
167  int ChartType;
168  char* XAxisSeriesName;
169  bool UseIndexForXAxis;
170  bool SortDataByXAxis;
171  bool PlotDataHasChanged;
172  double SelectionColor[3];
173  char* SeriesLabelPrefix;
174 };
175 
176 #endif
static vtkChartRepresentation * New()
virtual void PrepareForRendering()
This method is called before actual render if this->MTime was modified since the last time this metho...
#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 vtkSmartPointer< vtkDataObject > TransformTable(vtkSmartPointer< vtkDataObject > table)
Method to be overridden to apply an operation of the table after it is gathered to the first rank for...
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.
int ProcessViewRequest(vtkInformationRequestKey *request_type, vtkInformation *inInfo, vtkInformation *outInfo) override
vtkAlgorithm::ProcessRequest() equivalent for rendering passes.
void PrintSelf(ostream &os, vtkIndent indent) override
exporter used by certain views to export data into a file or stream.
bool RemoveFromView(vtkView *view) override
Removes the representation to the view.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses should override this to connect inputs to the internal pipeline as necessary.