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 =========================================================================*/
24 #ifndef vtkInteractorStyleDrawPolygon_h
25 #define vtkInteractorStyleDrawPolygon_h
26 
27 #include "vtkInteractionStyleModule.h" // For export macro
28 #include "vtkInteractorStyle.h"
29 
30 #include <vector> // For returning Polygon Points
31 #include "vtkVector.h" // For Polygon Points
32 
34 
35 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleDrawPolygon : public vtkInteractorStyle
36 {
37 public:
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 
65 protected:
68 
69  virtual void DrawPolygon();
70 
71  int StartPosition[2];
72  int EndPosition[2];
73  int Moving;
74 
76 
78 
79 private:
81  void operator=(const vtkInteractorStyleDrawPolygon&) = delete;
82 
83  class vtkInternal;
84  vtkInternal* Internal;
85 };
86 
87 #endif
vtkInteractorStyle.h
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:35
vtkVector.h
vtkInteractorStyleDrawPolygon::PixelArray
vtkUnsignedCharArray * PixelArray
Definition: vtkInteractorStyleDrawPolygon.h:77
vtkInteractorStyle::OnMouseMove
virtual void OnMouseMove()
Generic event bindings can be overridden in subclasses.
Definition: vtkInteractorStyle.h:223
vtkInteractorStyleDrawPolygon
draw polygon during mouse move
Definition: vtkInteractorStyleDrawPolygon.h:35
vtkInteractorStyleDrawPolygon::Moving
int Moving
Definition: vtkInteractorStyleDrawPolygon.h:73
vtkInteractorStyle::OnLeftButtonDown
virtual void OnLeftButtonDown()
Definition: vtkInteractorStyle.h:224
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkInteractorStyle
provide event-driven interface to the rendering window (defines trackball mode)
Definition: vtkInteractorStyle.h:135
vtkInteractorStyle::OnLeftButtonUp
virtual void OnLeftButtonUp()
Definition: vtkInteractorStyle.h:225
vtkInteractorStyle::New
static vtkInteractorStyle * New()
This class must be supplied with a vtkRenderWindowInteractor wrapper or parent.
vtkInteractorStyle::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkInteractorStyleDrawPolygon::DrawPolygonPixels
bool DrawPolygonPixels
Definition: vtkInteractorStyleDrawPolygon.h:75