1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #if !defined( OCCVIEWER_AISSELECTOR_H )
23 #define OCCVIEWER_AISSELECTOR_H
25 #include "OCCViewer.h"
28 #include <Quantity_NameOfColor.hxx>
29 #include <AIS_InteractiveContext.hxx>
31 class OCCVIEWER_EXPORT OCCViewer_AISSelector : public QObject
37 OCCViewer_AISSelector( QObject* parent, const Handle (AIS_InteractiveContext)& );
39 ~OCCViewer_AISSelector();
41 // enables/disables selection
42 void enableSelection( bool );
43 // enables/disables multiple selection
44 void enableMultipleSelection( bool );
46 // detects the interactive objects at position (x,y).
47 bool moveTo ( int, int, const Handle (V3d_View)& );
48 // selects the objects covered by the rectangle.
49 bool select ( int, int, int, int, const Handle (V3d_View)& );
50 // adds new selected objects covered by the rectangle to the objects
51 // previously selected.
52 bool shiftSelect ( int, int, int, int, const Handle (V3d_View)& );
53 // selects the detected interactive objects.
55 // adds new selected objects to the objects previously selected.
58 // sets the interactive context for this selector
59 void setAISContext ( const Handle (AIS_InteractiveContext)& );
60 // sets the color to hilight the detected objects
61 void setHilightColor ( Quantity_NameOfColor color );
62 // sets the color to display the selected objects
63 void setSelectColor ( Quantity_NameOfColor color );
66 // checks the status of pick and emits 'selSelectionDone' or 'selSelectionCancel'.
67 bool checkSelection ( AIS_StatusOfPick status, bool hadSelection, bool addTo );
70 // 'selection done' signal
71 void selSelectionDone( bool bAdded );
72 // 'selection cancelled' signal
73 void selSelectionCancel( bool bAdded );
76 Handle (AIS_InteractiveContext) myAISContext; // graphic context
77 Quantity_NameOfColor myHilightColor; // color for hilight object
78 Quantity_NameOfColor mySelectColor; // color for selected object
80 int myNumSelected; // nymber of selected objects
81 bool myEnableSelection; // enable selection flag
82 bool myEnableMultipleSelection; // enable multiple selection flag
85 #endif // OCCVIEWER_AISSELECTOR_H