VTK: Charts/Core/vtkChartParallelCoordinates.h Source File

| VTK 9.3.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
24 #ifndef vtkChartParallelCoordinates_h
25 #define vtkChartParallelCoordinates_h
26
27 #include "vtkChart.h"
28 #include "vtkChartsCoreModule.h" // For export macro
29 #include "vtkNew.h" // For vtkNew
30
31 VTK_ABI_NAMESPACE_BEGIN
32 class vtkIdTypeArray;
33 class vtkStdString;
34 class vtkStringArray;
35 class vtkPlotParallelCoordinates;
36
37 class VTKCHARTSCORE_EXPORT vtkChartParallelCoordinates : public vtkChart
38 {
39 public:
40 vtkTypeMacro(vtkChartParallelCoordinates, vtkChart);
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
46 static vtkChartParallelCoordinates* New();
47
53 void Update() override;
54
58 bool Paint(vtkContext2D* painter) override;
59
63 bool PaintRect(vtkContext2D* painter, int axis, float min, float max);
64
68 void SetColumnVisibility(const vtkStdString& name, bool visible);
69
74 void SetColumnVisibilityAll(bool visible);
75
79 bool GetColumnVisibility(const vtkStdString& name);
80
84 virtual vtkStringArray* GetVisibleColumns();
85
89 virtual void SetVisibleColumns(vtkStringArray* visColumns);
90
94 vtkPlot* GetPlot(vtkIdType index) override;
95
99 vtkIdType GetNumberOfPlots() override;
100
104 void SetShowLegend(bool visible) override;
105
110 vtkChartLegend* GetLegend() override;
111
115 vtkAxis* GetAxis(int axisIndex) override;
116
120 vtkIdType GetNumberOfAxes() override;
121
126 void RecalculateBounds() override;
127
132 virtual void SetPlot(vtkPlotParallelCoordinates* plot);
133
137 bool Hit(const vtkContextMouseEvent& mouse) override;
138
142 bool MouseEnterEvent(const vtkContextMouseEvent& mouse) override;
143
147 bool MouseMoveEvent(const vtkContextMouseEvent& mouse) override;
148
152 bool MouseLeaveEvent(const vtkContextMouseEvent& mouse) override;
153
157 bool MouseButtonPressEvent(const vtkContextMouseEvent& mouse) override;
158
162 bool MouseButtonReleaseEvent(const vtkContextMouseEvent& mouse) override;
163
167 bool MouseWheelEvent(const vtkContextMouseEvent& mouse, int delta) override;
168
173 void UpdateCurrentAxisSelection(int axisId);
174
175 protected:
176 vtkChartParallelCoordinates();
177 ~vtkChartParallelCoordinates() override;
178
180
183 struct Private;
184 Private* Storage;
186
190 vtkChartLegend* Legend;
191
192 bool GeometryValid;
193
197 vtkIdTypeArray* Selection;
198
202 vtkNew<vtkStringArray> VisibleColumns;
203
207 vtkTimeStamp BuildTime;
208
209 void ResetSelection();
210 void ResetAxeSelection(int axe);
211 void ResetAxesSelection();
212 void UpdateGeometry(vtkContext2D* painter);
213 void CalculatePlotTransform();
214 void SwapAxes(int a1, int a2);
215
216 private:
217 vtkChartParallelCoordinates(const vtkChartParallelCoordinates&) = delete;
218 void operator=(const vtkChartParallelCoordinates&) = delete;
219 };
220
221 VTK_ABI_NAMESPACE_END
222 #endif // vtkChartParallelCoordinates_h
vtkAxis
takes care of drawing 2D axes
Definition: vtkAxis.h:70
vtkChartLegend
draw the chart legend
Definition: vtkChartLegend.h:41
vtkChartParallelCoordinates
Factory class for drawing 2D charts.
Definition: vtkChartParallelCoordinates.h:38
vtkChartParallelCoordinates::ResetAxesSelection
void ResetAxesSelection()
vtkChartParallelCoordinates::GetAxis
vtkAxis * GetAxis(int axisIndex) override
Get the axis specified by axisIndex.
vtkChartParallelCoordinates::MouseMoveEvent
bool MouseMoveEvent(const vtkContextMouseEvent &mouse) override
Mouse move event.
vtkChartParallelCoordinates::GetLegend
vtkChartLegend * GetLegend() override
Get the legend for the chart, if available.
vtkChartParallelCoordinates::VisibleColumns
vtkNew< vtkStringArray > VisibleColumns
Strongly owned internal data for the column visibility.
Definition: vtkChartParallelCoordinates.h:202
vtkChartParallelCoordinates::CalculatePlotTransform
void CalculatePlotTransform()
vtkChartParallelCoordinates::SetVisibleColumns
virtual void SetVisibleColumns(vtkStringArray *visColumns)
Set the list of visible columns, and the order in which they will be displayed.
vtkChartParallelCoordinates::GetPlot
vtkPlot * GetPlot(vtkIdType index) override
Get the plot at the specified index, returns null if the index is invalid.
vtkChartParallelCoordinates::UpdateCurrentAxisSelection
void UpdateCurrentAxisSelection(int axisId)
Update the selection of an axis based on the current selectionMode we have previously set.
vtkChartParallelCoordinates::BuildTime
vtkTimeStamp BuildTime
The point cache is marked dirty until it has been initialized.
Definition: vtkChartParallelCoordinates.h:207
vtkChartParallelCoordinates::GetNumberOfAxes
vtkIdType GetNumberOfAxes() override
Get the number of axes in the current chart.
vtkChartParallelCoordinates::GetColumnVisibility
bool GetColumnVisibility(const vtkStdString &name)
Get the visibility of the specified column.
vtkChartParallelCoordinates::Hit
bool Hit(const vtkContextMouseEvent &mouse) override
Return true if the supplied x, y coordinate is inside the item.
vtkChartParallelCoordinates::ResetAxeSelection
void ResetAxeSelection(int axe)
vtkChartParallelCoordinates::ResetSelection
void ResetSelection()
vtkChartParallelCoordinates::RecalculateBounds
void RecalculateBounds() override
Request that the chart recalculates the range of its axes.
vtkChartParallelCoordinates::UpdateGeometry
void UpdateGeometry(vtkContext2D *painter)
vtkChartParallelCoordinates::SetColumnVisibility
void SetColumnVisibility(const vtkStdString &name, bool visible)
Set the visibility of the specified column.
vtkChartParallelCoordinates::GetVisibleColumns
virtual vtkStringArray * GetVisibleColumns()
Get a list of the columns, and the order in which they are displayed.
vtkChartParallelCoordinates::Storage
Private * Storage
Definition: vtkChartParallelCoordinates.h:183
vtkChartParallelCoordinates::MouseWheelEvent
bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta) override
Mouse wheel event, positive delta indicates forward movement of the wheel.
vtkChartParallelCoordinates::SetColumnVisibilityAll
void SetColumnVisibilityAll(bool visible)
Set the visibility of all columns (true will make them all visible, false will remove all visible col...
vtkChartParallelCoordinates::MouseEnterEvent
bool MouseEnterEvent(const vtkContextMouseEvent &mouse) override
Mouse enter event.
vtkChartParallelCoordinates::Selection
vtkIdTypeArray * Selection
Selected indices for the table the plot is rendering.
Definition: vtkChartParallelCoordinates.h:197
vtkChartParallelCoordinates::GetNumberOfPlots
vtkIdType GetNumberOfPlots() override
Get the number of plots the chart contains.
vtkChartParallelCoordinates::Paint
bool Paint(vtkContext2D *painter) override
Paint event for the chart, called whenever the chart needs to be drawn.
vtkChartParallelCoordinates::Legend
vtkChartLegend * Legend
The legend for the chart.
Definition: vtkChartParallelCoordinates.h:190
vtkChartParallelCoordinates::SetShowLegend
void SetShowLegend(bool visible) override
Set whether the chart should draw a legend.
vtkChartParallelCoordinates::GeometryValid
bool GeometryValid
Definition: vtkChartParallelCoordinates.h:192
vtkChartParallelCoordinates::vtkChartParallelCoordinates
vtkChartParallelCoordinates()
vtkChartParallelCoordinates::MouseLeaveEvent
bool MouseLeaveEvent(const vtkContextMouseEvent &mouse) override
Mouse leave event.
vtkChartParallelCoordinates::MouseButtonReleaseEvent
bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse) override
Mouse button release event.
vtkChartParallelCoordinates::MouseButtonPressEvent
bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) override
Mouse button down event.
vtkChartParallelCoordinates::SetPlot
virtual void SetPlot(vtkPlotParallelCoordinates *plot)
Set plot to use for the chart.
vtkChartParallelCoordinates::PaintRect
bool PaintRect(vtkContext2D *painter, int axis, float min, float max)
Draw a rect on a specific axis.
vtkChartParallelCoordinates::New
static vtkChartParallelCoordinates * New()
Creates a parallel coordinates chart.
vtkChartParallelCoordinates::Update
void Update() override
Perform any updates to the item that may be necessary before rendering.
vtkChartParallelCoordinates::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkChartParallelCoordinates::~vtkChartParallelCoordinates
~vtkChartParallelCoordinates() override
vtkChartParallelCoordinates::SwapAxes
void SwapAxes(int a1, int a2)
vtkChart
Factory class for drawing 2D charts.
Definition: vtkChart.h:50
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:59
vtkContextMouseEvent
data structure to represent mouse events.
Definition: vtkContextMouseEvent.h:39
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:37
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkNew< vtkStringArray >
vtkPlotParallelCoordinates
Class for drawing a parallel coordinate plot given columns from a vtkTable.
Definition: vtkPlotParallelCoordinates.h:31
vtkPlot
Abstract class for 2D plots.
Definition: vtkPlot.h:53
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:38
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:41
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkChart.h
vtkNew.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:19