VTK  9.3.0
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 
21 #include "vtkVector.h" // For Polygon Points
22 #include <vector> // For returning Polygon Points
23 
24 VTK_ABI_NAMESPACE_BEGIN
26 
27 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleDrawPolygon : public vtkInteractorStyle
28 {
29 public:
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
35 
38  void OnMouseMove() override;
39  void OnLeftButtonDown() override;
40  void OnLeftButtonUp() override;
42 
44 
47  vtkSetMacro(DrawPolygonPixels, bool);
48  vtkGetMacro(DrawPolygonPixels, bool);
49  vtkBooleanMacro(DrawPolygonPixels, bool);
51 
55  std::vector<vtkVector2i> GetPolygonPoints();
56 
57 protected:
60 
61  virtual void DrawPolygon();
62 
63  int StartPosition[2];
64  int EndPosition[2];
65  int Moving;
66 
68 
70 
71 private:
73  void operator=(const vtkInteractorStyleDrawPolygon&) = delete;
74 
75  class vtkInternal;
76  vtkInternal* Internal;
77 };
78 
79 VTK_ABI_NAMESPACE_END
80 #endif
a simple class to control print indentation
Definition: vtkIndent.h:38
draw polygon during mouse move
void OnLeftButtonUp() override
Event bindings.
void OnMouseMove() override
Event bindings.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkInteractorStyleDrawPolygon * New()
std::vector< vtkVector2i > GetPolygonPoints()
Get the current polygon points in display units.
~vtkInteractorStyleDrawPolygon() override
void OnLeftButtonDown() override
Event bindings.
provide event-driven interface to the rendering window (defines trackball mode)
dynamic, self-adjusting array of unsigned char