1 // Copyright (C) 2007-2023 CEA, EDF, 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, or (at your option) any later version.
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
23 #if !defined( OCCVIEWER_AISSELECTOR_H )
24 #define OCCVIEWER_AISSELECTOR_H
26 #include "OCCViewer.h"
29 #include <Quantity_NameOfColor.hxx>
30 #include <AIS_InteractiveContext.hxx>
32 class OCCVIEWER_EXPORT OCCViewer_AISSelector : public QObject
38 OCCViewer_AISSelector( QObject* parent, const Handle (AIS_InteractiveContext)& );
40 ~OCCViewer_AISSelector();
42 // enables/disables selection
43 void enableSelection( bool );
44 // enables/disables multiple selection
45 void enableMultipleSelection( bool );
47 // detects the interactive objects at position (x,y).
48 bool moveTo ( int, int, const Handle (V3d_View)& );
49 // selects the objects covered by the rectangle.
50 bool select ( int, int, int, int, const Handle (V3d_View)& );
51 // adds new selected objects covered by the rectangle to the objects
52 // previously selected.
53 bool shiftSelect ( int, int, int, int, const Handle (V3d_View)& );
54 // selects the detected interactive objects.
56 // adds new selected objects to the objects previously selected.
59 // sets the interactive context for this selector
60 void setAISContext ( const Handle (AIS_InteractiveContext)& );
61 // sets the color to hilight the detected objects
62 void setHilightColor ( Quantity_NameOfColor color );
63 // sets the color to display the selected objects
64 void setSelectColor ( Quantity_NameOfColor color );
67 // checks the status of pick and emits 'selSelectionDone' or 'selSelectionCancel'.
68 bool checkSelection ( AIS_StatusOfPick status, bool hadSelection, bool addTo );
71 // 'selection done' signal
72 void selSelectionDone( bool bAdded );
73 // 'selection cancelled' signal
74 void selSelectionCancel( bool bAdded );
77 Handle (AIS_InteractiveContext) myAISContext; // graphic context
78 Quantity_NameOfColor myHilightColor; // color for hilight object
79 Quantity_NameOfColor mySelectColor; // color for selected object
81 int myNumSelected; // nymber of selected objects
82 bool myEnableSelection; // enable selection flag
83 bool myEnableMultipleSelection; // enable multiple selection flag
86 #endif // OCCVIEWER_AISSELECTOR_H