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