Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/gui.git] / src / GLViewer / GLViewer_Selector2d.h
1 //  Copyright (C) 2005 OPEN CASCADE
2 //
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.
7 //
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.
12 //
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
16 //
17 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
18 //
19 //  Author : OPEN CASCADE
20 //
21
22 // File:      GLViewer_Selector2d.h
23 // Created:   November, 2004
24
25 #ifndef GLVIEWER_SELECTOR2D_H
26 #define GLVIEWER_SELECTOR2D_H
27
28 #ifdef WNT
29 #include "windows.h"
30 #endif
31
32 #include "GLViewer_Selector.h"
33
34 #include <Quantity_NameOfColor.hxx>
35
36 class GLViewer_Viewer2d;
37 class GLViewer_Context;
38
39 /*!
40   \class GLViewer_Selector2d 
41   2D select manager for GLViewer
42 */
43 class GLVIEWER_API GLViewer_Selector2d : public GLViewer_Selector
44 {
45   Q_OBJECT
46
47 public:
48   GLViewer_Selector2d( GLViewer_Viewer2d*, GLViewer_Context* );
49   ~GLViewer_Selector2d();
50
51 public:
52   //! Sets context from Viewer2d
53   void                    setContext( GLViewer_Context* glc ) { myGLContext = glc; }
54   GLViewer_Context*       getContext() const { return myGLContext; }
55
56   // Redefined methods
57   virtual void            setHilightColor( Quantity_NameOfColor );
58   virtual void            setSelectColor( Quantity_NameOfColor );
59
60   virtual void            detect( int, int );
61   virtual void            undetectAll();
62
63   virtual void            select( bool append = false );
64   virtual void            select( const QRect&, bool append = false );    
65   virtual void            unselectAll();    
66   virtual int             numSelected() const;    
67
68   virtual void            checkSelection( int, bool, int );
69
70 protected:
71   GLViewer_Context*       myGLContext;
72 };
73
74 #endif