TreeTypedDataVisitor.cpp
Go to the documentation of this file.
2
3#include <iomanip> // std::setprecision
4
5#include <SimoxUtility/algorithm/string.h>
6
8
12
14{
15
16 /*void TreeTypedDataVisitor::streamValueText(const aron::data::Long& data, const aron::type::DateTime& type, std::stringstream& ss) const
17 {
18 (void) type;
19 armem::Time time { armem::Duration::MicroSeconds(data.getValue()) };
20 armem::toDateTimeMilliSeconds(time);
21 ss << armem::toDateTimeMilliSeconds(time);
22 }*/
23
24 void
26 const aron::type::Matrix& type,
27 std::stringstream& ss) const
28 {
29 auto shape = data.getShape();
30
31 // TODO: Remove hardcoded stuff
32 if (shape.size() == 3)
33 {
34 if (shape[0] == 3 && shape[1] == 1 && shape[2] == 4)
35 {
36 streamPositionText(data, type, ss);
37 return;
38 }
39
40 if (shape[0] == 4 && shape[1] == 4 && shape[2] == 4)
41 {
42 streamPoseText(data, type, ss);
43 return;
44 }
45
46 if (shape[0] == 4 && shape[1] == 1 && shape[2] == 4)
47 {
48 streamOrientationText(data, type, ss);
49 return;
50 }
51 }
53 }
54
55 void
57 const aron::type::Matrix& type,
58 std::stringstream& ss) const
59 {
60 (void)type;
61 const Eigen::Matrix4f pose =
63 ss << std::setprecision(2) << std::fixed;
64 ss << pose.format(
65 Eigen::IOFormat(Eigen::StreamPrecision, 0, coeffSep, "\n", "", "", "", ""));
66 }
67
68 void
70 const aron::type::Matrix& type,
71 std::stringstream& ss) const
72 {
73 (void)type;
74 const Eigen::Vector3f pos =
76 ss << std::setprecision(2) << std::fixed;
77 ss << pos.format(Eigen::IOFormat(Eigen::StreamPrecision, 0, "", coeffSep, "", "", "", ""));
78 }
79
80 void
82 const aron::type::Matrix& type,
83 std::stringstream& ss) const
84 {
85 (void)type;
86 const Eigen::Quaternionf quat =
88 ss << std::setprecision(2) << std::fixed;
89 ss << quat.w() << coeffSep << "|" << coeffSep << quat.x() << coeffSep << quat.y()
90 << coeffSep << quat.z();
91 }
92
93} // namespace armarx::armem::gui::instance
void streamValueText(Navigator &n, std::stringstream &ss) const
void streamOrientationText(const aron::data::NDArray &data, const aron::type::Matrix &type, std::stringstream &ss) const
void streamValueText(const DataNavigatorT &data, const TypeNavigatorT &type, std::stringstream &ss) const
void streamPositionText(const aron::data::NDArray &data, const aron::type::Matrix &type, std::stringstream &ss) const
void streamPoseText(const aron::data::NDArray &data, const aron::type::Matrix &type, std::stringstream &ss) const
static Eigen::Matrix4f ConvertToMatrix4f(const data::NDArrayPtr &)
static Eigen::Vector3f ConvertToVector3f(const data::NDArrayPtr &)
static Eigen::Quaternion< float > ConvertToQuaternionf(const data::NDArrayPtr &)
The Matrix class.
Definition Matrix.h:40
Quaternion< float, 0 > Quaternionf