VTK  9.1.0
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=========================================================================*/
24#ifndef vtkInteractorStyleDrawPolygon_h
25#define vtkInteractorStyleDrawPolygon_h
26
27#include "vtkInteractionStyleModule.h" // For export macro
28#include "vtkInteractorStyle.h"
29
30#include "vtkVector.h" // For Polygon Points
31#include <vector> // For returning Polygon Points
32
34
35class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleDrawPolygon : public vtkInteractorStyle
36{
37public:
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41
43
46 void OnMouseMove() override;
47 void OnLeftButtonDown() override;
48 void OnLeftButtonUp() override;
50
52
55 vtkSetMacro(DrawPolygonPixels, bool);
56 vtkGetMacro(DrawPolygonPixels, bool);
57 vtkBooleanMacro(DrawPolygonPixels, bool);
59
63 std::vector<vtkVector2i> GetPolygonPoints();
64
65protected:
68
69 virtual void DrawPolygon();
70
71 int StartPosition[2];
72 int EndPosition[2];
73 int Moving;
74
76
78
79private:
81 void operator=(const vtkInteractorStyleDrawPolygon&) = delete;
82
83 class vtkInternal;
84 vtkInternal* Internal;
85};
86
87#endif
a simple class to control print indentation
Definition: vtkIndent.h:113
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.
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