44 parentOfCreatedObj(parentInstance)
51 toplevelWidget = aronParent->treeWidget();
56 AronTreeWidgetCreatorVisitor::generateUniqueKeyFromSet(std::set<std::string>&& usedKeys)
61 std::string proposedName = this->defaultMapKeyName + std::to_string(num);
62 auto it = usedKeys.find(proposedName);
63 if (it == usedKeys.end())
69 return this->defaultMapKeyName + std::to_string(num);
77 auto key = i->getPath().getLastElement();
78 bool isDictChild =
false;
84 std::set<std::string> usedKeys;
85 for (
int i = 0; i < parentOfCreatedObj->childCount(); ++i)
90 usedKeys.insert(sibling->text(0).toStdString());
93 key = generateUniqueKeyFromSet(std::move(usedKeys));
96 else if (aronParent &&
99 key = std::to_string(parentOfCreatedObj->childCount());
105 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
113 QString::fromStdString(
115 ITEM_EMPTY_MESSAGE) );
117 if (editableValue || isDictChild)
129 auto key = i->getObjectName();
130 if (i->getPath().hasElement())
132 key = i->getPath().getLastElement();
138 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
145 for (
const auto& [key, value] : i->getMemberTypes())
150 assert(v.createdQWidgetItem);
171 for (
size_t i = 0; i < 2; ++i)
175 if (v.createdQWidgetItem)
177 std::string descr =
"p[" + std::to_string(i) +
"]";
178 v.createdQWidgetItem->setText(0, descr.c_str());
190 for (
size_t i = 0; i < tuple->getChildren().size(); ++i)
194 if (v.createdQWidgetItem)
196 std::string descr =
"tup[" + std::to_string(i) +
"]";
197 v.createdQWidgetItem->setText(0, descr.c_str());
219 editableValue =
false;
223 switch (i->getElementType())
225 case armarx::aron::type::matrix::UINT8:
228 case armarx::aron::type::matrix::UINT16:
231 case armarx::aron::type::matrix::UINT32:
234 case armarx::aron::type::matrix::INT8:
237 case armarx::aron::type::matrix::INT16:
240 case armarx::aron::type::matrix::INT32:
243 case armarx::aron::type::matrix::INT64:
246 case armarx::aron::type::matrix::FLOAT32:
249 case armarx::aron::type::matrix::FLOAT64:
267 editableValue =
false;
271 switch (i->getElementType())
273 case armarx::aron::type::quaternion::FLOAT32:
276 case armarx::aron::type::quaternion::FLOAT64:
304 editableValue =
false;
316 editableValue =
true;
323 editableValue =
true;
330 editableValue =
true;
337 editableValue =
true;
344 editableValue =
true;
357 ARMARX_WARNING_S <<
"Received an unknown type when trying to create a tree view widget for "
358 "a skill argument type.";
364 toplevelWidget = widget;
#define ARMARX_CHECK_GREATER(lhs, rhs)
This macro evaluates whether lhs is greater (>) than rhs and if it turns out to be false it will thro...
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
#define ARMARX_CHECK_EQUAL(lhs, rhs)
This macro evaluates whether lhs is equal (==) rhs and if it turns out to be false it will throw an E...
#define ARMARX_WARNING_S
The logging level for unexpected behaviour, but not a serious problem.
void visit(VisitorImplementation &v, typename VisitorImplementation::Input &t)
The visit function.
std::shared_ptr< class Quaternion > QuaternionPtr
std::shared_ptr< Object > ObjectPtr
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
std::shared_ptr< class List > ListPtr
QString generateNumElementsText(int num)
This file offers overloads of toIce() and fromIce() functions for STL container types.
typename VisitorBase< const type::VariantPtr >::Input Input