VTK  9.7.1
vtkInteractorStyleDrawPolygon.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 vtkInteractorStyleDrawPolygon_h
16 #define vtkInteractorStyleDrawPolygon_h
17 
18 #include "vtkInteractionStyleModule.h" // For export macro
19 #include "vtkInteractorStyle.h"
20 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
21 
22 #include "vtkVector.h" // For Polygon Points
23 #include <vector> // For returning Polygon Points
24 
25 VTK_ABI_NAMESPACE_BEGIN
27 
28 class VTKINTERACTIONSTYLE_EXPORT VTK_MARSHALAUTO vtkInteractorStyleDrawPolygon
29  : public vtkInteractorStyle
30 {
31 public:
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
37 
40  void OnMouseMove() override;
41  void OnLeftButtonDown() override;
42  void OnLeftButtonUp() override;
44 
46 
49  vtkSetMacro(DrawPolygonPixels, bool);
50  vtkGetMacro(DrawPolygonPixels, bool);
51  vtkBooleanMacro(DrawPolygonPixels, bool);
53 
57  std::vector<vtkVector2i> GetPolygonPoints();
58 
59 protected:
62 
63  virtual void DrawPolygon();
64 
65  int StartPosition[2];
66  int EndPosition[2];
67  int Moving;
68 
70 
72 
73 private:
75  void operator=(const vtkInteractorStyleDrawPolygon&) = delete;
76 
77  class vtkInternal;
78  vtkInternal* Internal;
79 };
80 
81 VTK_ABI_NAMESPACE_END
82 #endif
virtual void OnLeftButtonDown()
draw polygon during mouse move
virtual void OnLeftButtonUp()
static vtkInteractorStyle * New()
This class must be supplied with a vtkRenderWindowInteractor wrapper or parent.
a simple class to control print indentation
Definition: vtkIndent.h:28
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
dynamic, self-adjusting array of unsigned char
provide event-driven interface to the rendering window (defines trackball mode)
#define VTK_MARSHALAUTO
virtual void OnMouseMove()
Generic event bindings can be overridden in subclasses.