Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef GLVIEWER_SELECTOR_H
00028 #define GLVIEWER_SELECTOR_H
00029
00030 #include "GLViewer.h"
00031 #include "GLViewer_Defs.h"
00032
00033 #include <QSize>
00034 #include <QObject>
00035
00036 class QRect;
00037
00038 #include <Quantity_NameOfColor.hxx>
00039
00040 class GLViewer_Viewer;
00041
00046 class GLVIEWER_API GLViewer_Selector : public QObject
00047 {
00048 Q_OBJECT
00049
00050 public:
00051 GLViewer_Selector( GLViewer_Viewer* );
00052 ~GLViewer_Selector();
00053
00054 public:
00056 void lock( bool );
00057 void setMinRectSize( const QSize& minSize );
00058
00060 virtual void detect( int x, int y ) = 0;
00061 virtual void undetectAll() = 0;
00062
00064 virtual void select( bool append = false ) = 0;
00066 virtual void select( const QRect&, bool append = false ) = 0;
00067 virtual void unselectAll() = 0;
00068 virtual int numSelected() const = 0;
00069
00070 virtual void setHilightColor( Quantity_NameOfColor ) = 0;
00071 virtual void setSelectColor( Quantity_NameOfColor ) = 0;
00073
00074 virtual void checkSelection( int, bool, int ) = 0;
00075
00077 static int appendKey() { return apppendKey; }
00078 static void setAppendKey( int k ) { apppendKey = k; }
00079
00080 signals:
00081 void selSelectionCancel();
00082 void selSelectionDone( bool append, SelectionChangeStatus status );
00083
00084 protected:
00085
00086
00087
00088 GLViewer_Viewer* myViewer;
00089 bool myLocked;
00090 QSize myMinRectSize;
00091
00092 private:
00093
00094 static int apppendKey;
00095 };
00096
00097 #endif