]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/CutModule/interface/vtkInteractorStyleCutter.h
5a600bc72e1f483811a64f90ed05950547524bfd
[creaMaracasVisu.git] / lib / maracasVisuLib / src / CutModule / interface / vtkInteractorStyleCutter.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkInteractorStyleCutter.h,v $
5   Language:  C++
6   Date:      $Date: 2010/02/24 14:00:46 $
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   bool Finished();
41   
42   // Description:
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();
48   void VisibilityOff();
49   
50   vtkGetObjectMacro(LoopPoints,vtkPoints);
51   vtkGetVector3Macro(Direction,double);
52   
53 protected:
54   vtkInteractorStyleCutter();
55   ~vtkInteractorStyleCutter();
56
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();
60   void Initialize();  
61
62   int CurrentPosition[2];
63   double Direction[3];
64
65   //Points selected by the user
66   vtkPoints *Points;
67
68   //Current point id:
69   vtkIdType PointID;
70
71   //bool which determine if user has press the left button first
72   int Moving;
73   
74   vtkActor2D    *BboxActor;
75   vtkCellArray  *Lines;
76   vtkPoints             *LoopPoints;
77   bool                  finished;
78   
79 private:
80   vtkInteractorStyleCutter(const vtkInteractorStyleCutter&);  // Not implemented
81   void operator=(const vtkInteractorStyleCutter&);  // Not implemented
82 };
83
84 #endif