Salome HOME
Moved some functionality to VTKViewer_Utilities.h
[modules/kernel.git] / src / OCCViewer / OCCViewer_AISSelector.h
index d1b17c15be1f991e59bf223e9c20fca973e3f875..8a7bd6524810ab460fa48a2080f8c368e103498e 100644 (file)
@@ -1,23 +1,44 @@
-//  File      : OCCViewer_AISSelector.h
-//  Created   : Wed Mar 20 10:58:22 2002
-//  Author    : Nicolas REJNERI
-//  Project   : SALOME
-//  Module    : OCCViewer
-//  Copyright : Open CASCADE 2002
+//  SALOME OCCViewer : build OCC Viewer into Salome desktop
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+//
+//
+//
+//  File   : OCCViewer_AISSelector.h
+//  Author : Nicolas REJNERI
+//  Module : SALOME
 //  $Header$
 
-
 #ifndef OCCViewer_AISSELECTOR_H
 #define OCCViewer_AISSELECTOR_H
 
 #include "QAD.h"
-#include "OCCViewer_Selector.h"
+
+// QT Include
+#include <qobject.h>
 
 // Open CASCADE Includes
 #include <Quantity_NameOfColor.hxx>
 #include <AIS_InteractiveContext.hxx>
 
-class QAD_EXPORT OCCViewer_AISSelector : public OCCViewer_Selector
+class QAD_EXPORT OCCViewer_AISSelector : public QObject
 {
   Q_OBJECT
 
@@ -29,24 +50,35 @@ public:
   ~OCCViewer_AISSelector();
 
 public:
-  bool moveTo ( int, int, const Handle (V3d_View)& );
-  bool select ( int, int, int, int, const Handle (V3d_View)& );
-  bool shiftSelect ( int, int, int, int, const Handle (V3d_View)& );
-  bool select ();
-  bool shiftSelect ();
+  void moveTo ( int, int, const Handle (V3d_View)& );
+  void select ( int, int, int, int, const Handle (V3d_View)& );
+  void shiftSelect ( int, int, int, int, const Handle (V3d_View)& );
+  void select ();
+  void shiftSelect ();
 
   void setContext ( const Handle (AIS_InteractiveContext)& );
   void setHilightColor ( Quantity_NameOfColor color );
   void setSelectColor ( Quantity_NameOfColor color );
 
-protected:
-  bool checkSelection ( AIS_StatusOfPick status, bool hadSelection, bool addTo );
+  void enableSelection( bool );
+  void enableMultipleSelection( bool );
+
+signals:
+  void selSelectionDone( bool bAdded );
+  void selSelectionCancel( bool bAdded );
 
 protected:
+  void checkSelection ( int numBefore );
+  int   numSelected() const;
+
+private:
   Handle (AIS_InteractiveContext) myAISContext;          // graphic context
   Quantity_NameOfColor           myHilightColor; // color for hilight object
   Quantity_NameOfColor           mySelectColor; // color for selected object
 
+  bool                           myEnableSelection;
+  bool                           myEnableMultipleSelection;
+
 };
 
 #endif