Salome HOME
Initial version
[modules/gui.git] / src / GLViewer / GLViewer_Selector2d.h
1 // File:      GLViewer_Selector2d.h
2 // Created:   November, 2004
3 // Author:    OCC team
4 // Copyright (C) CEA 2004
5
6 /****************************************************************************
7 **  Class:   GLViewer_Selector2d 
8 **  Descr:   OpenGL Selector 2D
9 **  Module:  GLViewer
10 **  Created: UI team, 20.09.02
11 *****************************************************************************/
12 #ifndef GLVIEWER_SELECTOR2D_H
13 #define GLVIEWER_SELECTOR2D_H
14
15 #ifdef WNT
16 #include "windows.h"
17 #endif
18
19 //#include "QAD.h"
20 #include "GLViewer_Selector.h"
21
22 #include <Quantity_NameOfColor.hxx>
23
24 class GLViewer_Viewer2d;
25 class GLViewer_Context;
26
27 class GLVIEWER_EXPORT GLViewer_Selector2d : public GLViewer_Selector
28 {
29   Q_OBJECT
30
31 public:
32   GLViewer_Selector2d( GLViewer_Viewer2d*, GLViewer_Context* );
33   ~GLViewer_Selector2d();
34
35 public:
36   void            setContext( GLViewer_Context* glc ) { myGLContext = glc; }
37   GLViewer_Context*  getContext() const { return myGLContext; }
38
39   void            setHilightColor( Quantity_NameOfColor );
40   void            setSelectColor( Quantity_NameOfColor );
41
42   void            detect( int, int );
43   void            select( bool append = false );
44   void            select( const QRect&, bool append = false );    
45   void            unselectAll();    
46   int             numSelected() const;    
47
48   void            checkSelection( int, bool, int );
49
50 protected:
51   GLViewer_Context*  myGLContext;
52 };
53
54 #endif