Back to index

salome-gui  6.5.0
GLViewer_Selector.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  Author : OPEN CASCADE
00024 // File:      GLViewer_Selector.h
00025 // Created:   November, 2004
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 //    void                  setStatus( SelectionChangeStatus theStatus ){ myStatus = theStatus; }
00086 //    SelectionChangeStatus status( return myStatus; }
00087 
00088     GLViewer_Viewer*      myViewer;
00089     bool                  myLocked;
00090     QSize                 myMinRectSize;
00091 
00092 private:
00093 //    SelectionChangeStatus myStatus;
00094     static int            apppendKey;
00095 };
00096 
00097 #endif