AronTreeWidgetSetter.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 RobotAPI::gui-plugins::SkillManagerMonitorWidgetController
17 * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
18 * @date 2020
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22#pragma once
23
24#include <stack>
25
29
31
32namespace armarx
33{
34 // Conversion from aron data to Tree View data
35 // This should be used to programatically change data to be displayed in the GUI.
36 // This code will not be called, if changes are made on the GUI side.
38 {
39 public:
40 QTreeWidgetItem* parentItem;
41 int index;
43
45
46 AronTreeWidgetSetterVisitor(QTreeWidgetItem* i, int x) : parentItem(i), index(x)
47 {
48 }
49
50 virtual void visitAronVariant(const aron::data::DictPtr&) final;
51 virtual void visitAronVariant(const aron::data::ListPtr&) final;
52 virtual void visitAronVariant(const aron::data::NDArrayPtr&) final;
53 virtual void visitAronVariant(const aron::data::IntPtr&) final;
54 virtual void visitAronVariant(const aron::data::LongPtr&) final;
55 virtual void visitAronVariant(const aron::data::FloatPtr&) final;
56 virtual void visitAronVariant(const aron::data::DoublePtr&) final;
57 virtual void visitAronVariant(const aron::data::BoolPtr&) final;
58 virtual void visitAronVariant(const aron::data::StringPtr&) final;
59 void visitUnknown(Input&) final;
60
61 private:
62 bool checkTreeWidgetItemForSimilarName(const std::string& name) const;
63 void adjustNumberOfChildren(AronTreeWidgetItem* parent, size_t numChildren);
64 };
65} // namespace armarx
AronTreeWidgetSetterVisitor(QTreeWidgetItem *i, int x)
virtual void visitAronVariant(const aron::data::DictPtr &) final
std::shared_ptr< Dict > DictPtr
Definition Dict.h:42
std::shared_ptr< List > ListPtr
Definition List.h:41
std::shared_ptr< Bool > BoolPtr
std::shared_ptr< Float > FloatPtr
std::shared_ptr< NDArray > NDArrayPtr
Definition NDArray.h:46
std::shared_ptr< Long > LongPtr
std::shared_ptr< Int > IntPtr
std::shared_ptr< Double > DoublePtr
std::shared_ptr< String > StringPtr
This file offers overloads of toIce() and fromIce() functions for STL container types.
typename VisitorBase< const data::VariantPtr >::Input Input
Definition Visitor.h:66