VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 -------------------------------------------------------------------------*/
42 #ifndef __vtkInteractorStyleRubberBand2D_h
43 #define __vtkInteractorStyleRubberBand2D_h
44 
45 #include "vtkInteractionStyleModule.h" // For export macro
46 #include "vtkInteractorStyle.h"
47 
48 class vtkUnsignedCharArray;
49 
50 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleRubberBand2D : public vtkInteractorStyle
51 {
52 public:
53  static vtkInteractorStyleRubberBand2D *New();
54  vtkTypeMacro(vtkInteractorStyleRubberBand2D, vtkInteractorStyle);
55  void PrintSelf(ostream& os, vtkIndent indent);
56 
57  virtual void OnLeftButtonDown();
58  virtual void OnLeftButtonUp();
59  virtual void OnMiddleButtonDown();
60  virtual void OnMiddleButtonUp();
61  virtual void OnRightButtonDown();
62  virtual void OnRightButtonUp();
63  virtual void OnMouseMove();
64  virtual void OnMouseWheelForward();
65  virtual void OnMouseWheelBackward();
66 
68 
69  vtkSetMacro(RenderOnMouseMove, bool);
70  vtkGetMacro(RenderOnMouseMove, bool);
71  vtkBooleanMacro(RenderOnMouseMove, bool);
73 
74  //BTX
76 
77  enum
78  {
79  SELECT_NORMAL = 0,
80  SELECT_UNION = 1
81  };
82  //ETX
84 
86 
87  vtkGetMacro(Interaction, int);
89 
90  //BTX
91  enum
92  {
96  SELECTING
97  };
98  //ETX
99 
101 
105  vtkGetVector2Macro(StartPosition,int);
106  vtkGetVector2Macro(EndPosition,int);
108 
109 protected:
112 
113  // The interaction mode
115 
116  // Draws the selection rubber band
117  void RedrawRubberBand();
118 
119  // The end position of the selection
120  int StartPosition[2];
121 
122  // The start position of the selection
123  int EndPosition[2];
124 
125  // The pixel array for the rubber band
126  vtkUnsignedCharArray* PixelArray;
127 
128  // Whether to render when the mouse moves
130 
131 private:
133  void operator=(const vtkInteractorStyleRubberBand2D&); // Not implemented
134 };
135 
136 #endif
A rubber band interactor for a 2D view.