Salome HOME
new files added
[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 "GLViewer_Selector.h"
20
21 #include <Quantity_NameOfColor.hxx>
22
23 class GLViewer_Viewer2d;
24 class GLViewer_Context;
25
26 class GLVIEWER_API GLViewer_Selector2d : public GLViewer_Selector
27 {
28   Q_OBJECT
29
30 public:
31   GLViewer_Selector2d( GLViewer_Viewer2d*, GLViewer_Context* );
32   ~GLViewer_Selector2d();
33
34 public:
35   void            setContext( GLViewer_Context* glc ) { myGLContext = glc; }
36   GLViewer_Context*  getContext() const { return myGLContext; }
37
38   void            setHilightColor( Quantity_NameOfColor );
39   void            setSelectColor( Quantity_NameOfColor );
40
41   void            detect( int, int );
42   void            undetectAll();
43
44   void            select( bool append = false );
45   void            select( const QRect&, bool append = false );    
46   void            unselectAll();    
47   int             numSelected() const;    
48
49   void            checkSelection( int, bool, int );
50
51 protected:
52   GLViewer_Context*  myGLContext;
53 };
54
55 #endif