VTK  9.3.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 
33 VTK_ABI_NAMESPACE_BEGIN
35 
36 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleRubberBand2D : public vtkInteractorStyle
37 {
38 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
43  void OnLeftButtonDown() override;
44  void OnLeftButtonUp() override;
45  void OnMiddleButtonDown() override;
46  void OnMiddleButtonUp() override;
47  void OnRightButtonDown() override;
48  void OnRightButtonUp() override;
49  void OnMouseMove() override;
50  void OnMouseWheelForward() override;
51  void OnMouseWheelBackward() override;
52 
54 
57  vtkSetMacro(RenderOnMouseMove, bool);
58  vtkGetMacro(RenderOnMouseMove, bool);
59  vtkBooleanMacro(RenderOnMouseMove, bool);
61 
65  enum
66  {
67  SELECT_NORMAL = 0,
68  SELECT_UNION = 1
69  };
70 
72 
75  vtkGetMacro(Interaction, int);
77 
78  enum
79  {
83  SELECTING
84  };
85 
87 
92  vtkGetVector2Macro(StartPosition, int);
93  vtkGetVector2Macro(EndPosition, int);
95 
96 protected:
99 
100  // The interaction mode
102 
103  // Draws the selection rubber band
104  void RedrawRubberBand();
105 
106  // The start position of the selection
107  int StartPosition[2];
108 
109  // The end position of the selection
110  int EndPosition[2];
111 
112  // The pixel array for the rubber band
114 
115  // Whether to render when the mouse moves
117 
118 private:
120  void operator=(const vtkInteractorStyleRubberBand2D&) = delete;
121 };
122 
123 VTK_ABI_NAMESPACE_END
124 #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)
virtual void OnMouseMove()
Generic event bindings can be overridden in subclasses.