File: vtkHandleSource.h

package info (click to toggle)
vtk9 9.5.2%2Bdfsg3-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 205,916 kB
  • sloc: cpp: 2,336,565; ansic: 327,116; python: 111,200; yacc: 4,104; java: 3,977; sh: 3,032; xml: 2,771; perl: 2,189; lex: 1,787; makefile: 178; javascript: 165; objc: 153; tcl: 59
file content (98 lines) | stat: -rw-r--r-- 2,747 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
// SPDX-License-Identifier: BSD-3-Clause
/**
 * @class   vtkHandleSource
 * @brief   interface that can be inherited to define handler sources for any kind of interaction.
 *
 * vtkHandleSource is a pure abstract class defining an interface for handler sources.
 * Any child of this class is supposed to define an access to its position, size and direction, if
 * any. On this purpose, the internal getters/setters are left to be redefined by the subclasses.
 * It is derived by vtkPointHandleSource for example.
 * @sa
 * vtkPointHandleSource, vtkCameraHandleSource
 */

#ifndef vtkHandleSource_h
#define vtkHandleSource_h

#include "vtkFiltersSourcesModule.h" // For export macro
#include "vtkPolyDataAlgorithm.h"

VTK_ABI_NAMESPACE_BEGIN
class VTKFILTERSSOURCES_EXPORT vtkHandleSource : public vtkPolyDataAlgorithm
{
public:
  vtkTypeMacro(vtkHandleSource, vtkPolyDataAlgorithm);
  void PrintSelf(ostream& os, vtkIndent indent) override;

  ///@{
  /**
   * Set/Get if the handle should take account on this->Direction.
   * The meaning of this direction varies on
   * the subclasses implementation.
   * The default value is false.
   */
  vtkSetMacro(Directional, bool);
  vtkGetMacro(Directional, bool);
  vtkBooleanMacro(Directional, bool);
  ///@}

  ///@{
  /**
   * Set the position of the handle.
   */
  void SetPosition(const double pos[3]) { this->SetPosition(pos[0], pos[1], pos[2]); }
  virtual void SetPosition(double xPos, double yPos, double zPos) = 0;
  ///@}

  ///@{
  /**
   * Get the position of the handle.
   */
  void GetPosition(double pos[3]);
  virtual double* GetPosition() = 0;
  ///@}

  ///@{
  /**
   * Set the direction of the handle.
   * The direction meaning depends on subclasses implementations.
   */
  void SetDirection(const double dir[3]) { this->SetDirection(dir[0], dir[1], dir[2]); }
  virtual void SetDirection(double xDir, double yDir, double zDir) = 0;
  ///@}

  ///@{
  /**
   * Get the direction of the handle.
   * The direction meaning depends on subclasses implementations.
   */
  void GetDirection(double dir[3]);
  virtual double* GetDirection() = 0;
  ///@}

  ///@{
  /**
   * Set/Get the size of the handle.
   * The size use depends on subclasses implementations.
   * The default value is 0.5.
   */
  vtkSetMacro(Size, double);
  vtkGetMacro(Size, double);
  ///@}

  vtkHandleSource(const vtkHandleSource&) = delete;
  void operator=(const vtkHandleSource&) = delete;

protected:
  vtkHandleSource();
  ~vtkHandleSource() override = default;

  // Flag to indicate if the handle should be aware of any direction.
  bool Directional = false;

  double Size = 0.5;
};

VTK_ABI_NAMESPACE_END
#endif