VTK  9.3.20240528
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
25VTK_ABI_NAMESPACE_BEGIN
27
28class VTKINTERACTIONSTYLE_EXPORT VTK_MARSHALAUTO vtkInteractorStyleDrawPolygon
29 : public vtkInteractorStyle
30{
31public:
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
59protected:
62
63 virtual void DrawPolygon();
64
65 int StartPosition[2];
66 int EndPosition[2];
67 int Moving;
68
70
72
73private:
75 void operator=(const vtkInteractorStyleDrawPolygon&) = delete;
76
77 class vtkInternal;
78 vtkInternal* Internal;
79};
80
81VTK_ABI_NAMESPACE_END
82#endif
a simple class to control print indentation
Definition vtkIndent.h:108
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.
std::vector< vtkVector2i > GetPolygonPoints()
Get the current polygon points in display units.
~vtkInteractorStyleDrawPolygon() override
static vtkInteractorStyleDrawPolygon * New()
void OnLeftButtonDown() override
Event bindings.
provide event-driven interface to the rendering window (defines trackball mode)
dynamic, self-adjusting array of unsigned char
#define VTK_MARSHALAUTO