VTK  9.4.20241221
vtkRadialGridActor2D.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
16#ifndef vtkRadialGridActor2D_h
17#define vtkRadialGridActor2D_h
18
19#include "vtkActor2D.h"
20#include "vtkRenderingAnnotationModule.h" // For export macro
21
22#include "vtkSetGet.h" // for macros
23#include "vtkSmartPointer.h" // for smart pointer
24
25#include <vector>
26
27VTK_ABI_NAMESPACE_BEGIN
28
29class vtkAxisActor2D;
30class vtkPoints;
31class vtkTextProperty;
32
33class VTKRENDERINGANNOTATION_EXPORT vtkRadialGridActor2D : public vtkActor2D
34{
35public:
38
42 void PrintSelf(ostream& os, vtkIndent indent) override;
43
48 int RenderOverlay(vtkViewport* viewport) override;
49
54 int RenderOpaqueGeometry(vtkViewport*) override { return 1; }
55
60 vtkTypeBool HasOpaqueGeometry() override { return 0; }
61
68
72 void GetActors2D(vtkPropCollection* pc) override;
73
75
81
83
87 vtkSetClampMacro(NumberOfAxes, int, 0, VTK_INT_MAX);
88 vtkGetMacro(NumberOfAxes, int);
90
92
99 vtkSetMacro(StartAngle, double);
100 vtkGetMacro(StartAngle, double);
102
104
111 vtkSetMacro(EndAngle, double);
112 vtkGetMacro(EndAngle, double);
114
116
120 vtkSetVector2Macro(Origin, double);
121 vtkGetVector2Macro(Origin, double);
123
125
129 vtkSetClampMacro(NumberOfTicks, int, 2, VTK_INT_MAX);
130 vtkGetMacro(NumberOfTicks, int);
132
134
138 vtkSetClampMacro(AxesViewportLength, double, 2, VTK_DOUBLE_MAX);
139 vtkGetMacro(AxesViewportLength, double);
141
143
149
150protected:
153
154private:
156 void operator=(const vtkRadialGridActor2D&) = delete;
157
161 void ComputeAxisRelativeEndPosition(int index, double position[2]);
162
166 double GetAxisAngle(int index);
167
172 void ComputeAxisWorldRange(vtkViewport* viewport, vtkAxisActor2D* axis, double range[2]);
173
177 void UpdateAxisTitle(vtkAxisActor2D* axis, double angle);
178
183 void SetupAxes(vtkViewport* viewport);
184
185 std::vector<vtkSmartPointer<vtkAxisActor2D>> Axes;
186
187 int NumberOfAxes = 6;
188 int NumberOfTicks = 6;
189 double StartAngle = 0.;
190 double EndAngle = 90.;
191 // relative display coordinates
192 double Origin[2] = { 0.5, 0.5 };
193 // display coordinantes
194 double AxesViewportLength = 100;
195
197};
198
199VTK_ABI_NAMESPACE_END
200
201#endif
a actor that draws 2D data
Definition vtkActor2D.h:145
Create an axis with tick marks and labels.
a simple class to control print indentation
Definition vtkIndent.h:108
represent and manipulate 3D points
Definition vtkPoints.h:139
an ordered list of Props
vtkRadialGridActor2D displays in overlay a list of vtkAxisActor2D sharing a same origin and rotating ...
vtkPoints * GetFirstAxesPoints()
Get the first/last axes points.
static vtkRadialGridActor2D * New()
vtkTypeBool HasOpaqueGeometry() override
No opaque geometry for this actor.
void PrintSelf(ostream &os, vtkIndent indent) override
Print own members and call Superclass.
vtkTypeBool HasTranslucentPolygonalGeometry() override
No translucent geometry for this actor.
vtkPoints * GetLastAxesPoints()
Get the first/last axes points.
int RenderOpaqueGeometry(vtkViewport *) override
Overriden as a no-op.
vtkTextProperty * GetTextProperty()
Set/Get a text property on the underlying axes labels.
int RenderOverlay(vtkViewport *viewport) override
Standard render methods.
void GetActors2D(vtkPropCollection *pc) override
Append the underlying 2D actors to the collection.
void SetTextProperty(vtkTextProperty *property)
Set/Get a text property on the underlying axes labels.
~vtkRadialGridActor2D() override
Hold a reference to a vtkObjectBase instance.
represent text properties.
abstract specification for Viewports
Definition vtkViewport.h:65
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DOUBLE_MAX
Definition vtkType.h:154
#define VTK_INT_MAX
Definition vtkType.h:144