]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyleCutter.h
creaMaracasVisu Library
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / vtkInteractorStyleCutter.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkInteractorStyleCutter.h,v $
5   Language:  C++
6   Date:      $Date: 2008/10/31 16:32:41 $
7   Version:   $Revision: 1.1 $
8
9   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
10   All rights reserved.
11   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
12
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.
16
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.  
22
23 #ifndef __vtkInteractorStyleCutter_h
24 #define __vtkInteractorStyleCutter_h
25
26 #include <vtkInteractorStyle.h>
27
28 class vtkPoints;
29 class vtkActor2D;
30 class vtkCellArray;
31
32 class vtkInteractorStyleCutter : public vtkInteractorStyle
33 {
34 public:
35   // Description:
36   // Instantiate the object.
37   static vtkInteractorStyleCutter *New();
38   vtkTypeRevisionMacro(vtkInteractorStyleCutter, vtkInteractorStyle);
39   void PrintSelf(ostream& os, vtkIndent indent);
40   
41   // Description:
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();
47   void VisibilityOff();
48   
49   vtkGetObjectMacro(LoopPoints,vtkPoints);
50   vtkGetVector3Macro(Direction,double);
51   
52 protected:
53   vtkInteractorStyleCutter();
54   ~vtkInteractorStyleCutter();
55
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();
59   void Initialize();
60
61   int CurrentPosition[2];
62   double Direction[3];
63
64   //Points selected by the user
65   vtkPoints *Points;
66
67   //Current point id:
68   vtkIdType PointID;
69
70   //bool which determine if user has press the left button first
71   int Moving;
72   
73   vtkActor2D    *BboxActor;
74   vtkCellArray  *Lines;
75   vtkPoints             *LoopPoints;
76   
77 private:
78   vtkInteractorStyleCutter(const vtkInteractorStyleCutter&);  // Not implemented
79   void operator=(const vtkInteractorStyleCutter&);  // Not implemented
80 };
81
82 #endif