VTK  9.3.20240328
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 
34 #ifndef vtkChartParallelCoordinates_h
35 #define vtkChartParallelCoordinates_h
36 
37 #include "vtkChart.h"
38 #include "vtkChartsCoreModule.h" // For export macro
39 #include "vtkNew.h" // For vtkNew
40 
41 VTK_ABI_NAMESPACE_BEGIN
42 class vtkIdTypeArray;
43 class vtkStdString;
44 class vtkStringArray;
46 
47 class VTKCHARTSCORE_EXPORT vtkChartParallelCoordinates : public vtkChart
48 {
49 public:
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
57 
63  void Update() override;
64 
68  bool Paint(vtkContext2D* painter) override;
69 
73  bool PaintRect(vtkContext2D* painter, int axis, float min, float max);
74 
78  void SetColumnVisibility(const vtkStdString& name, bool visible);
79 
84  void SetColumnVisibilityAll(bool visible);
85 
90 
95 
99  virtual void SetVisibleColumns(vtkStringArray* visColumns);
100 
105 
110 
114  void SetShowLegend(bool visible) override;
115 
121 
125  vtkAxis* GetAxis(int axisIndex) override;
126 
131 
136  void RecalculateBounds() override;
137 
142  virtual void SetPlot(vtkPlotParallelCoordinates* plot);
143 
147  bool Hit(const vtkContextMouseEvent& mouse) override;
148 
152  bool MouseEnterEvent(const vtkContextMouseEvent& mouse) override;
153 
157  bool MouseMoveEvent(const vtkContextMouseEvent& mouse) override;
158 
162  bool MouseLeaveEvent(const vtkContextMouseEvent& mouse) override;
163 
167  bool MouseButtonPressEvent(const vtkContextMouseEvent& mouse) override;
168 
172  bool MouseButtonReleaseEvent(const vtkContextMouseEvent& mouse) override;
173 
177  bool MouseWheelEvent(const vtkContextMouseEvent& mouse, int delta) override;
178 
183  void UpdateCurrentAxisSelection(int axisId);
184 
185 protected:
188 
190 
193  struct Private;
194  Private* Storage;
196 
201 
203 
208 
213 
218 
220  void ResetAxeSelection(int axe);
222  void UpdateGeometry(vtkContext2D* painter);
224  void SwapAxes(int a1, int a2);
225 
226 private:
228  void operator=(const vtkChartParallelCoordinates&) = delete;
229 };
230 
231 VTK_ABI_NAMESPACE_END
232 #endif // vtkChartParallelCoordinates_h
takes care of drawing 2D axes
Definition: vtkAxis.h:170
draw the chart legend
Factory class for drawing 2D charts.
vtkAxis * GetAxis(int axisIndex) override
Get the axis specified by axisIndex.
bool MouseMoveEvent(const vtkContextMouseEvent &mouse) override
Mouse move event.
vtkChartLegend * GetLegend() override
Get the legend for the chart, if available.
vtkNew< vtkStringArray > VisibleColumns
Strongly owned internal data for the column visibility.
virtual void SetVisibleColumns(vtkStringArray *visColumns)
Set the list of visible columns, and the order in which they will be displayed.
vtkPlot * GetPlot(vtkIdType index) override
Get the plot at the specified index, returns null if the index is invalid.
void UpdateCurrentAxisSelection(int axisId)
Update the selection of an axis based on the current selectionMode we have previously set.
vtkTimeStamp BuildTime
The point cache is marked dirty until it has been initialized.
vtkIdType GetNumberOfAxes() override
Get the number of axes in the current chart.
bool GetColumnVisibility(const vtkStdString &name)
Get the visibility of the specified column.
bool Hit(const vtkContextMouseEvent &mouse) override
Return true if the supplied x, y coordinate is inside the item.
void ResetAxeSelection(int axe)
void RecalculateBounds() override
Request that the chart recalculates the range of its axes.
void UpdateGeometry(vtkContext2D *painter)
void SetColumnVisibility(const vtkStdString &name, bool visible)
Set the visibility of the specified column.
virtual vtkStringArray * GetVisibleColumns()
Get a list of the columns, and the order in which they are displayed.
bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta) override
Mouse wheel event, positive delta indicates forward movement of the wheel.
void SetColumnVisibilityAll(bool visible)
Set the visibility of all columns (true will make them all visible, false will remove all visible col...
bool MouseEnterEvent(const vtkContextMouseEvent &mouse) override
Mouse enter event.
vtkIdTypeArray * Selection
Selected indices for the table the plot is rendering.
vtkIdType GetNumberOfPlots() override
Get the number of plots the chart contains.
bool Paint(vtkContext2D *painter) override
Paint event for the chart, called whenever the chart needs to be drawn.
vtkChartLegend * Legend
The legend for the chart.
void SetShowLegend(bool visible) override
Set whether the chart should draw a legend.
bool MouseLeaveEvent(const vtkContextMouseEvent &mouse) override
Mouse leave event.
bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse) override
Mouse button release event.
bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) override
Mouse button down event.
virtual void SetPlot(vtkPlotParallelCoordinates *plot)
Set plot to use for the chart.
bool PaintRect(vtkContext2D *painter, int axis, float min, float max)
Draw a rect on a specific axis.
static vtkChartParallelCoordinates * New()
Creates a parallel coordinates chart.
void Update() override
Perform any updates to the item that may be necessary before rendering.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkChartParallelCoordinates() override
void SwapAxes(int a1, int a2)
Factory class for drawing 2D charts.
Definition: vtkChart.h:150
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:69
data structure to represent mouse events.
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:108
Class for drawing a parallel coordinate plot given columns from a vtkTable.
Abstract class for 2D plots.
Definition: vtkPlot.h:153
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:78
a vtkAbstractArray subclass for strings
record modification and/or execution time
Definition: vtkTimeStamp.h:44
@ name
Definition: vtkX3D.h:219
@ index
Definition: vtkX3D.h:246
int vtkIdType
Definition: vtkType.h:315
#define max(a, b)