VPTissue Reference Manual
PTreePanels.h
Go to the documentation of this file.
1 #ifndef SIMPT_EDITOR_PTREE_PANELS_H_INCLUDED
2 #define SIMPT_EDITOR_PTREE_PANELS_H_INCLUDED
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include "EditControlLogic.h"
23 #include "gui/PTreeContainer.h"
24 
25 #include <boost/property_tree/ptree.hpp>
26 
27 namespace SimPT_Editor {
28 
29 using namespace SimShell;
30 using boost::property_tree::ptree;
31 
35 class PTreePanels : public QWidget
36 {
37  Q_OBJECT
38 public:
40  PTreePanels(QWidget* parent);
41 
43  virtual ~PTreePanels();
44 
46  Gui::PTreeContainer* AttributePanel() const;
47 
49  Gui::PTreeContainer* GeometricPanel() const;
50 
52  void Initialize(std::shared_ptr<EditControlLogic> tissue);
53 
55  Gui::PTreeContainer* ParametersPanel() const;
56 
57 private slots:
62  void ApplyAttributePanel(const boost::property_tree::ptree& pt);
63 
68  void ApplyGeometricPanel(const boost::property_tree::ptree& pt);
69 
74  void ApplyParametersPanel(const boost::property_tree::ptree& pt);
75 
80  void ToggleAttributePanel(bool toggled);
81 
86  void ToggleGeometricPanel(bool toggled);
87 
92  void ToggleParametersPanel(bool toggled);
93 
95  void UpdateGeometricPanel();
96 
100  void UpdateParametersPanel();
101 
103  void UpdatePanels();
104 
105 private:
114  ptree MergeJoin(ptree pt1, ptree pt2);
115 
121  ptree SetDataToUnknown(const ptree& pt);
122 
124  void UpdateAttributePanel();
125 private:
126  Gui::PTreeContainer* m_attribute_panel;
127  bool m_attribute_panel_toggled;
128  Gui::PTreeContainer* m_geometric_panel;
129  bool m_geometric_panel_toggled;
130  std::shared_ptr<EditControlLogic> m_tissue;
131  Gui::PTreeContainer* m_parameters_panel;
132  bool m_parameters_panel_toggled;
133 };
134 
135 } // namespace
136 
137 #endif // end_of_include_guard
Namespace for SimPT tissue editor package.
Definition: Cell.h:32
Manages the attribute and geometric ptree panel for a given tissue.
Definition: PTreePanels.h:35
see the online Qt documentation
Namespace for generic graphical shell for simulators.
Definition: SimSession.h:32
Interface for LeafControlLogic.
Interface for PTreeContainer.
For a given ptree, constructs PTreeMenu, QDockWidget, PTreeEditorWindow.