RemoteGuiVisitors.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package robdekon
17  * @author Christoph Pohl ( christoph dot pohl at kit dot edu )
18  * @date 07.09.22
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 #include <experimental/memory>
26 
28 
30 
31 namespace armarx::RemoteGui
32 {
33  namespace detail
34  {
35  class GroupBoxBuilder;
36  }
37  class TabProxy;
38 
39  class ValueVariant;
40 
41  using ValueMap = std::map<std::string, ValueVariant>;
42 } // namespace armarx::RemoteGui
43 
45 {
46 
48  {
49  public:
50  explicit MakeConfigGuiVisitor(const std::string& name);
51 
52  void visitObjectOnEnter(DataInput&, TypeInput&) override;
53 
54  void visitObjectOnExit(DataInput&, TypeInput&) override;
55 
56  void visitListOnEnter(DataInput&, TypeInput&) override;
57 
58  void visitListOnExit(DataInput&, TypeInput&) override;
59 
60  void visitDictOnEnter(DataInput&, TypeInput&) override;
61 
62  void visitDictOnExit(DataInput&, TypeInput&) override;
63 
64  void visitInt(DataInput&, TypeInput&) override;
65 
66  void visitIntEnum(DataInput&, TypeInput&) override;
67 
68  void visitFloat(DataInput&, TypeInput&) override;
69 
70  void visitDouble(DataInput&, TypeInput&) override;
71 
72  void visitBool(DataInput&, TypeInput&) override;
73 
74  void visitString(DataInput&, TypeInput&) override;
75 
76  void visitQuaternion(DataInput& input, TypeInput& typeInput) override;
77 
78  void visitMatrix(DataInput& input, TypeInput& typeInput) override;
79 
81 
82  private:
83  std::shared_ptr<RemoteGui::detail::GroupBoxBuilder> builder_;
84  std::vector<std::shared_ptr<RemoteGui::detail::GroupBoxBuilder>> group_hierarchy_;
85  std::atomic_bool in_list_{false};
86  };
87 
89  public aron::data::RecursiveTypedVisitor<data::VariantPtr, const type::VariantPtr>
90  {
91  public:
93 
95 
97 
99 
101 
103 
105 
106  void visitListOnEnter(DataInput&, TypeInput&) override;
107 
108  void visitListOnExit(DataInput&, TypeInput&) override;
109 
110  void visitDictOnEnter(DataInput&, TypeInput&) override;
111 
112  void visitDictOnExit(DataInput&, TypeInput&) override;
113 
114  void visitInt(DataInput&, TypeInput&) override;
115 
116  void visitIntEnum(DataInput&, TypeInput&) override;
117 
118  void visitFloat(DataInput&, TypeInput&) override;
119 
120  void visitDouble(DataInput&, TypeInput&) override;
121 
122  void visitBool(DataInput&, TypeInput&) override;
123 
124  void visitString(DataInput&, TypeInput&) override;
125  void visitMatrix(DataInput& elementData, TypeInput& elementType) override;
126  void visitQuaternion(DataInput& elementData, TypeInput& elementType) override;
127 
128  bool tabRebuildRequired() const;
129 
130  private:
132  bool in_list_{false};
133  bool tab_rebuild_required_{false};
134  };
135 
136 } // namespace armarx::aron::component_config
armarx::RemoteGui::detail::GroupBoxBuilder
Definition: LayoutWidgets.h:166
armarx::aron::component_config::GetValueFromMapVisitor::visitIntEnum
void visitIntEnum(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:488
armarx::aron::component_config::MakeConfigGuiVisitor::visitObjectOnEnter
void visitObjectOnEnter(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:48
armarx::aron::component_config::MakeConfigGuiVisitor::visitQuaternion
void visitQuaternion(DataInput &input, TypeInput &typeInput) override
Definition: RemoteGuiVisitors.cpp:274
armarx::aron::component_config::GetValueFromMapVisitor::getObjectElements
MapElements getObjectElements(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:458
armarx::aron::component_config
Definition: PropertyDefinitionVisitors.cpp:50
armarx::aron::component_config::MakeConfigGuiVisitor::MakeConfigGuiVisitor
MakeConfigGuiVisitor(const std::string &name)
Definition: RemoteGuiVisitors.cpp:155
armarx::aron::component_config::MakeConfigGuiVisitor::visitDictOnEnter
void visitDictOnEnter(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:297
armarx::RemoteGui
Definition: LightweightRemoteGuiComponentPlugin.h:30
armarx::aron::component_config::MakeConfigGuiVisitor::visitString
void visitString(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:142
armarx::aron::component_config::GetValueFromMapVisitor::visitDouble
void visitDouble(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:388
armarx::aron::component_config::MakeConfigGuiVisitor::visitListOnEnter
void visitListOnEnter(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:167
armarx::aron::component_config::GetValueFromMapVisitor::visitInt
void visitInt(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:346
armarx::aron::component_config::MakeConfigGuiVisitor::getGroupBoxBuilder
RemoteGui::detail::GroupBoxBuilder getGroupBoxBuilder() const
Definition: RemoteGuiVisitors.cpp:161
armarx::aron::data::RecursiveTypedVisitor< data::VariantPtr, const type::VariantPtr >::MapElements
std::map< std::string, std::pair< DataInputNonConst, TypeInputNonConst > > MapElements
Definition: RecursiveVisitor.h:86
detail
Definition: OpenCVUtil.cpp:127
armarx::aron::component_config::GetValueFromMapVisitor::visitMatrix
void visitMatrix(DataInput &elementData, TypeInput &elementType) override
Definition: RemoteGuiVisitors.cpp:572
armarx::aron::component_config::MakeConfigGuiVisitor::visitInt
void visitInt(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:77
armarx::aron::component_config::GetValueFromMapVisitor::visitListOnExit
void visitListOnExit(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:548
armarx::aron::component_config::GetValueFromMapVisitor::getPairElements
PairElements getPairElements(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:476
armarx::aron::component_config::GetValueFromMapVisitor::GetValueFromMapVisitor
GetValueFromMapVisitor(armarx::RemoteGui::TabProxy *proxy)
Definition: RemoteGuiVisitors.cpp:340
armarx::aron::component_config::MakeConfigGuiVisitor::visitDouble
void visitDouble(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:111
armarx::aron::component_config::GetValueFromMapVisitor::visitBool
void visitBool(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:410
armarx::aron::data::RecursiveTypedVisitor< data::VariantPtr, const type::VariantPtr >::PairElements
std::pair< std::pair< DataInputNonConst, TypeInputNonConst >, std::pair< DataInputNonConst, TypeInputNonConst > > PairElements
Definition: RecursiveVisitor.h:88
armarx::aron::component_config::GetValueFromMapVisitor
Definition: RemoteGuiVisitors.h:88
armarx::aron::component_config::GetValueFromMapVisitor::visitDictOnExit
void visitDictOnExit(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:719
std::experimental::fundamentals_v2::observer_ptr
Definition: ManagedIceObject.h:53
armarx::RemoteGui::ValueMap
std::map< std::string, ValueVariant > ValueMap
Definition: RemoteGuiVisitors.h:41
armarx::aron::component_config::GetValueFromMapVisitor::getDictElements
MapElements getDictElements(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:464
armarx::aron::component_config::GetValueFromMapVisitor::visitQuaternion
void visitQuaternion(DataInput &elementData, TypeInput &elementType) override
Definition: RemoteGuiVisitors.cpp:623
armarx::aron::data::RecursiveTypedVisitor
Definition: RecursiveVisitor.h:78
armarx::RemoteGui::TabProxy
Definition: WidgetProxy.h:17
armarx::aron::component_config::GetValueFromMapVisitor::tabRebuildRequired
bool tabRebuildRequired() const
Definition: RemoteGuiVisitors.cpp:566
armarx::aron::data::RecursiveTypedVisitor< const data::VariantPtr, const type::VariantPtr >::TypeInput
typename TypedVisitorBase< const data::VariantPtr, const type::VariantPtr >::TypeInput TypeInput
Definition: RecursiveVisitor.h:81
armarx::aron::input
ReaderT::InputType & input
Definition: rw.h:19
armarx::aron::component_config::MakeConfigGuiVisitor::visitMatrix
void visitMatrix(DataInput &input, TypeInput &typeInput) override
Definition: RemoteGuiVisitors.cpp:246
armarx::aron::component_config::MakeConfigGuiVisitor
Definition: RemoteGuiVisitors.h:47
armarx::aron::component_config::GetValueFromMapVisitor::visitListOnEnter
void visitListOnEnter(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:511
armarx::aron::component_config::GetValueFromMapVisitor::visitString
void visitString(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:431
armarx::aron::component_config::MakeConfigGuiVisitor::visitIntEnum
void visitIntEnum(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:229
armarx::aron::data::RecursiveTypedVisitor< const data::VariantPtr, const type::VariantPtr >::DataInput
typename TypedVisitorBase< const data::VariantPtr, const type::VariantPtr >::DataInput DataInput
Definition: RecursiveVisitor.h:80
armarx::aron::component_config::MakeConfigGuiVisitor::visitDictOnExit
void visitDictOnExit(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:334
VariantVisitor.h
armarx::aron::component_config::MakeConfigGuiVisitor::visitBool
void visitBool(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:128
forward_declarations.h
armarx::aron::component_config::MakeConfigGuiVisitor::visitObjectOnExit
void visitObjectOnExit(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:65
armarx::aron::data::RecursiveTypedVisitor< data::VariantPtr, const type::VariantPtr >::ListElements
std::vector< std::pair< DataInputNonConst, TypeInputNonConst > > ListElements
Definition: RecursiveVisitor.h:87
armarx::aron::component_config::GetValueFromMapVisitor::visitFloat
void visitFloat(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:367
armarx::aron::component_config::GetValueFromMapVisitor::getTupleElements
TupleElements getTupleElements(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:482
armarx::aron::component_config::MakeConfigGuiVisitor::visitFloat
void visitFloat(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:94
armarx::aron::data::RecursiveConstTypedVariantVisitor
Definition: VariantVisitor.h:192
armarx::aron::type::Descriptor
Descriptor
Definition: Descriptor.h:76
armarx::aron::component_config::GetValueFromMapVisitor::getDescriptor
type::Descriptor getDescriptor(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:452
armarx::aron::component_config::GetValueFromMapVisitor::visitDictOnEnter
void visitDictOnEnter(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:649
armarx::aron::component_config::MakeConfigGuiVisitor::visitListOnExit
void visitListOnExit(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:207
armarx::aron::component_config::GetValueFromMapVisitor::getListElements
ListElements getListElements(DataInput &, TypeInput &) override
Definition: RemoteGuiVisitors.cpp:470
armarx::aron::data::RecursiveTypedVisitor< data::VariantPtr, const type::VariantPtr >::TupleElements
std::vector< std::pair< DataInputNonConst, TypeInputNonConst > > TupleElements
Definition: RecursiveVisitor.h:89