AronTreeWidgetConverter.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
27
28// forward declarations of qt
29class QTreeWidgetItem;
30
31namespace armarx
32{
33 // Conversion from TreeView to aron data
35 {
36 public:
37 QTreeWidgetItem* parentItem;
38 int index;
40
42
43 AronTreeWidgetConverterVisitor(QTreeWidgetItem* i, int x) : parentItem(i), index(x)
44 {
45 }
46
47 // if the conversion was successful after calling visit()
49 // returns true if this type itself was sucessfully parsed, but some contained object failed.
50 // also false if there is no error
52
53 bool hasDirectError() const;
54
55 private:
56 bool isDirectError = false;
57 bool hasTransitiveError = false;
58 // adds all errors from other visitor to our own error collection -> collecting errors
59 // with ownFault, we also add this node to the collection
60 void handleErrors(AronTreeWidgetConverterVisitor childV, bool ownFault = false);
61 // we are the cause...
62 void handleErrors(bool ownFault = true);
63
64 public:
65 void visitAronVariant(const aron::type::ObjectPtr&) final;
66 void visitAronVariant(const aron::type::DictPtr&) final;
67 void visitAronVariant(const aron::type::PairPtr&) final;
68 void visitAronVariant(const aron::type::TuplePtr&) final;
69 void visitAronVariant(const aron::type::ListPtr&) final;
71 void visitAronVariant(const aron::type::MatrixPtr&) final;
73 void visitAronVariant(const aron::type::ImagePtr&) final;
76 void visitAronVariant(const aron::type::IntPtr&) final;
77 void visitAronVariant(const aron::type::LongPtr&) final;
78 void visitAronVariant(const aron::type::FloatPtr&) final;
79 void visitAronVariant(const aron::type::DoublePtr&) final;
80 void visitAronVariant(const aron::type::BoolPtr&) final;
81 void visitAronVariant(const aron::type::StringPtr&) final;
82 void visitUnknown(Input&) final;
83 };
84} // namespace armarx
AronTreeWidgetConverterVisitor(QTreeWidgetItem *i, int x)
void visitAronVariant(const aron::type::ObjectPtr &) final
std::shared_ptr< Variant > VariantPtr
std::shared_ptr< class Quaternion > QuaternionPtr
std::shared_ptr< Object > ObjectPtr
Definition Object.h:36
std::shared_ptr< class Double > DoublePtr
std::shared_ptr< class Matrix > MatrixPtr
std::shared_ptr< class Image > ImagePtr
std::shared_ptr< class Long > LongPtr
std::shared_ptr< class String > StringPtr
std::shared_ptr< class PointCloud > PointCloudPtr
std::shared_ptr< class Pair > PairPtr
std::shared_ptr< class NDArray > NDArrayPtr
std::shared_ptr< class Int > IntPtr
std::shared_ptr< class Float > FloatPtr
std::shared_ptr< class Bool > BoolPtr
std::shared_ptr< class Tuple > TuplePtr
std::shared_ptr< class Dict > DictPtr
std::shared_ptr< IntEnum > IntEnumPtr
Definition IntEnum.h:36
std::shared_ptr< class List > ListPtr
This file offers overloads of toIce() and fromIce() functions for STL container types.
typename VisitorBase< const type::VariantPtr >::Input Input
Definition Visitor.h:103