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
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  AronTreeWidgetSetterVisitor(QTreeWidgetItem* i, int x) : parentItem(i), index(x)
46  {
47  }
48 
49  virtual void visitAronVariant(const aron::data::DictPtr&) final;
50  virtual void visitAronVariant(const aron::data::ListPtr&) final;
51  virtual void visitAronVariant(const aron::data::NDArrayPtr&) final;
52  virtual void visitAronVariant(const aron::data::IntPtr&) final;
53  virtual void visitAronVariant(const aron::data::LongPtr&) final;
54  virtual void visitAronVariant(const aron::data::FloatPtr&) final;
55  virtual void visitAronVariant(const aron::data::DoublePtr&) final;
56  virtual void visitAronVariant(const aron::data::BoolPtr&) final;
57  virtual void visitAronVariant(const aron::data::StringPtr&) final;
58  void visitUnknown(Input&) final;
59 
60  private:
61  bool checkTreeWidgetItemForSimilarName(const std::string& name) const;
62  void adjustNumberOfChildren(AronTreeWidgetItem* parent, size_t numChildren);
63  };
64 } // namespace armarx
armarx::aron::data::ConstVariantVisitor
Definition: VariantVisitor.h:39
armarx::AronTreeWidgetItem
Definition: AronTreeWidgetItem.h:19
armarx::AronTreeWidgetSetterVisitor::parentItem
QTreeWidgetItem * parentItem
Definition: AronTreeWidgetSetter.h:40
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::AronTreeWidgetSetterVisitor::visitUnknown
void visitUnknown(Input &) final
Definition: AronTreeWidgetSetter.cpp:422
armarx::AronTreeWidgetSetterVisitor::visitAronVariant
virtual void visitAronVariant(const aron::data::DictPtr &) final
Definition: AronTreeWidgetSetter.cpp:103
armarx::AronTreeWidgetSetterVisitor::AronTreeWidgetSetterVisitor
AronTreeWidgetSetterVisitor(QTreeWidgetItem *i, int x)
Definition: AronTreeWidgetSetter.h:45
All.h
armarx::AronTreeWidgetSetterVisitor::AronTreeWidgetSetterVisitor
AronTreeWidgetSetterVisitor()=delete
armarx::AronTreeWidgetSetterVisitor::index
int index
Definition: AronTreeWidgetSetter.h:41
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition: Dict.h:41
armarx::AronTreeWidgetSetterVisitor::qWidgetItem
AronTreeWidgetItem * qWidgetItem
Definition: AronTreeWidgetSetter.h:42
VariantVisitor.h
armarx::AronTreeWidgetSetterVisitor
Definition: AronTreeWidgetSetter.h:37
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::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
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::aron::data::BoolPtr
std::shared_ptr< Bool > BoolPtr
Definition: forward_declarations.h:38