VTK
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 -------------------------------------------------------------------------*/
40 #ifndef vtkInteractorStyleRubberBand2D_h
41 #define vtkInteractorStyleRubberBand2D_h
42 
43 #include "vtkInteractionStyleModule.h" // For export macro
44 #include "vtkInteractorStyle.h"
45 
47 
48 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleRubberBand2D : public vtkInteractorStyle
49 {
50 public:
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
55  void OnLeftButtonDown() override;
56  void OnLeftButtonUp() override;
57  void OnMiddleButtonDown() override;
58  void OnMiddleButtonUp() override;
59  void OnRightButtonDown() override;
60  void OnRightButtonUp() override;
61  void OnMouseMove() override;
62  void OnMouseWheelForward() override;
63  void OnMouseWheelBackward() override;
64 
66 
69  vtkSetMacro(RenderOnMouseMove, bool);
70  vtkGetMacro(RenderOnMouseMove, bool);
71  vtkBooleanMacro(RenderOnMouseMove, bool);
73 
77  enum
78  {
79  SELECT_NORMAL = 0,
80  SELECT_UNION = 1
81  };
82 
84 
87  vtkGetMacro(Interaction, int);
89 
90  enum
91  {
95  SELECTING
96  };
97 
99 
104  vtkGetVector2Macro(StartPosition,int);
105  vtkGetVector2Macro(EndPosition,int);
107 
108 protected:
110  ~vtkInteractorStyleRubberBand2D() override;
111 
112  // The interaction mode
114 
115  // Draws the selection rubber band
116  void RedrawRubberBand();
117 
118  // The start position of the selection
119  int StartPosition[2];
120 
121  // The end position of the selection
122  int EndPosition[2];
123 
124  // The pixel array for the rubber band
126 
127  // Whether to render when the mouse moves
129 
130 private:
132  void operator=(const vtkInteractorStyleRubberBand2D&) = delete;
133 };
134 
135 #endif
vtkInteractorStyleRubberBand2D::PixelArray
vtkUnsignedCharArray * PixelArray
Definition: vtkInteractorStyleRubberBand2D.h:125
vtkInteractorStyle.h
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:41
vtkInteractorStyleRubberBand2D
A rubber band interactor for a 2D view.
Definition: vtkInteractorStyleRubberBand2D.h:48
vtkInteractorStyle::OnMiddleButtonUp
virtual void OnMiddleButtonUp()
Definition: vtkInteractorStyle.h:233
vtkInteractorStyleRubberBand2D::RenderOnMouseMove
bool RenderOnMouseMove
Definition: vtkInteractorStyleRubberBand2D.h:128
vtkInteractorStyle::OnMouseMove
virtual void OnMouseMove()
Generic event bindings can be overridden in subclasses.
Definition: vtkInteractorStyle.h:229
vtkInteractorStyle::OnMiddleButtonDown
virtual void OnMiddleButtonDown()
Definition: vtkInteractorStyle.h:232
vtkInteractorStyle::OnRightButtonDown
virtual void OnRightButtonDown()
Definition: vtkInteractorStyle.h:234
vtkInteractorStyle::OnMouseWheelForward
virtual void OnMouseWheelForward()
Definition: vtkInteractorStyle.h:236
vtkInteractorStyle::OnLeftButtonDown
virtual void OnLeftButtonDown()
Definition: vtkInteractorStyle.h:230
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkInteractorStyleRubberBand2D::NONE
Definition: vtkInteractorStyleRubberBand2D.h:92
vtkInteractorStyle
provide event-driven interface to the rendering window (defines trackball mode)
Definition: vtkInteractorStyle.h:141
vtkInteractorStyle::OnMouseWheelBackward
virtual void OnMouseWheelBackward()
Definition: vtkInteractorStyle.h:237
vtkInteractorStyle::OnLeftButtonUp
virtual void OnLeftButtonUp()
Definition: vtkInteractorStyle.h:231
vtkInteractorStyleRubberBand2D::ZOOMING
Definition: vtkInteractorStyleRubberBand2D.h:94
vtkInteractorStyleRubberBand2D::PANNING
Definition: vtkInteractorStyleRubberBand2D.h:93
vtkInteractorStyle::New
static vtkInteractorStyle * New()
This class must be supplied with a vtkRenderWindowInteractor wrapper or parent.
vtkInteractorStyleRubberBand2D::Interaction
int Interaction
Definition: vtkInteractorStyleRubberBand2D.h:113
vtkInteractorStyle::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkInteractorStyle::OnRightButtonUp
virtual void OnRightButtonUp()
Definition: vtkInteractorStyle.h:235