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) VTK_OVERRIDE;
41 
43 
46  void OnMouseMove() VTK_OVERRIDE;
47  void OnLeftButtonDown() VTK_OVERRIDE;
48  void OnLeftButtonUp() VTK_OVERRIDE;
50 
52 
55  vtkSetMacro(DrawPolygonPixels, bool);
56  vtkGetMacro(DrawPolygonPixels, bool);
57  vtkBooleanMacro(DrawPolygonPixels, bool);
59 
63  std::vector<vtkVector2i> GetPolygonPoints();
64 
65 protected:
67  ~vtkInteractorStyleDrawPolygon() VTK_OVERRIDE;
68 
69  virtual void DrawPolygon();
70 
71  int StartPosition[2];
72  int EndPosition[2];
73  int Moving;
74 
75  bool DrawPolygonPixels;
76 
77  vtkUnsignedCharArray *PixelArray;
78 
79 private:
80  vtkInteractorStyleDrawPolygon(const vtkInteractorStyleDrawPolygon&) VTK_DELETE_FUNCTION;
81  void operator=(const vtkInteractorStyleDrawPolygon&) VTK_DELETE_FUNCTION;
82 
83  class vtkInternal;
84  vtkInternal* Internal;
85 };
86 
87 #endif
draw polygon during mouse move
static vtkInteractorStyle * New()
This class must be supplied with a vtkRenderWindowInteractor wrapper or parent.
a simple class to control print indentation
Definition: vtkIndent.h:33
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:324
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
dynamic, self-adjusting array of unsigned char
provide event-driven interface to the rendering window (defines trackball mode)
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
virtual void OnMouseMove()
Generic event bindings can be overridden in subclasses.