1 // Copyright (C) 2005 OPEN CASCADE
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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
19 // Author : OPEN CASCADE
22 // File: GLViewer_Selector.h
23 // Created: November, 2004
25 /****************************************************************************
26 ** Class: GLViewer_Selector
27 ** Descr: Base class for object selection in QAD-based application
29 ** Created: UI team, 22.09.00
30 *****************************************************************************/
31 #ifndef GLVIEWER_SELECTOR_H
32 #define GLVIEWER_SELECTOR_H
35 #include "GLViewer_Defs.h"
40 #include <Quantity_NameOfColor.hxx>
42 class GLViewer_Viewer;
44 /*! Class GLViewer_Selector
45 * Based select manager for GLViewer
48 class GLVIEWER_API GLViewer_Selector : public QObject
53 GLViewer_Selector( GLViewer_Viewer* );
57 //! Sets lock status (enable/disable interavtive)
59 void setMinRectSize( const QSize& minSize );
61 //! Highlights in point (x,y)
62 virtual void detect( int x, int y ) = 0;
63 virtual void undetectAll() = 0;
65 //! Selects highlight objects
66 virtual void select( bool append = false ) = 0;
68 virtual void select( const QRect&, bool append = false ) = 0;
69 virtual void unselectAll() = 0;
70 virtual int numSelected() const = 0;
72 virtual void setHilightColor( Quantity_NameOfColor ) = 0;
73 virtual void setSelectColor( Quantity_NameOfColor ) = 0;
74 //!Checks selection state and emits 'selSelectionDone' or 'selSelectionCancel'
75 /*!Should be called by after non-interactive selection. */
76 virtual void checkSelection( int, bool, int ) = 0;
78 /*! Sets/returns the key for appending selected objects ( SHIFT by default ) */
79 static int appendKey() { return apppendKey; }
80 static void setAppendKey( int k ) { apppendKey = k; }
83 void selSelectionCancel();
84 void selSelectionDone( bool append, SelectionChangeStatus status );
87 // void setStatus( SelectionChangeStatus theStatus ){ myStatus = theStatus; }
88 // SelectionChangeStatus status( return myStatus; }
90 GLViewer_Viewer* myViewer;
95 // SelectionChangeStatus myStatus;
96 static int apppendKey;