OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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-2011 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);
50  ~SceneWin();
51 
52 signals:
53  void ActiveNodesChanged(gfx::NodePtrList nodes, gfx::EntityP entity, mol::QueryViewWrapperList views);
54  void ActiveNodesChanged();
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 
62  ContextMenu* GetContextMenu();
63 
64 public slots:
65  void OnSelectionChange(const QItemSelection& sel, const QItemSelection& desel);
66 
67  void ContextMenuRequested(const QPoint& pos);
68 
69  SceneWinModel* GetModel() const;
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
pointer_it< T > end(const std::vector< T > &values)
boost::shared_ptr< Entity > EntityP
Definition: entity_fw.hh:27
#define DLLEXPORT_OST_GUI
Base class for widgets.
Definition: widget.hh:40
virtual bool Restore(const QString &prefix)
Definition: scene_win.hh:58
data model for scene win
definition of EntityView
Definition: entity_view.hh:86
std::vector< GfxNodeP > NodePtrList
Definition: gfx_node_fw.hh:34
virtual bool Save(const QString &prefix)
Definition: scene_win.hh:57
std::vector< QueryViewWrapper > QueryViewWrapperList
Definition: view_type_fw.hh:51