VTK  9.2.6
vtkHandleSource.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHandleSource.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
27 #ifndef vtkHandleSource_h
28 #define vtkHandleSource_h
29 
30 #include "vtkFiltersSourcesModule.h" // For export macro
31 #include "vtkPolyDataAlgorithm.h"
32 
33 class VTKFILTERSSOURCES_EXPORT vtkHandleSource : public vtkPolyDataAlgorithm
34 {
35 public:
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
40 
46  vtkSetMacro(Directional, bool);
47  vtkGetMacro(Directional, bool);
48  vtkBooleanMacro(Directional, bool);
50 
52 
55  void SetPosition(const double pos[3]) { this->SetPosition(pos[0], pos[1], pos[2]); }
56  virtual void SetPosition(double xPos, double yPos, double zPos) = 0;
58 
60 
63  void GetPosition(double pos[3]);
64  virtual double* GetPosition() = 0;
66 
68 
72  void SetDirection(const double dir[3]) { this->SetDirection(dir[0], dir[1], dir[2]); }
73  virtual void SetDirection(double xDir, double yDir, double zDir) = 0;
75 
77 
81  void GetDirection(double dir[3]);
82  virtual double* GetDirection() = 0;
84 
86 
91  vtkSetMacro(Size, double);
92  vtkGetMacro(Size, double);
94 
95  vtkHandleSource(const vtkHandleSource&) = delete;
96  void operator=(const vtkHandleSource&) = delete;
97 
98 protected:
100  virtual ~vtkHandleSource() override = default;
101 
102  // Flag to indicate if the handle should be aware of any direction.
103  bool Directional = false;
104 
105  double Size = 0.5;
106 };
107 
108 #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:39
void SetDirection(const double dir[3])
Set the direction of the handle.
void SetPosition(const double pos[3])
Set the position of the handle.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.