VTK  9.2.6
vtkInteractorStyleRubberBand2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkInteractorStyleRubberBand2D.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 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
43 #ifndef vtkInteractorStyleRubberBand2D_h
44 #define vtkInteractorStyleRubberBand2D_h
45 
46 #include "vtkInteractionStyleModule.h" // For export macro
47 #include "vtkInteractorStyle.h"
48 
50 
51 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleRubberBand2D : public vtkInteractorStyle
52 {
53 public:
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
58  void OnLeftButtonDown() override;
59  void OnLeftButtonUp() override;
60  void OnMiddleButtonDown() override;
61  void OnMiddleButtonUp() override;
62  void OnRightButtonDown() override;
63  void OnRightButtonUp() override;
64  void OnMouseMove() override;
65  void OnMouseWheelForward() override;
66  void OnMouseWheelBackward() override;
67 
69 
72  vtkSetMacro(RenderOnMouseMove, bool);
73  vtkGetMacro(RenderOnMouseMove, bool);
74  vtkBooleanMacro(RenderOnMouseMove, bool);
76 
80  enum
81  {
82  SELECT_NORMAL = 0,
83  SELECT_UNION = 1
84  };
85 
87 
90  vtkGetMacro(Interaction, int);
92 
93  enum
94  {
98  SELECTING
99  };
100 
102 
107  vtkGetVector2Macro(StartPosition, int);
108  vtkGetVector2Macro(EndPosition, int);
110 
111 protected:
113  ~vtkInteractorStyleRubberBand2D() override;
114 
115  // The interaction mode
117 
118  // Draws the selection rubber band
119  void RedrawRubberBand();
120 
121  // The start position of the selection
122  int StartPosition[2];
123 
124  // The end position of the selection
125  int EndPosition[2];
126 
127  // The pixel array for the rubber band
129 
130  // Whether to render when the mouse moves
132 
133 private:
135  void operator=(const vtkInteractorStyleRubberBand2D&) = delete;
136 };
137 
138 #endif
virtual void OnLeftButtonDown()
virtual void OnMiddleButtonDown()
virtual void OnRightButtonDown()
virtual void OnLeftButtonUp()
static vtkInteractorStyle * New()
This class must be supplied with a vtkRenderWindowInteractor wrapper or parent.
virtual void OnMiddleButtonUp()
A rubber band interactor for a 2D view.
virtual void OnMouseWheelForward()
virtual void OnRightButtonUp()
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void OnMouseWheelBackward()
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.