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.hpp
lvr2::Pose::t
float t
Definition: LVRModelBridge.hpp:53
lvr2::LVRPoseItem::m_yItem
QTreeWidgetItem * m_yItem
Definition: LVRPoseItem.hpp:56
LVRItemTypes.hpp
lvr2::LVRPoseItem::m_zItem
QTreeWidgetItem * m_zItem
Definition: LVRPoseItem.hpp:57
lvr2::LVRPoseItem::~LVRPoseItem
virtual ~LVRPoseItem()
Definition: LVRPoseItem.cpp:99
kfusion::device::Normal
float4 Normal
Definition: internal.hpp:13
lvr2::ModelBridgePtr
boost::shared_ptr< LVRModelBridge > ModelBridgePtr
Definition: LVRModelBridge.hpp:120
lvr2::Pose::r
float r
Definition: LVRModelBridge.hpp:53
lvr2::LVRPoseItem::m_xItem
QTreeWidgetItem * m_xItem
Definition: LVRPoseItem.hpp:55
lvr2::LVRPoseItem::LVRPoseItem
LVRPoseItem(ModelBridgePtr bridge, QTreeWidgetItem *parent=0)
Definition: LVRPoseItem.cpp:40
lvr2::LVRPoseItem::m_pItem
QTreeWidgetItem * m_pItem
Definition: LVRPoseItem.hpp:60
lvr2::LVRPoseItemType
@ LVRPoseItemType
Definition: LVRItemTypes.hpp:43
lvr2::LVRPoseItem::m_rItem
QTreeWidgetItem * m_rItem
Definition: LVRPoseItem.hpp:58
lvr2::LVRPoseItem::m_pose
Pose m_pose
Definition: LVRPoseItem.hpp:54
lvr2::Pose::p
float p
Definition: LVRModelBridge.hpp:53
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::Pose::x
float x
Definition: LVRModelBridge.hpp:53
lvr2::LVRPoseItem::getPose
Pose getPose()
Definition: LVRPoseItem.cpp:94
lvr2::LVRPoseItem::setPose
void setPose(const Pose &pose)
Definition: LVRPoseItem.cpp:69
lvr2::Pose::y
float y
Definition: LVRModelBridge.hpp:53
lvr2::LVRPoseItem::m_tItem
QTreeWidgetItem * m_tItem
Definition: LVRPoseItem.hpp:59
lvr2::Pose::z
float z
Definition: LVRModelBridge.hpp:53
lvr2::Pose
Definition: LVRModelBridge.hpp:51


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 Wed Mar 2 2022 00:37:24