VPTissue Reference Manual
RootViewerNode.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2016 Universiteit Antwerpen
3  *
4  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
5  * the European Commission - subsequent versions of the EUPL (the "Licence");
6  * You may not use this work except in compliance with the Licence.
7  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the Licence is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the Licence for the specific language governing
13  * permissions and limitations under the Licence.
14  */
20 #include "RootViewerNode.h"
21 
22 #include "viewers/Hdf5Viewer.h"
23 #include "viewers/LogViewer.h"
25 #include "viewers/QtViewer.h"
26 #include "viewers/XmlViewer.h"
28 #include "sim/CoupledSim.h"
29 #include "viewer/SubjectNode.h"
30 #include "viewer/ViewerNode.h"
31 
32 namespace SimShell { namespace Ws { class MergedPreferences; } }
33 
34 using namespace std;
35 using namespace SimShell::Viewer;
36 
37 namespace SimShell {
38 namespace Viewer {
39 
40 template class SubjectNode<SimPT_Sim::Sim>;
41 
42 template <>
44 {
45  static const bool value = true;
46 };
47 
48 template <>
50 {
51  static const bool value = true;
52 
53 };
54 
55 } // namespace Viewer
56 } // namespace SimShell
57 
58 
59 namespace SimPT_Shell {
60 namespace Viewer {
61 
62 template <typename SubjectType>
63 RootViewerNode<SubjectType>::RootViewerNode(std::shared_ptr<SimShell::Ws::MergedPreferences> p,
64  std::shared_ptr<SubjectType> subject,
66  : SubjectNode<SubjectType>(p, subject,
67  {
68  {"HDF5 File Viewer",
69  make_shared<ViewerNode<Hdf5Viewer, SubjectType>>(p->GetChild("hdf5"))},
70  {"Log Console",
71  make_shared<ViewerNode<LogViewer, SubjectType>>(p->GetChild("log"))},
72  {"Log Dock Window",
73  make_shared<ViewerNode<LogWindowViewer, SubjectType>>(p->GetChild("logwindow"), a)},
74  {"Qt Window",
75  make_shared<ViewerNode<QtViewer, SubjectType>>(p->GetChild("qt"), a)},
76  {"XML File Viewer",
77  make_shared<ViewerNode<XmlViewer, SubjectType>>(p->GetChild("xml"))}
78  })
79 {
80 }
81 
82 template <>
83 RootViewerNode<SimPT_Sim::CoupledSim>::RootViewerNode(std::shared_ptr<SimShell::Ws::MergedPreferences> p,
84  std::shared_ptr<SimPT_Sim::CoupledSim> subject,
87  { // Children viewer nodes
88  {"Log Dock Window",
89  make_shared<ViewerNode<LogWindowViewer, SimPT_Sim::CoupledSim>>(p->GetChild("logwindow"), a)}
90  })
91 {
92 }
93 
94 // Explicit template instantiations
95 template class RootViewerNode<SimPT_Sim::Sim>;
97 
98 } // namespace
99 } // namespace
Namespace for viewer classes.
Interface for Log Viewer.
STL namespace.
AppController header.
Interface for SubjectNode.
Interface for XmlViewer.
Viewer node that acts as the root of the tree of viewers.
Namespace for SimPT shell package.
Definition: Client.cpp:50
Interface for Hdf5Viewer.
Interface for ViewerNode.
Header for LogWindowViewer.
Interface for RootViewerNode.
Interface for QtViewer.
Namespace for generic graphical shell for simulators.
Definition: SimSession.h:32
A viewer node that does not represent a viewer at all.
Definition: SubjectNode.h:41
Interface for CoupledSim.