VTK  9.3.0
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 
21 VTK_ABI_NAMESPACE_BEGIN
22 class VTKFILTERSSOURCES_EXPORT vtkHandleSource : public vtkPolyDataAlgorithm
23 {
24 public:
26  void PrintSelf(ostream& os, vtkIndent indent) override;
27 
29 
35  vtkSetMacro(Directional, bool);
36  vtkGetMacro(Directional, bool);
37  vtkBooleanMacro(Directional, bool);
39 
41 
44  void SetPosition(const double pos[3]) { this->SetPosition(pos[0], pos[1], pos[2]); }
45  virtual void SetPosition(double xPos, double yPos, double zPos) = 0;
47 
49 
52  void GetPosition(double pos[3]);
53  virtual double* GetPosition() = 0;
55 
57 
61  void SetDirection(const double dir[3]) { this->SetDirection(dir[0], dir[1], dir[2]); }
62  virtual void SetDirection(double xDir, double yDir, double zDir) = 0;
64 
66 
70  void GetDirection(double dir[3]);
71  virtual double* GetDirection() = 0;
73 
75 
80  vtkSetMacro(Size, double);
81  vtkGetMacro(Size, double);
83 
84  vtkHandleSource(const vtkHandleSource&) = delete;
85  void operator=(const vtkHandleSource&) = delete;
86 
87 protected:
89  ~vtkHandleSource() override = default;
90 
91  // Flag to indicate if the handle should be aware of any direction.
92  bool Directional = false;
93 
94  double Size = 0.5;
95 };
96 
97 VTK_ABI_NAMESPACE_END
98 #endif
interface that can be inherited to define handler sources for any kind of interaction.
void operator=(const vtkHandleSource &)=delete
void GetDirection(double dir[3])
Get the direction of the handle.
virtual double * GetPosition()=0
Get the position of the handle.
void GetPosition(double pos[3])
Get the position of the handle.
void SetPosition(const double pos[3])
Set the position of the handle.
vtkHandleSource(const vtkHandleSource &)=delete
void SetDirection(const double dir[3])
Set the direction of the handle.
virtual void SetPosition(double xPos, double yPos, double zPos)=0
Set the position of the handle.
virtual void SetDirection(double xDir, double yDir, double zDir)=0
Set the direction of the handle.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkHandleSource() override=default
virtual double * GetDirection()=0
Get the direction of the handle.
a simple class to control print indentation
Definition: vtkIndent.h:38
Superclass for algorithms that produce only polydata as output.
@ dir
Definition: vtkX3D.h:324