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_Selector2d.h
23 // Created: November, 2004
25 /****************************************************************************
26 ** Class: GLViewer_Selector2d
27 ** Descr: OpenGL Selector 2D
29 ** Created: UI team, 20.09.02
30 *****************************************************************************/
31 #ifndef GLVIEWER_SELECTOR2D_H
32 #define GLVIEWER_SELECTOR2D_H
38 #include "GLViewer_Selector.h"
40 #include <Quantity_NameOfColor.hxx>
42 class GLViewer_Viewer2d;
43 class GLViewer_Context;
45 /*! Class GLViewer_Selector2d
46 * 2D select manager for GLViewer
48 class GLVIEWER_API GLViewer_Selector2d : public GLViewer_Selector
53 GLViewer_Selector2d( GLViewer_Viewer2d*, GLViewer_Context* );
54 ~GLViewer_Selector2d();
57 //! Sets context from Viewer2d
58 void setContext( GLViewer_Context* glc ) { myGLContext = glc; }
59 GLViewer_Context* getContext() const { return myGLContext; }
62 virtual void setHilightColor( Quantity_NameOfColor );
63 virtual void setSelectColor( Quantity_NameOfColor );
65 virtual void detect( int, int );
66 virtual void undetectAll();
68 virtual void select( bool append = false );
69 virtual void select( const QRect&, bool append = false );
70 virtual void unselectAll();
71 virtual int numSelected() const;
73 virtual void checkSelection( int, bool, int );
76 GLViewer_Context* myGLContext;