VTK  9.2.6
vtkChartParallelCoordinates.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkChartParallelCoordinates.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm 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 =========================================================================*/
15 
27 #ifndef vtkChartParallelCoordinates_h
28 #define vtkChartParallelCoordinates_h
29 
30 #include "vtkChart.h"
31 #include "vtkChartsCoreModule.h" // For export macro
32 #include "vtkNew.h" // For vtkNew
33 
34 class vtkIdTypeArray;
35 class vtkStdString;
36 class vtkStringArray;
38 
39 class VTKCHARTSCORE_EXPORT vtkChartParallelCoordinates : public vtkChart
40 {
41 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
49 
55  void Update() override;
56 
60  bool Paint(vtkContext2D* painter) override;
61 
65  bool PaintRect(vtkContext2D* painter, int axis, float min, float max);
66 
70  void SetColumnVisibility(const vtkStdString& name, bool visible);
71 
76  void SetColumnVisibilityAll(bool visible);
77 
81  bool GetColumnVisibility(const vtkStdString& name);
82 
86  virtual vtkStringArray* GetVisibleColumns();
87 
91  virtual void SetVisibleColumns(vtkStringArray* visColumns);
92 
96  vtkPlot* GetPlot(vtkIdType index) override;
97 
101  vtkIdType GetNumberOfPlots() override;
102 
106  vtkAxis* GetAxis(int axisIndex) override;
107 
111  vtkIdType GetNumberOfAxes() override;
112 
117  void RecalculateBounds() override;
118 
123  virtual void SetPlot(vtkPlotParallelCoordinates* plot);
124 
128  bool Hit(const vtkContextMouseEvent& mouse) override;
129 
133  bool MouseEnterEvent(const vtkContextMouseEvent& mouse) override;
134 
138  bool MouseMoveEvent(const vtkContextMouseEvent& mouse) override;
139 
143  bool MouseLeaveEvent(const vtkContextMouseEvent& mouse) override;
144 
148  bool MouseButtonPressEvent(const vtkContextMouseEvent& mouse) override;
149 
153  bool MouseButtonReleaseEvent(const vtkContextMouseEvent& mouse) override;
154 
158  bool MouseWheelEvent(const vtkContextMouseEvent& mouse, int delta) override;
159 
164  void UpdateCurrentAxisSelection(int axisId);
165 
166 protected:
168  ~vtkChartParallelCoordinates() override;
169 
171 
174  struct Private;
175  Private* Storage;
177 
179 
184 
189 
194 
195  void ResetSelection();
196  void ResetAxeSelection(int axe);
197  void ResetAxesSelection();
198  void UpdateGeometry();
199  void CalculatePlotTransform();
200  void SwapAxes(int a1, int a2);
201 
202 private:
204  void operator=(const vtkChartParallelCoordinates&) = delete;
205 };
206 
207 #endif // vtkChartParallelCoordinates_h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:38
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:35
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:332
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:57
Factory class for drawing 2D charts.
Definition: vtkChart.h:51
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:71
data structure to represent mouse events.
a simple class to control print indentation
Definition: vtkIndent.h:39
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:53
virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse)
Mouse enter event.
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.
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.