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 
30 #include "../AronTreeWidgetItem.h"
31 
32 namespace armarx::skills::gui
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 
44  AronTreeWidgetSetterVisitor() = delete;
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::skills::gui
armarx::skills::gui::AronTreeWidgetSetterVisitor::qWidgetItem
AronTreeWidgetItem * qWidgetItem
Definition: AronTreeWidgetSetter.h:42
armarx::aron::data::ConstVariantVisitor
Definition: VariantVisitor.h:39
armarx::skills::gui::AronTreeWidgetSetterVisitor::AronTreeWidgetSetterVisitor
AronTreeWidgetSetterVisitor(QTreeWidgetItem *i, int x)
Definition: AronTreeWidgetSetter.h:46
armarx::skills::gui::AronTreeWidgetSetterVisitor
Definition: AronTreeWidgetSetter.h:37
armarx::aron::data::LongPtr
std::shared_ptr< Long > LongPtr
Definition: forward_declarations.h:26
armarx::aron::data::NDArrayPtr
std::shared_ptr< NDArray > NDArrayPtr
Definition: NDArray.h:46
All.h
armarx::aron::data::DoublePtr
std::shared_ptr< Double > DoublePtr
Definition: forward_declarations.h:32
armarx::skills::gui::AronTreeWidgetSetterVisitor::index
int index
Definition: AronTreeWidgetSetter.h:41
armarx::skills::gui::AronTreeWidgetSetterVisitor::parentItem
QTreeWidgetItem * parentItem
Definition: AronTreeWidgetSetter.h:40
armarx::skills::gui::AronTreeWidgetSetterVisitor::AronTreeWidgetSetterVisitor
AronTreeWidgetSetterVisitor()=delete
All.h
armarx::skills::gui
Definition: PeriodicUpdateWidget.cpp:11
armarx::skills::gui::AronTreeWidgetSetterVisitor::visitAronVariant
virtual void visitAronVariant(const aron::data::DictPtr &) final
Definition: AronTreeWidgetSetter.cpp:103
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition: Dict.h:41
VariantVisitor.h
armarx::skills::gui::AronTreeWidgetSetterVisitor::visitUnknown
void visitUnknown(Input &) final
Definition: AronTreeWidgetSetter.cpp:422
armarx::aron::data::FloatPtr
std::shared_ptr< Float > FloatPtr
Definition: forward_declarations.h:29
armarx::aron::data::StringPtr
std::shared_ptr< String > StringPtr
Definition: forward_declarations.h:35
armarx::skills::gui::AronTreeWidgetItem
Definition: AronTreeWidgetItem.h:19
armarx::aron::data::IntPtr
std::shared_ptr< Int > IntPtr
Definition: forward_declarations.h:23
armarx::aron::data::Visitor< const data::VariantPtr >::Input
typename VisitorBase< const data::VariantPtr >::Input Input
Definition: Visitor.h:66
armarx::aron::data::ListPtr
std::shared_ptr< List > ListPtr
Definition: List.h:40
armarx::aron::data::BoolPtr
std::shared_ptr< Bool > BoolPtr
Definition: forward_declarations.h:38