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
vtkInteractorStyle.h
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:41
vtkVector.h
vtkInteractorStyleDrawPolygon::PixelArray
vtkUnsignedCharArray * PixelArray
Definition: vtkInteractorStyleDrawPolygon.h:80
vtkInteractorStyle::OnMouseMove
virtual void OnMouseMove()
Generic event bindings can be overridden in subclasses.
Definition: vtkInteractorStyle.h:229
vtkInteractorStyleDrawPolygon
draw polygon during mouse move
Definition: vtkInteractorStyleDrawPolygon.h:38
vtkInteractorStyleDrawPolygon::Moving
int Moving
Definition: vtkInteractorStyleDrawPolygon.h:76
vtkInteractorStyle::OnLeftButtonDown
virtual void OnLeftButtonDown()
Definition: vtkInteractorStyle.h:230
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkInteractorStyle
provide event-driven interface to the rendering window (defines trackball mode)
Definition: vtkInteractorStyle.h:141
vtkInteractorStyle::OnLeftButtonUp
virtual void OnLeftButtonUp()
Definition: vtkInteractorStyle.h:231
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:78