RemoteGuiAronDataVisitor.cpp
Go to the documentation of this file.
2 
3 #include <SimoxUtility/algorithm/string.h>
4 
6 
7 
8 namespace armarx::armem::server
9 {
10 
11  RemoteGuiAronDataVisitor::Group::Group(const std::string& label)
12  {
13  groupBox.setLabel(label);
15  }
16 
17  bool RemoteGuiAronDataVisitor::visitEnter(const std::string& key, const std::string& type, size_t size)
18  {
19  std::stringstream label;
20  label << key << " (" << type << " of size " << size << ")";
21  Group& group = groups.emplace(label.str());
22  (void) group;
23  return true;
24  }
25 
27  {
28  Group group = groups.top();
29  groups.pop();
30  if (groups.size() > 0)
31  {
32  groups.top().groupBox.addChild(group.groupBox);
33  }
34  else
35  {
36  result = group.groupBox;
37  }
38  return true;
39  }
40 
41  void RemoteGuiAronDataVisitor::streamValueText(aron::data::String& n, std::stringstream& ss)
42  {
43  ss << "'" << n.getValue() << "'";
44  }
45 
46  void RemoteGuiAronDataVisitor::streamValueText(aron::data::NDArray& n, std::stringstream& ss)
47  {
48  ss << "shape (" << simox::alg::join(simox::alg::multi_to_string(n.getShape()), ", ") << ")";
49  }
50 
51  void RemoteGuiAronDataVisitor::checkGroupsNotEmpty() const
52  {
53  ARMARX_CHECK_POSITIVE(groups.size()) << "Groups must not be empty.";
54  }
55 
56 
57 
58 
59 
60 }
armarx::RemoteGui::Client::ContainerWidget::addChild
void addChild(Widget const &child)
Definition: Widgets.cpp:95
armarx::armem::server::RemoteGuiAronDataVisitor::Group::Group
Group(const std::string &label={})
Definition: RemoteGuiAronDataVisitor.cpp:11
armarx::aron::data::NDArray
Definition: NDArray.h:48
armarx::armem::server::RemoteGuiAronDataVisitor::groups
std::stack< Group > groups
Definition: RemoteGuiAronDataVisitor.h:34
armarx::aron::data::NDArray::getShape
std::vector< int > getShape() const
Definition: NDArray.cpp:145
armarx::armem::server::RemoteGuiAronDataVisitor::result
GroupBox result
Definition: RemoteGuiAronDataVisitor.h:35
armarx::aron::data::detail::PrimitiveVariant::getValue
ValueT getValue() const
Definition: PrimitiveVariant.h:132
armarx::armem::server::RemoteGuiAronDataVisitor::Group::layout
GridLayout layout
Definition: RemoteGuiAronDataVisitor.h:30
armarx::armem::server::RemoteGuiAronDataVisitor::visitExit
bool visitExit()
Definition: RemoteGuiAronDataVisitor.cpp:26
armarx::aron::data::String
Definition: String.h:41
ARMARX_CHECK_POSITIVE
#define ARMARX_CHECK_POSITIVE(number)
This macro evaluates whether number is positive (> 0) and if it turns out to be false it will throw a...
Definition: ExpressionException.h:145
armarx::RemoteGui::Client::GroupBox::setLabel
void setLabel(std::string const &text)
Definition: Widgets.cpp:395
armarx::armem::server
Definition: GraspMemory.cpp:19
ExpressionException.h
RemoteGuiAronDataVisitor.h
armarx::armem::server::RemoteGuiAronDataVisitor::visitEnter
bool visitEnter(const std::string &key, const std::string &type, size_t size)
Definition: RemoteGuiAronDataVisitor.cpp:17
armarx::armem::server::RemoteGuiAronDataVisitor::Group::groupBox
GroupBox groupBox
Definition: RemoteGuiAronDataVisitor.h:29
armarx::armem::server::RemoteGuiAronDataVisitor::Group
Definition: RemoteGuiAronDataVisitor.h:25