1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkInteractorStyleCutter.h,v $
6 Date: $Date: 2010/02/24 14:00:46 $
7 Version: $Revision: 1.1 $
9 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
11 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notice for more information.
17 =========================================================================*/
18 // .NAME vtkInteractorStyleCutter -
19 // .SECTION Description
20 // This interactor style allows the user to draw a rectangle in the render
21 // window using the left mouse button.
23 #ifndef __vtkInteractorStyleCutter_h
24 #define __vtkInteractorStyleCutter_h
26 #include <vtkInteractorStyle.h>
32 class vtkInteractorStyleCutter : public vtkInteractorStyle
36 // Instantiate the object.
37 static vtkInteractorStyleCutter *New();
38 vtkTypeRevisionMacro(vtkInteractorStyleCutter, vtkInteractorStyle);
39 void PrintSelf(ostream& os, vtkIndent indent);
43 // Event bindings controlling the effects of pressing mouse buttons
44 // or moving the mouse.
45 virtual void OnMouseMove();
46 virtual void OnLeftButtonDown();
47 virtual void OnRightButtonDown();
50 vtkGetObjectMacro(LoopPoints,vtkPoints);
51 vtkGetVector3Macro(Direction,double);
54 vtkInteractorStyleCutter();
55 ~vtkInteractorStyleCutter();
57 //This method is designed for vtkImplicitSelectionLoop where the loop
58 //should not be closed, the function is virtual to override this behavior
59 virtual void EndLoop();
62 int CurrentPosition[2];
65 //Points selected by the user
71 //bool which determine if user has press the left button first
74 vtkActor2D *BboxActor;
76 vtkPoints *LoopPoints;
80 vtkInteractorStyleCutter(const vtkInteractorStyleCutter&); // Not implemented
81 void operator=(const vtkInteractorStyleCutter&); // Not implemented