1 // File: GLViewer_Selector.h
2 // Created: November, 2004
4 // Copyright (C) CEA 2004
6 /****************************************************************************
7 ** Class: GLViewer_Selector
8 ** Descr: Base class for object selection in QAD-based application
10 ** Created: UI team, 22.09.00
11 *****************************************************************************/
12 #ifndef GLVIEWER_SELECTOR_H
13 #define GLVIEWER_SELECTOR_H
16 #include "GLViewer_Defs.h"
21 #include <Quantity_NameOfColor.hxx>
23 class GLViewer_Viewer;
25 /*! Class GLViewer_Selector
26 * Based select manager for GLViewer
29 class GLVIEWER_API GLViewer_Selector : public QObject
34 GLViewer_Selector( GLViewer_Viewer* );
38 //! Sets lock status (enable/disable interavtive)
40 void setMinRectSize( const QSize& minSize );
42 //! Highlights in point (x,y)
43 virtual void detect( int x, int y ) = 0;
44 virtual void undetectAll() = 0;
46 //! Selects highlight objects
47 virtual void select( bool append = false ) = 0;
49 virtual void select( const QRect&, bool append = false ) = 0;
50 virtual void unselectAll() = 0;
51 virtual int numSelected() const = 0;
53 virtual void setHilightColor( Quantity_NameOfColor ) = 0;
54 virtual void setSelectColor( Quantity_NameOfColor ) = 0;
55 //!Checks selection state and emits 'selSelectionDone' or 'selSelectionCancel'
56 /*!Should be called by after non-interactive selection. */
57 virtual void checkSelection( int, bool, int ) = 0;
59 /*! Sets/returns the key for appending selected objects ( SHIFT by default ) */
60 static int appendKey() { return apppendKey; }
61 static void setAppendKey( int k ) { apppendKey = k; }
64 void selSelectionCancel();
65 void selSelectionDone( bool append, SelectionChangeStatus status );
68 // void setStatus( SelectionChangeStatus theStatus ){ myStatus = theStatus; }
69 // SelectionChangeStatus status( return myStatus; }
71 GLViewer_Viewer* myViewer;
76 // SelectionChangeStatus myStatus;
77 static int apppendKey;