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 #ifndef GLVIEWER_SELECTOR_H
26 #define GLVIEWER_SELECTOR_H
29 #include "GLViewer_Defs.h"
34 #include <Quantity_NameOfColor.hxx>
36 class GLViewer_Viewer;
39 \Class GLViewer_Selector
40 Base class for object selection in SUIT-based application
42 class GLVIEWER_API GLViewer_Selector : public QObject
47 GLViewer_Selector( GLViewer_Viewer* );
51 //! Sets lock status (enable/disable interavtive)
53 void setMinRectSize( const QSize& minSize );
55 //! Highlights in point (x,y)
56 virtual void detect( int x, int y ) = 0;
57 virtual void undetectAll() = 0;
59 //! Selects highlight objects
60 virtual void select( bool append = false ) = 0;
62 virtual void select( const QRect&, bool append = false ) = 0;
63 virtual void unselectAll() = 0;
64 virtual int numSelected() const = 0;
66 virtual void setHilightColor( Quantity_NameOfColor ) = 0;
67 virtual void setSelectColor( Quantity_NameOfColor ) = 0;
68 //!Checks selection state and emits 'selSelectionDone' or 'selSelectionCancel'
69 /*!Should be called by after non-interactive selection. */
70 virtual void checkSelection( int, bool, int ) = 0;
72 /*! Sets/returns the key for appending selected objects ( SHIFT by default ) */
73 static int appendKey() { return apppendKey; }
74 static void setAppendKey( int k ) { apppendKey = k; }
77 void selSelectionCancel();
78 void selSelectionDone( bool append, SelectionChangeStatus status );
81 // void setStatus( SelectionChangeStatus theStatus ){ myStatus = theStatus; }
82 // SelectionChangeStatus status( return myStatus; }
84 GLViewer_Viewer* myViewer;
89 // SelectionChangeStatus myStatus;
90 static int apppendKey;