VTK  9.7.1
vtkChartParallelCoordinates.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
15 #ifndef vtkChartParallelCoordinates_h
16 #define vtkChartParallelCoordinates_h
17 
18 #include "vtkChart.h"
19 #include "vtkChartsCoreModule.h" // For export macro
20 #include "vtkNew.h" // For vtkNew
21 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkIdTypeArray;
25 class vtkStdString;
26 class vtkStringArray;
28 
29 class VTKCHARTSCORE_EXPORT VTK_MARSHALAUTO vtkChartParallelCoordinates : public vtkChart
30 {
31 public:
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
39 
45  void Update() override;
46 
50  bool Paint(vtkContext2D* painter) override;
51 
55  bool PaintRect(vtkContext2D* painter, int axis, float min, float max);
56 
60  void SetColumnVisibility(const vtkStdString& name, bool visible);
61 
66  void SetColumnVisibilityAll(bool visible);
67 
71  bool GetColumnVisibility(const vtkStdString& name);
72 
76  virtual vtkStringArray* GetVisibleColumns();
77 
81  virtual void SetVisibleColumns(vtkStringArray* visColumns);
82 
86  vtkPlot* GetPlot(vtkIdType index) override;
87 
91  vtkIdType GetNumberOfPlots() override;
92 
96  void SetShowLegend(bool visible) override;
97 
102  vtkChartLegend* GetLegend() override;
103 
107  vtkAxis* GetAxis(int axisIndex) override;
108 
112  vtkIdType GetNumberOfAxes() override;
113 
118  void RecalculateBounds() override;
119 
124  virtual void SetPlot(vtkPlotParallelCoordinates* plot);
125 
129  bool Hit(const vtkContextMouseEvent& mouse) override;
130 
134  bool MouseEnterEvent(const vtkContextMouseEvent& mouse) override;
135 
139  bool MouseMoveEvent(const vtkContextMouseEvent& mouse) override;
140 
144  bool MouseLeaveEvent(const vtkContextMouseEvent& mouse) override;
145 
149  bool MouseButtonPressEvent(const vtkContextMouseEvent& mouse) override;
150 
154  bool MouseButtonReleaseEvent(const vtkContextMouseEvent& mouse) override;
155 
159  bool MouseWheelEvent(const vtkContextMouseEvent& mouse, int delta) override;
160 
165  void UpdateCurrentAxisSelection(int axisId);
166 
167 protected:
169  ~vtkChartParallelCoordinates() override;
170 
172 
175  struct Private;
176  Private* Storage;
178 
183 
185 
190 
195 
200 
201  void ResetSelection();
202  void ResetAxeSelection(int axe);
203  void ResetAxesSelection();
204  void UpdateGeometry(vtkContext2D* painter);
205  void CalculatePlotTransform();
206  void SwapAxes(int a1, int a2);
207 
208 private:
210  void operator=(const vtkChartParallelCoordinates&) = delete;
211 
215  void ClearAllAxesSelections();
216 };
217 
218 VTK_ABI_NAMESPACE_END
219 #endif // vtkChartParallelCoordinates_h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:27
vtkChartLegend * Legend
The legend for the chart.
virtual void SetShowLegend(bool visible)
Set/get whether the chart should draw a legend.
virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse)
Mouse button down event Return true if the item holds the event, false if the event can be propagated...
virtual vtkIdType GetNumberOfAxes()
Get the number of axes in the current chart.
record modification and/or execution time
Definition: vtkTimeStamp.h:24
vtkIdTypeArray * Selection
Selected indices for the table the plot is rendering.
vtkTimeStamp BuildTime
The point cache is marked dirty until it has been initialized.
vtkNew< vtkStringArray > VisibleColumns
Strongly owned internal data for the column visibility.
bool Paint(vtkContext2D *painter) override=0
Paint event for the chart, called whenever the chart needs to be drawn.
a vtkAbstractArray subclass for strings
virtual void RecalculateBounds()
Request that the chart recalculates the range of its axes.
Class for drawing a parallel coordinate plot given columns from a vtkTable.
bool CalculatePlotTransform(vtkAxis *x, vtkAxis *y, vtkTransform2D *transform)
Given the x and y vtkAxis, and a transform, calculate the transform that the points in a chart would ...
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:363
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:49
Factory class for drawing 2D charts.
Definition: vtkChart.h:41
virtual bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta)
Mouse wheel event, positive delta indicates forward movement of the wheel.
takes care of drawing 2D axes
Definition: vtkAxis.h:61
data structure to represent mouse events.
virtual vtkChartLegend * GetLegend()
Get the legend for the chart, if available.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
Mouse button release event.
virtual vtkIdType GetNumberOfPlots()
Get the number of plots the chart contains.
Abstract class for 2D plots.
Definition: vtkPlot.h:43
virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse)
Mouse enter event.
draw the chart legend
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
Mouse move event.
virtual bool Hit(const vtkContextMouseEvent &mouse)
Return true if the supplied x, y coordinate is inside the item.
virtual vtkPlot * GetPlot(vtkIdType index)
Get the plot at the specified index, returns null if the index is invalid.
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void Update()
Perform any updates to the item that may be necessary before rendering.
virtual bool MouseLeaveEvent(const vtkContextMouseEvent &mouse)
Mouse leave event.
#define max(a, b)
virtual vtkAxis * GetAxis(int axisIndex)
Get the axis specified by axisIndex.
Factory class for drawing 2D charts.