Salome HOME
new files added
[modules/gui.git] / src / GLViewer / GLViewer_Selector.h
1 // File:      GLViewer_Selector.h
2 // Created:   November, 2004
3 // Author:    OCC team
4 // Copyright (C) CEA 2004
5
6 /****************************************************************************
7 **  Class:   GLViewer_Selector
8 **  Descr:   Base class for object selection in QAD-based application
9 **  Module:  GLViewer
10 **  Created: UI team, 22.09.00
11 *****************************************************************************/
12 #ifndef GLVIEWER_SELECTOR_H
13 #define GLVIEWER_SELECTOR_H
14
15 #include "GLViewer.h"
16 #include "GLViewer_Defs.h"
17
18 #include <qsize.h>
19 #include <qobject.h>
20
21 #include <Quantity_NameOfColor.hxx>
22
23 class GLViewer_Viewer;
24
25 class GLVIEWER_API GLViewer_Selector : public QObject
26 {
27     Q_OBJECT
28
29 public:
30     GLViewer_Selector( GLViewer_Viewer* );
31     ~GLViewer_Selector();
32
33 public:
34     void                  lock( bool );
35     void                  setMinRectSize( const QSize& minSize );
36
37     virtual void          detect( int, int ) = 0;
38     virtual void          undetectAll() = 0;
39
40     virtual void          select( bool append = false ) = 0;
41     virtual void          select( const QRect&, bool append = false ) = 0;
42     virtual void          unselectAll() = 0;
43     virtual int           numSelected() const = 0;
44
45     virtual void          setHilightColor( Quantity_NameOfColor ) = 0;
46     virtual void          setSelectColor( Quantity_NameOfColor ) = 0;
47
48     virtual void          checkSelection( int, bool, int ) = 0;
49
50     /*! Sets/returns the key for appending selected objects ( SHIFT by default ) */
51     static int            appendKey() { return apppendKey; }
52     static void           setAppendKey( int k ) { apppendKey = k; }
53
54 signals:
55     void                  selSelectionCancel();
56     void                  selSelectionDone( bool append, SelectionChangeStatus status );
57
58 protected:
59 //    void                  setStatus( SelectionChangeStatus theStatus ){ myStatus = theStatus; }
60 //    SelectionChangeStatus status( return myStatus; }
61
62     GLViewer_Viewer*      myViewer;
63     bool                  myLocked;
64     QSize                 myMinRectSize;
65
66 private:
67 //    SelectionChangeStatus myStatus;
68     static int            apppendKey;
69 };
70
71 #endif