LVRPickItem.cpp
Go to the documentation of this file.
1 
34 #include "LVRPickItem.hpp"
35 
37 
38 namespace lvr2
39 {
40 
41 LVRPickItem::LVRPickItem(QTreeWidget* parent, int type) :
42  QTreeWidgetItem(parent, type)
43 {
44  m_start = 0;
45  m_end = 0;
46  m_arrow = 0;
47  setText(0, "Empty");
48  setText(1, "Empty");
49 }
50 
52 {
53  if(m_start) delete[] m_start;
54  if(m_end) delete[] m_end;
55 }
56 
57 void LVRPickItem::setStart(double* start)
58 {
59  using Vec = BaseVector<float>;
60  if (m_start) delete[] m_start;
61  m_start = start;
62  QString x, y, z, text;
63  x.setNum(start[0], 'f');
64  y.setNum(start[1], 'f');
65  z.setNum(start[2], 'f');
66  text = QString("%1 %2 %3").arg(x).arg(y).arg(z);
67  setText(0, text);
68 
69  // Create new arrow if necessary
70  if(m_start && m_end)
71  {
72  Vec start(m_start[0], m_start[1], m_start[2]);
73  Vec end(m_end[0], m_end[1], m_end[2]);
74  m_arrow = new LVRVtkArrow(start, end);
75  }
76 }
77 
79 {
80  return m_start;
81 }
82 
84 {
85  return m_end;
86 }
87 
88 void LVRPickItem::setEnd(double* end)
89 {
90  if(m_end) delete[] m_end;
91  m_end = end;
92  QString x, y, z, text;
93  x.setNum(end[0], 'f');
94  y.setNum(end[1], 'f');
95  z.setNum(end[2], 'f');
96  text = QString("%1 %2 %3").arg(x).arg(y).arg(z);
97  setText(1, text);
98 
99  // Create new arrow if necessary
100  if(m_start && m_end)
101  {
102  Vec start(m_start[0], m_start[1], m_start[2]);
103  Vec end(m_end[0], m_end[1], m_end[2]);
104  m_arrow = new LVRVtkArrow(start, end);
105  }
106 }
107 
109 {
110  return m_arrow;
111 }
112 
113 } /* namespace lvr2 */
LVRVtkArrow * getArrow()
double * getStart()
Definition: LVRPickItem.cpp:78
void setStart(double *start)
Definition: LVRPickItem.cpp:57
virtual ~LVRPickItem()
Definition: LVRPickItem.cpp:51
LVRVtkArrow * m_arrow
Definition: LVRPickItem.hpp:61
void setEnd(double *end)
Definition: LVRPickItem.cpp:88
double * getEnd()
Definition: LVRPickItem.cpp:83
LVRPickItem(QTreeWidget *parent, int type=LVRPickItemType)
Definition: LVRPickItem.cpp:41
A wrapper class to generate arrow actors for vtk based on VTK&#39;s oriented arrow example.
Definition: LVRVtkArrow.hpp:49


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