Salome HOME
Moved some functionality to VTKViewer_Utilities.h
[modules/kernel.git] / src / OCCViewer / OCCViewer_AISSelector.h
1 //  SALOME OCCViewer : build OCC Viewer into Salome desktop
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : OCCViewer_AISSelector.h
25 //  Author : Nicolas REJNERI
26 //  Module : SALOME
27 //  $Header$
28
29 #ifndef OCCViewer_AISSELECTOR_H
30 #define OCCViewer_AISSELECTOR_H
31
32 #include "QAD.h"
33
34 // QT Include
35 #include <qobject.h>
36
37 // Open CASCADE Includes
38 #include <Quantity_NameOfColor.hxx>
39 #include <AIS_InteractiveContext.hxx>
40
41 class QAD_EXPORT OCCViewer_AISSelector : public QObject
42 {
43   Q_OBJECT
44
45   void  initialize();
46   void  cleanup();
47
48 public:
49   OCCViewer_AISSelector( const Handle (AIS_InteractiveContext)& );
50   ~OCCViewer_AISSelector();
51
52 public:
53   void  moveTo ( int, int, const Handle (V3d_View)& );
54   void  select ( int, int, int, int, const Handle (V3d_View)& );
55   void  shiftSelect ( int, int, int, int, const Handle (V3d_View)& );
56   void  select ();
57   void  shiftSelect ();
58
59   void  setContext ( const Handle (AIS_InteractiveContext)& );
60   void  setHilightColor ( Quantity_NameOfColor color );
61   void  setSelectColor ( Quantity_NameOfColor color );
62
63   void  enableSelection( bool );
64   void  enableMultipleSelection( bool );
65
66 signals:
67   void  selSelectionDone( bool bAdded );
68   void  selSelectionCancel( bool bAdded );
69
70 protected:
71   void  checkSelection ( int numBefore );
72   int   numSelected() const;
73
74 private:
75   Handle (AIS_InteractiveContext) myAISContext;   // graphic context
76   Quantity_NameOfColor            myHilightColor; // color for hilight object
77   Quantity_NameOfColor            mySelectColor; // color for selected object
78
79   bool                            myEnableSelection;
80   bool                            myEnableMultipleSelection;
81
82 };
83
84 #endif
85