VTK  9.7.1
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 
27 VTK_ABI_NAMESPACE_BEGIN
28 
29 class vtkAxisActor2D;
30 class vtkPoints;
31 class vtkTextProperty;
32 
33 class VTKRENDERINGANNOTATION_EXPORT vtkRadialGridActor2D : public vtkActor2D
34 {
35 public:
36  static vtkRadialGridActor2D* New();
38 
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
47  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 
78  void SetTextProperty(vtkTextProperty* property);
79  vtkTextProperty* GetTextProperty();
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 
146  vtkPoints* GetFirstAxesPoints();
147  vtkPoints* GetLastAxesPoints();
149 
150 protected:
152  ~vtkRadialGridActor2D() override;
153 
154 private:
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 
199 VTK_ABI_NAMESPACE_END
200 
201 #endif
vtkTypeBool HasTranslucentPolygonalGeometry() override
No translucent geometry for this actor.
int RenderOverlay(vtkViewport *viewport) override
Support the standard render methods.
#define VTK_DOUBLE_MAX
Definition: vtkType.h:202
abstract specification for Viewports
Definition: vtkViewport.h:46
#define VTK_INT_MAX
Definition: vtkType.h:192
a actor that draws 2D data
Definition: vtkActor2D.h:35
Create an axis with tick marks and labels.
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:64
a simple class to control print indentation
Definition: vtkIndent.h:28
static vtkActor2D * New()
Creates an actor2D with the following defaults: position (0,0) (coordinate system is viewport); at la...
void GetActors2D(vtkPropCollection *pc) override
For some exporters and other other operations we must be able to collect all the actors or volumes...
represent text properties.
int RenderOpaqueGeometry(vtkViewport *) override
Overridden as a no-op.
vtkRadialGridActor2D displays in overlay a list of vtkAxisActor2D sharing a same origin and rotating ...
represent and manipulate 3D points
Definition: vtkPoints.h:30
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeBool HasOpaqueGeometry() override
No opaque geometry for this actor.