VTK  9.7.20261119
vtkChartRadViz.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
36
37#ifndef vtkChartRadViz_h
38#define vtkChartRadViz_h
39
40#include "vtkChart.h"
41#include "vtkChartsCoreModule.h" // For export macro
42#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
43#include <memory> // For std::unique_ptr
44#include <string> // For variable names
45#include <vector> // For variable indices
46
47VTK_ABI_NAMESPACE_BEGIN
48class vtkChartLegend;
49class vtkTooltipItem;
50class vtkPlotRadViz;
51class vtkStringArray;
52
53class VTKCHARTSCORE_EXPORT VTK_MARSHALAUTO vtkChartRadViz : public vtkChart
54{
55public:
56 vtkTypeMacro(vtkChartRadViz, vtkChart);
57 void PrintSelf(ostream& os, vtkIndent indent) override;
58
63
69 void Update() override;
70
74 bool Paint(vtkContext2D* painter) override;
75
77
81 vtkPlot* AddPlot(int type) override;
82
88 vtkIdType AddPlot(vtkPlot* plot) override;
89
94 bool RemovePlot(vtkIdType index) override;
95 void ClearPlots() override;
97
103 virtual void SetPlot(vtkPlotRadViz* plot);
104
108 vtkPlot* GetPlot(vtkIdType index) override;
109
114
116
131 void SetVariableVisibility(const std::string& name, bool visible);
132 void SetVariableVisibility(int index, bool visible);
133 void SetVariableVisibilityAll(bool visible);
134 bool GetVariableVisibility(const std::string& name);
135 bool GetVariableVisibility(int index);
141 void SetVisibleVariableIndices(const std::vector<int>& indices);
145 void AddVisibleVariableIndex(int index);
146
150 void SetScene(vtkContextScene* scene) override;
152
154
157 bool Hit(const vtkContextMouseEvent& mouse) override;
158
163 bool MouseEnterEvent(const vtkContextMouseEvent& mouse) override;
164
169 bool MouseMoveEvent(const vtkContextMouseEvent& mouse) override;
170
175 bool MouseLeaveEvent(const vtkContextMouseEvent& mouse) override;
176
181 bool MouseButtonPressEvent(const vtkContextMouseEvent& mouse) override;
182
188
192 bool MouseWheelEvent(const vtkContextMouseEvent& mouse, int delta) override;
194
195protected:
197 ~vtkChartRadViz() override;
202 void GetActiveElement(const vtkVector2f& pos, int& activeVertexIndex, bool& activeLensOutline,
203 bool& activeLensInterior);
204
205private:
206 vtkChartRadViz(const vtkChartRadViz&) = delete;
207 void operator=(const vtkChartRadViz&) = delete;
208
212 class vtkInternals;
213 std::unique_ptr<vtkInternals> Internals;
214};
215
216VTK_ABI_NAMESPACE_END
217#endif // vtkChartRadViz_h
draw the chart legend
bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) override
Mouse button down event.
vtkPlot * GetPlot(vtkIdType index) override
Get the plot at the specified index, returns null if the index is invalid.
void SetScene(vtkContextScene *scene) override
Set the vtkContextScene for the item, always set for an item in a scene.
bool Hit(const vtkContextMouseEvent &mouse) override
Return true if the supplied x, y coordinates are inside the item.
bool GetVariableVisibility(int index)
Variable visibility, by name or index.
bool Paint(vtkContext2D *painter) override
Paint event for the chart, called whenever the chart needs to be drawn.
void SetVariableVisibility(const std::string &name, bool visible)
Variable visibility, by name or index.
void Update() override
Perform any updates to the item that may be necessary before rendering.
bool MouseEnterEvent(const vtkContextMouseEvent &mouse) override
Mouse enter event.
virtual void SetVisibleVariables(vtkStringArray *names)
Variable visibility, by name or index.
bool MouseLeaveEvent(const vtkContextMouseEvent &mouse) override
Mouse leave event.
virtual vtkStringArray * GetVisibleVariables()
Variable visibility, by name or index.
void ClearPlots() override
Add a plot to the chart.
void GetActiveElement(const vtkVector2f &pos, int &activeVertexIndex, bool &activeLensOutline, bool &activeLensInterior)
Gets the active element (vertex, lens outline or lens interior) based on the mouse position.
vtkIdType GetNumberOfPlots() override
Get the number of plots the chart contains.
bool RemovePlot(vtkIdType index) override
Remove the plot, the same as SetPlot(nullptr).
bool MouseMoveEvent(const vtkContextMouseEvent &mouse) override
Mouse move event.
void SetVariableVisibilityAll(bool visible)
Variable visibility, by name or index.
std::vector< int > GetVisibleVariableIndices()
Variable visibility, by name or index.
void SetVariableVisibility(int index, bool visible)
Variable visibility, by name or index.
virtual void SetPlot(vtkPlotRadViz *plot)
Set the plot to use for the chart.
bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta) override
Mouse wheel event, positive delta indicates forward movement of the wheel.
static vtkChartRadViz * New()
Creates a RadViz chart object.
vtkPlot * AddPlot(int type) override
Add a plot to the chart.
bool GetVariableVisibility(const std::string &name)
Variable visibility, by name or index.
bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse) override
Mouse button release event.
void SetVisibleVariableIndices(const std::vector< int > &indices)
Variable visibility, by name or index.
vtkIdType AddPlot(vtkPlot *plot) override
Set 'plot', a vtkPlotRadViz, as the plot of the chart, the same as SetPlot(), and return 0.
void AddVisibleVariableIndex(int index)
Variable visibility, by name or index.
void ResetVisibleVariableIndices()
Variable visibility, by name or index.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Class for drawing 2D primitives to a graphical context.
data structure to represent mouse events.
Provides a 2D scene for vtkContextItem objects.
a simple class to control print indentation
Definition vtkIndent.h:108
Radial plot of multivariate data that shows the relations among these variables.
Abstract class for 2D plots.
Definition vtkPlot.h:153
a vtkAbstractArray subclass for strings
takes care of drawing 2D axes
int vtkIdType
Definition vtkType.h:366
#define VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)