1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/
19 #if !defined( OCCVIEWER_AISSELECTOR_H )
20 #define OCCVIEWER_AISSELECTOR_H
22 #include "OCCViewer.h"
25 #include <Quantity_NameOfColor.hxx>
26 #include <AIS_InteractiveContext.hxx>
28 class OCCVIEWER_EXPORT OCCViewer_AISSelector : public QObject
34 OCCViewer_AISSelector( QObject* parent, const Handle (AIS_InteractiveContext)& );
36 ~OCCViewer_AISSelector();
38 // enables/disables selection
39 void enableSelection( bool );
40 // enables/disables multiple selection
41 void enableMultipleSelection( bool );
43 // detects the interactive objects at position (x,y).
44 bool moveTo ( int, int, const Handle (V3d_View)& );
45 // selects the objects covered by the rectangle.
46 bool select ( int, int, int, int, const Handle (V3d_View)& );
47 // adds new selected objects covered by the rectangle to the objects
48 // previously selected.
49 bool shiftSelect ( int, int, int, int, const Handle (V3d_View)& );
50 // selects the detected interactive objects.
52 // adds new selected objects to the objects previously selected.
55 // sets the interactive context for this selector
56 void setAISContext ( const Handle (AIS_InteractiveContext)& );
57 // sets the color to hilight the detected objects
58 void setHilightColor ( Quantity_NameOfColor color );
59 // sets the color to display the selected objects
60 void setSelectColor ( Quantity_NameOfColor color );
63 // checks the status of pick and emits 'selSelectionDone' or 'selSelectionCancel'.
64 bool checkSelection ( AIS_StatusOfPick status, bool hadSelection, bool addTo );
67 // 'selection done' signal
68 void selSelectionDone( bool bAdded );
69 // 'selection cancelled' signal
70 void selSelectionCancel( bool bAdded );
73 Handle (AIS_InteractiveContext) myAISContext; // graphic context
74 Quantity_NameOfColor myHilightColor; // color for hilight object
75 Quantity_NameOfColor mySelectColor; // color for selected object
77 int myNumSelected; // nymber of selected objects
78 bool myEnableSelection; // enable selection flag
79 bool myEnableMultipleSelection; // enable multiple selection flag
82 #endif // OCCVIEWER_AISSELECTOR_H