Salome HOME
new files added
[modules/gui.git] / src / GLViewer / GLViewer_Selector.cxx
1 // File:      GLViewer_Selector.cxx
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
13 //#include <GLViewerAfx.h>
14 #include "GLViewer_Selector.h"
15
16 #include "GLViewer_Viewer.h"
17
18 int GLViewer_Selector::apppendKey = Qt::ShiftButton;
19
20 /*!
21     Constructor
22 */
23 GLViewer_Selector::GLViewer_Selector( GLViewer_Viewer* viewer )
24 : QObject( 0 ),
25 myViewer( viewer ),
26 myLocked( false ),
27 myMinRectSize( 1, 1 )
28 {
29 }
30
31 /*!
32     Destructor
33 */
34 GLViewer_Selector::~GLViewer_Selector()
35 {
36 }
37
38 /*!
39     Sets the min size of rectangle to treat it as a rectangle for multiple
40     selection( sensitivity ). If a rectangle size is less than that min size,
41     the right-bottom point of the rectangle will be used for single selection.
42     The default min size is ( 1,1 ). [ public ]
43 */
44 void GLViewer_Selector::setMinRectSize( const QSize& minSize )
45 {
46     myMinRectSize = minSize;
47 }
48
49 /*!
50     Locks / unlocks the selector. If locked, nothing can be selected
51     regadless of the selection mode. [ public ]
52 */
53 void GLViewer_Selector::lock( bool locked )
54 {
55     myLocked = locked;
56 }