VTK  9.7.1
vtkInteractorStyleRubberBand2D.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
27 #ifndef vtkInteractorStyleRubberBand2D_h
28 #define vtkInteractorStyleRubberBand2D_h
29 
30 #include "vtkInteractionStyleModule.h" // For export macro
31 #include "vtkInteractorStyle.h"
32 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
33 
34 VTK_ABI_NAMESPACE_BEGIN
36 
37 class VTKINTERACTIONSTYLE_EXPORT VTK_MARSHALAUTO vtkInteractorStyleRubberBand2D
38  : public vtkInteractorStyle
39 {
40 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
45  void OnLeftButtonDown() override;
46  void OnLeftButtonUp() override;
47  void OnMiddleButtonDown() override;
48  void OnMiddleButtonUp() override;
49  void OnRightButtonDown() override;
50  void OnRightButtonUp() override;
51  void OnMouseMove() override;
52  void OnMouseWheelForward() override;
53  void OnMouseWheelBackward() override;
54 
56 
59  vtkSetMacro(RenderOnMouseMove, bool);
60  vtkGetMacro(RenderOnMouseMove, bool);
61  vtkBooleanMacro(RenderOnMouseMove, bool);
63 
67  enum
68  {
69  SELECT_NORMAL = 0,
70  SELECT_UNION = 1
71  };
72 
74 
77  vtkGetMacro(Interaction, int);
79 
80  enum
81  {
85  SELECTING
86  };
87 
89 
94  vtkGetVector2Macro(StartPosition, int);
95  vtkGetVector2Macro(EndPosition, int);
97 
98 protected:
100  ~vtkInteractorStyleRubberBand2D() override;
101 
102  // The interaction mode
104 
105  // Draws the selection rubber band
106  void RedrawRubberBand();
107 
108  // The start position of the selection
109  int StartPosition[2];
110 
111  // The end position of the selection
112  int EndPosition[2];
113 
114  // The pixel array for the rubber band
116 
117  // Whether to render when the mouse moves
119 
120 private:
122  void operator=(const vtkInteractorStyleRubberBand2D&) = delete;
123 };
124 
125 VTK_ABI_NAMESPACE_END
126 #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:28
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)
#define VTK_MARSHALAUTO
virtual void OnMouseMove()
Generic event bindings can be overridden in subclasses.