VTK  9.7.1
vtkHandleSource.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
15 #ifndef vtkHandleSource_h
16 #define vtkHandleSource_h
17 
18 #include "vtkFiltersSourcesModule.h" // For export macro
19 #include "vtkPolyDataAlgorithm.h"
20 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
21 
22 VTK_ABI_NAMESPACE_BEGIN
23 class VTKFILTERSSOURCES_EXPORT VTK_MARSHALAUTO vtkHandleSource : public vtkPolyDataAlgorithm
24 {
25 public:
27  void PrintSelf(ostream& os, vtkIndent indent) override;
28 
30 
36  vtkSetMacro(Directional, bool);
37  vtkGetMacro(Directional, bool);
38  vtkBooleanMacro(Directional, bool);
40 
42 
45  void SetPosition(const double pos[3]) { this->SetPosition(pos[0], pos[1], pos[2]); }
46  virtual void SetPosition(double xPos, double yPos, double zPos) = 0;
48 
50 
53  void GetPosition(double pos[3]);
54  virtual double* GetPosition() = 0;
56 
58 
62  void SetDirection(const double dir[3]) { this->SetDirection(dir[0], dir[1], dir[2]); }
63  virtual void SetDirection(double xDir, double yDir, double zDir) = 0;
65 
67 
71  void GetDirection(double dir[3]);
72  virtual double* GetDirection() = 0;
74 
76 
81  vtkSetMacro(Size, double);
82  vtkGetMacro(Size, double);
84 
85  vtkHandleSource(const vtkHandleSource&) = delete;
86  void operator=(const vtkHandleSource&) = delete;
87 
88 protected:
90  ~vtkHandleSource() override = default;
91 
92  // Flag to indicate if the handle should be aware of any direction.
93  bool Directional = false;
94 
95  double Size = 0.5;
96 };
97 
98 VTK_ABI_NAMESPACE_END
99 #endif
interface that can be inherited to define handler sources for any kind of interaction.
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:28
void SetDirection(const double dir[3])
Set the direction of the handle.
void SetPosition(const double pos[3])
Set the position of the handle.
#define VTK_MARSHALAUTO
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.