VTK  9.2.20230528
vtkInteractorStyleDrawPolygon.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkInteractorStyleDrawPolygon.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 vtkInteractorStyleDrawPolygon_h
28 #define vtkInteractorStyleDrawPolygon_h
29 
30 #include "vtkInteractionStyleModule.h" // For export macro
31 #include "vtkInteractorStyle.h"
32 
33 #include "vtkVector.h" // For Polygon Points
34 #include <vector> // For returning Polygon Points
35 
36 VTK_ABI_NAMESPACE_BEGIN
38 
39 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleDrawPolygon : public vtkInteractorStyle
40 {
41 public:
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
47 
50  void OnMouseMove() override;
51  void OnLeftButtonDown() override;
52  void OnLeftButtonUp() override;
54 
56 
59  vtkSetMacro(DrawPolygonPixels, bool);
60  vtkGetMacro(DrawPolygonPixels, bool);
61  vtkBooleanMacro(DrawPolygonPixels, bool);
63 
67  std::vector<vtkVector2i> GetPolygonPoints();
68 
69 protected:
72 
73  virtual void DrawPolygon();
74 
75  int StartPosition[2];
76  int EndPosition[2];
77  int Moving;
78 
80 
82 
83 private:
85  void operator=(const vtkInteractorStyleDrawPolygon&) = delete;
86 
87  class vtkInternal;
88  vtkInternal* Internal;
89 };
90 
91 VTK_ABI_NAMESPACE_END
92 #endif
a simple class to control print indentation
Definition: vtkIndent.h:120
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