VTK
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 <vector> // For returning Polygon Points
34 #include "vtkVector.h" // For Polygon Points
35 
37 
38 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleDrawPolygon : public vtkInteractorStyle
39 {
40 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
46 
49  void OnMouseMove() override;
50  void OnLeftButtonDown() override;
51  void OnLeftButtonUp() override;
53 
55 
58  vtkSetMacro(DrawPolygonPixels, bool);
59  vtkGetMacro(DrawPolygonPixels, bool);
60  vtkBooleanMacro(DrawPolygonPixels, bool);
62 
66  std::vector<vtkVector2i> GetPolygonPoints();
67 
68 protected:
71 
72  virtual void DrawPolygon();
73 
74  int StartPosition[2];
75  int EndPosition[2];
76  int Moving;
77 
79 
81 
82 private:
84  void operator=(const vtkInteractorStyleDrawPolygon&) = delete;
85 
86  class vtkInternal;
87  vtkInternal* Internal;
88 };
89 
90 #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:39
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)
virtual void OnMouseMove()
Generic event bindings can be overridden in subclasses.