VTK  9.6.1
vtkSpiderPlotActor.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
39
40#ifndef vtkSpiderPlotActor_h
41#define vtkSpiderPlotActor_h
42
43#include "vtkActor2D.h"
44#include "vtkNew.h" // For vtkNew
45#include "vtkRenderingAnnotationModule.h" // For export macro
46#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
47
48VTK_ABI_NAMESPACE_BEGIN
50class vtkAxisActor2D;
51class vtkDataObject;
52class vtkPolyData;
54class vtkTextMapper;
55class vtkTextProperty;
58class vtkAxisLabelArray;
59class vtkAxisRanges;
60class vtkSpiderPlotActorConnection;
61
62#define VTK_IV_COLUMN 0
63#define VTK_IV_ROW 1
64
65class VTKRENDERINGANNOTATION_EXPORT VTK_MARSHALAUTO vtkSpiderPlotActor : public vtkActor2D
66{
67public:
69
73 void PrintSelf(ostream& os, vtkIndent indent) override;
75
80
82
91
97
99
104 vtkSetClampMacro(IndependentVariables, int, VTK_IV_COLUMN, VTK_IV_ROW);
105 vtkGetMacro(IndependentVariables, int);
109
111
114 vtkSetMacro(TitleVisibility, vtkTypeBool);
115 vtkGetMacro(TitleVisibility, vtkTypeBool);
116 vtkBooleanMacro(TitleVisibility, vtkTypeBool);
118
120
123 vtkSetStringMacro(Title);
124 vtkGetStringMacro(Title);
126
128
132 vtkGetObjectMacro(TitleTextProperty, vtkTextProperty);
134
135 // Enable/Disable the display axes titles. These are arranged on the end
136 // of each radial axis on the circumference of the spider plot. The label
137 // text strings are derived from the names of the data object arrays
138 // associated with the input.
139 vtkSetMacro(LabelVisibility, vtkTypeBool);
140 vtkGetMacro(LabelVisibility, vtkTypeBool);
141 vtkBooleanMacro(LabelVisibility, vtkTypeBool);
142
144
150 vtkGetObjectMacro(LabelTextProperty, vtkTextProperty);
152
154
158 vtkSetClampMacro(NumberOfRings, int, 0, VTK_INT_MAX);
159 vtkGetMacro(NumberOfRings, int);
161
163
167 void SetAxisLabel(int i, const char*);
168 const char* GetAxisLabel(int i);
171
173
177 void SetAxisRange(int i, double min, double max);
178 void SetAxisRange(int i, double range[2]);
179 void GetAxisRange(int i, double range[2]);
182
184
187 void SetPlotColor(int i, double r, double g, double b);
188 void SetPlotColor(int i, const double color[3])
189 {
190 this->SetPlotColor(i, color[0], color[1], color[2]);
191 }
192 double* GetPlotColor(int i);
194
196
201 vtkSetMacro(LegendVisibility, vtkTypeBool);
202 vtkGetMacro(LegendVisibility, vtkTypeBool);
203 vtkBooleanMacro(LegendVisibility, vtkTypeBool);
205
207
211 vtkGetObjectMacro(LegendActor, vtkLegendBoxActor);
213
215
222
227
234
235protected:
238
239private:
240 vtkSpiderPlotActorConnection* ConnectionHolder;
241
242 int IndependentVariables; // Use column or row
243 vtkTypeBool TitleVisibility; // Should I see the title?
244 char* Title; // The title string
245 vtkTextProperty* TitleTextProperty;
246 vtkTypeBool LabelVisibility;
247 vtkTextProperty* LabelTextProperty;
248 vtkAxisLabelArray* Labels;
249 vtkTypeBool LegendVisibility;
250 vtkNew<vtkLegendBoxActor> LegendActor;
251 vtkGlyphSource2D* GlyphSource;
252 int NumberOfRings;
253
254 // Local variables needed to plot
255 vtkIdType N; // The number of independent variables
256 double* Mins; // Minimum data value along this row/column
257 double* Maxs; // Maximum data value along this row/column
258 vtkAxisRanges* Ranges;
259
260 vtkTextMapper** LabelMappers; // a label for each radial spoke
261 vtkActor2D** LabelActors;
262
263 vtkTextMapper* TitleMapper;
264 vtkActor2D* TitleActor;
265
266 vtkPolyData* WebData; // The web of the spider plot
267 vtkPolyDataMapper2D* WebMapper;
268 vtkActor2D* WebActor;
269
270 vtkPolyData* PlotData; // The lines drawn within the axes
271 vtkPolyDataMapper2D* PlotMapper;
272 vtkActor2D* PlotActor;
273
274 vtkTimeStamp BuildTime;
275
276 double Center[3];
277 double Radius;
278 double Theta;
279
280 int LastPosition[2];
281 int LastPosition2[2];
282 double P1[3];
283 double P2[3];
284
285 void Initialize();
286 int PlaceAxes(vtkViewport* viewport, const int* size);
287 int BuildPlot(vtkViewport*);
288
289 vtkSpiderPlotActor(const vtkSpiderPlotActor&) = delete;
290 void operator=(const vtkSpiderPlotActor&) = delete;
291};
292
293VTK_ABI_NAMESPACE_END
294#endif
Proxy object to connect input/output ports.
Create an axis with tick marks and labels.
general representation of visualization data
create 2D glyphs represented by vtkPolyData
a simple class to control print indentation
Definition vtkIndent.h:29
draw symbols with text
Allocate and hold a VTK object.
Definition vtkNew.h:58
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:72
int GetNumberOfAxisRanges()
Specify the range of data on each radial axis.
void SetIndependentVariablesToRows()
Specify whether to use the rows or columns as independent variables.
int RenderOpaqueGeometry(vtkViewport *) override
Draw the spider plot.
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for type information and printing.
void SetPlotColor(int i, double r, double g, double b)
Specify colors for each plot.
virtual void SetIndependentVariables(int)
Specify whether to use the rows or columns as independent variables.
virtual void SetInputConnection(vtkAlgorithmOutput *)
Set the input to the pie chart actor.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
static vtkSpiderPlotActor * New()
Instantiate this class.
void SetPlotColor(int i, const double color[3])
Specify colors for each plot.
int GetNumberOfAxisLabels()
Specify the names of the radial spokes (i.e., the radial axes).
virtual void SetInputData(vtkDataObject *)
Set the input to the pie chart actor.
virtual vtkDataObject * GetInput()
Get the input data object to this actor.
void GetAxisRange(int i, double range[2])
Specify the range of data on each radial axis.
virtual void SetTitleTextProperty(vtkTextProperty *p)
Set/Get the title text property.
const char * GetAxisLabel(int i)
Specify the names of the radial spokes (i.e., the radial axes).
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
Draw the spider plot.
void SetIndependentVariablesToColumns()
Specify whether to use the rows or columns as independent variables.
~vtkSpiderPlotActor() override
virtual void SetLabelTextProperty(vtkTextProperty *p)
Enable/Disable the creation of a legend.
void SetAxisRange(int i, double range[2])
Specify the range of data on each radial axis.
void SetAxisLabel(int i, const char *)
Specify the names of the radial spokes (i.e., the radial axes).
void SetAxisRange(int i, double min, double max)
Specify the range of data on each radial axis.
int RenderOverlay(vtkViewport *) override
Draw the spider plot.
double * GetPlotColor(int i)
Specify colors for each plot.
2D text annotation
represent text properties.
record modification and/or execution time
abstract specification for Viewports
Definition vtkViewport.h:47
window superclass for vtkRenderWindow
Definition vtkWindow.h:29
int vtkTypeBool
Definition vtkABI.h:64
virtual void Initialize()
#define VTK_IV_ROW
#define VTK_IV_COLUMN
int vtkIdType
Definition vtkType.h:368
#define VTK_INT_MAX
Definition vtkType.h:197
#define VTK_MARSHALSETTER(property)
#define VTK_MARSHALGETTER(property)
#define VTK_MARSHALAUTO
#define max(a, b)