![]() |
Tulip
4.6.0
Better Visualization Through Research
|
00001 /* 00002 * 00003 * This file is part of Tulip (www.tulip-software.org) 00004 * 00005 * Authors: David Auber and the Tulip development Team 00006 * from LaBRI, University of Bordeaux 00007 * 00008 * Tulip is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License 00010 * as published by the Free Software Foundation, either version 3 00011 * of the License, or (at your option) any later version. 00012 * 00013 * Tulip is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 * See the GNU General Public License for more details. 00017 * 00018 */ 00019 ///@cond DOXYGEN_HIDDEN 00020 00021 #ifndef MOUSESELECTION_H 00022 #define MOUSESELECTION_H 00023 00024 #include <tulip/GLInteractor.h> 00025 00026 namespace tlp { 00027 00028 class Graph; 00029 class TLP_QT_SCOPE MouseSelector:public GLInteractorComponent { 00030 public: 00031 enum SelectionMode { 00032 EdgesAndNodes = 0, 00033 EdgesOnly, 00034 NodesOnly 00035 }; 00036 00037 MouseSelector(Qt::MouseButton button = Qt::LeftButton, 00038 Qt::KeyboardModifier modifier = Qt::NoModifier, 00039 SelectionMode mode = EdgesAndNodes); 00040 ~MouseSelector() {} 00041 bool draw(GlMainWidget *); 00042 bool eventFilter(QObject *, QEvent *); 00043 protected: 00044 Qt::MouseButton mButton; 00045 Qt::KeyboardModifier kModifier; 00046 Qt::KeyboardModifiers mousePressModifier; 00047 unsigned int x,y; 00048 int w,h; 00049 bool started; 00050 Graph *graph; 00051 SelectionMode _mode; 00052 }; 00053 00054 00055 } 00056 #endif 00057 ///@endcond