LVRPoseItem.cpp
Go to the documentation of this file.
1 
34 #include "LVRPoseItem.hpp"
35 #include "LVRItemTypes.hpp"
36 
37 namespace lvr2
38 {
39 
40 LVRPoseItem::LVRPoseItem(ModelBridgePtr bridge, QTreeWidgetItem* parent):
41  QTreeWidgetItem(parent, LVRPoseItemType)
42 {
43  m_pose = bridge->getPose();
44 
45  // Setup
46  QIcon icon;
47  icon.addFile(QString::fromUtf8(":/qv_transform_tree_icon.png"), QSize(), QIcon::Normal, QIcon::Off);
48  setIcon(0, icon);
49  setText(0, "Pose");
50 
51  m_xItem = new QTreeWidgetItem(this);
52  m_yItem = new QTreeWidgetItem(this);
53  m_zItem = new QTreeWidgetItem(this);
54  m_rItem = new QTreeWidgetItem(this);
55  m_tItem = new QTreeWidgetItem(this);
56  m_pItem = new QTreeWidgetItem(this);
57 
58  addChild(m_xItem);
59  addChild(m_yItem);
60  addChild(m_zItem);
61  addChild(m_rItem);
62  addChild(m_tItem);
63  addChild(m_pItem);
64 
65  setPose(m_pose);
66 }
67 
68 
69 void LVRPoseItem::setPose(const Pose& pose)
70 {
71  m_pose = pose;
72  QString num;
73 
74  m_xItem->setText(0, "Position X:");
75  m_xItem->setText(1, num.setNum(m_pose.x,'F'));
76 
77  m_yItem->setText(0, "Position Y:");
78  m_yItem->setText(1, num.setNum(m_pose.y,'f'));
79 
80  m_zItem->setText(0, "Position Z:");
81  m_zItem->setText(1, num.setNum(m_pose.z,'f'));
82 
83  m_rItem->setText(0, "Rotation X:");
84  m_rItem->setText(1, num.setNum(m_pose.r,'f'));
85 
86  m_tItem->setText(0, "Rotation Y:");
87  m_tItem->setText(1, num.setNum(m_pose.t,'f'));
88 
89  m_pItem->setText(0, "Rotation Z:");
90  m_pItem->setText(1, num.setNum(m_pose.p,'f'));
91 
92 }
93 
95 {
96  return m_pose;
97 }
98 
100 {
101  // TODO Auto-generated destructor stub
102 }
103 
104 } /* namespace lvr2 */
LVRPoseItem(ModelBridgePtr bridge, QTreeWidgetItem *parent=0)
Definition: LVRPoseItem.cpp:40
QTreeWidgetItem * m_yItem
Definition: LVRPoseItem.hpp:56
QTreeWidgetItem * m_rItem
Definition: LVRPoseItem.hpp:58
QTreeWidgetItem * m_pItem
Definition: LVRPoseItem.hpp:60
boost::shared_ptr< LVRModelBridge > ModelBridgePtr
QTreeWidgetItem * m_zItem
Definition: LVRPoseItem.hpp:57
void setPose(const Pose &pose)
Definition: LVRPoseItem.cpp:69
virtual ~LVRPoseItem()
Definition: LVRPoseItem.cpp:99
QTreeWidgetItem * m_xItem
Definition: LVRPoseItem.hpp:55
QTreeWidgetItem * m_tItem
Definition: LVRPoseItem.hpp:59


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:08