OpenStructure
scene_menu.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2020 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_GUI_SCENE_MENU_HH
20 #define OST_GUI_SCENE_MENU_HH
21 
22 
23 #include <ost/mol/atom_handle.hh>
24 #include <ost/gfx/gfx_object_fw.hh>
25 
26 #include <QObject>
27 #include <QPoint>
28 #include <QMenu>
29 #include <QString>
30 namespace ost { namespace gui {
31 
32 class SceneMenu : public QObject{
33  Q_OBJECT
34 public:
36  virtual ~SceneMenu();
37  void SetPickPoint(const QPoint& pos);
38 
39 public slots:
40  void ShowMenu(const QPoint& pos);
43  void SelectLigands();
46  void SelectAtom();
47  void SelectResidue();
48  void Select(const String& str);
49  void UnSelect();
50  void CenterOnAtom();
52  void CenterOnChain();
53  void CenterOnView();
55 
56 private:
57  void PrepareContextMenu(const QPoint& pos);
58  std::pair<gfx::GfxObjP, mol::AtomHandle> picked_;
59  QMenu* context_menu_;
60  QMenu* select_menu_;
61  QMenu* center_menu_;
62 };
63 
64 }} // ns
65 #endif //OST_GUI_SCENE_MENU_HH
void ShowMenu(const QPoint &pos)
void Select(const String &str)
void SetPickPoint(const QPoint &pos)
std::string String
Definition: base.hh:54
Definition: base.dox:1