OpenStructure
scene_win.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_WIN_SCENE_WIN_HH
20 #define OST_GUI_SCENE_WIN_SCENE_WIN_HH
21 
22 
24 
25 #include <ost/gfx/gfx_node_fw.hh>
26 #include <ost/gfx/entity_fw.hh>
27 
28 #include <ost/gui/module_config.hh>
29 #include <ost/gui/widget.hh>
30 
31 #include <QTreeView>
32 #include <QItemSelection>
33 
34 
35 /*
36  Authors: Marco Biasini, Ansgar Philippsen, Stefan Scheuber
37 */
38 
39 namespace ost { namespace gui {
40 
41 class SceneWinModel;
42 class ContextMenu;
43 
44 // the display window for all graphical objects
46 {
47  Q_OBJECT;
48 public:
49  SceneWin(QWidget* parent=NULL);
51 
52 signals:
55 
56 public:
57  virtual bool Save(const QString& prefix) { return true; }
58  virtual bool Restore(const QString& prefix) { return true; }
59 
60  void AddView(gfx::EntityP entity, mol::EntityView view);
61 
63 
64 public slots:
65  void OnSelectionChange(const QItemSelection& sel, const QItemSelection& desel);
66 
67  void ContextMenuRequested(const QPoint& pos);
68 
70 
71  void Update();
72 
73 private slots:
74  void RowsInserted(const QModelIndex & parent, int start, int end);
75  void DoubleClicked(const QModelIndex & index);
76 
77 private:
78  SceneWinModel* model_;
79  QTreeView* view_;
80  ContextMenu* context_menu_;
81 };
82 
83 }} // ns
84 
85 #endif
void AddView(gfx::EntityP entity, mol::EntityView view)
virtual bool Save(const QString &prefix)
Definition: scene_win.hh:57
void OnSelectionChange(const QItemSelection &sel, const QItemSelection &desel)
SceneWinModel * GetModel() const
SceneWin(QWidget *parent=NULL)
virtual bool Restore(const QString &prefix)
Definition: scene_win.hh:58
void ActiveNodesChanged(gfx::NodePtrList nodes, gfx::EntityP entity, mol::QueryViewWrapperList views)
ContextMenu * GetContextMenu()
void ContextMenuRequested(const QPoint &pos)
data model for scene win
Base class for widgets.
Definition: widget.hh:40
definition of EntityView
Definition: entity_view.hh:86
#define DLLEXPORT_OST_GUI
std::vector< GfxNodeP > NodePtrList
Definition: gfx_node_fw.hh:34
boost::shared_ptr< Entity > EntityP
Definition: entity_fw.hh:27
pointer_it< T > end(const std::vector< T > &values)
std::vector< QueryViewWrapper > QueryViewWrapperList
Definition: view_type_fw.hh:51
Definition: base.dox:1