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