1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkInteractorStyleCutter.h,v $
6 Date: $Date: 2009/05/14 13:54:57 $
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);
42 // Event bindings controlling the effects of pressing mouse buttons
43 // or moving the mouse.
44 virtual void OnMouseMove();
45 virtual void OnLeftButtonDown();
46 virtual void OnRightButtonDown();
49 vtkGetObjectMacro(LoopPoints,vtkPoints);
50 vtkGetVector3Macro(Direction,double);
53 vtkInteractorStyleCutter();
54 ~vtkInteractorStyleCutter();
56 //This method is designed for vtkImplicitSelectionLoop where the loop
57 //should not be closed, the function is virtual to override this behavior
58 virtual void EndLoop();
61 int CurrentPosition[2];
64 //Points selected by the user
70 //bool which determine if user has press the left button first
73 vtkActor2D *BboxActor;
75 vtkPoints *LoopPoints;
78 vtkInteractorStyleCutter(const vtkInteractorStyleCutter&); // Not implemented
79 void operator=(const vtkInteractorStyleCutter&); // Not implemented