src
tools
lvr2_viewer
widgets
LVRPickItem.cpp
Go to the documentation of this file.
1
34
#include "
LVRPickItem.hpp
"
35
36
#include "
lvr2/geometry/BaseVector.hpp
"
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
51
LVRPickItem::~LVRPickItem
()
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
78
double
*
LVRPickItem::getStart
()
79
{
80
return
m_start
;
81
}
82
83
double
*
LVRPickItem::getEnd
()
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
108
LVRVtkArrow
*
LVRPickItem::getArrow
()
109
{
110
return
m_arrow
;
111
}
112
113
}
/* namespace lvr2 */
BaseVector.hpp
lvr2::LVRPickItem::LVRPickItem
LVRPickItem(QTreeWidget *parent, int type=LVRPickItemType)
Definition:
LVRPickItem.cpp:41
lvr2::BaseVector< float >
lvr2::LVRPickItem::getEnd
double * getEnd()
Definition:
LVRPickItem.cpp:83
lvr2::LVRVtkArrow
A wrapper class to generate arrow actors for vtk based on VTK's oriented arrow example.
Definition:
LVRVtkArrow.hpp:49
lvr2::LVRPickItem::getArrow
LVRVtkArrow * getArrow()
Definition:
LVRPickItem.cpp:108
lvr2::LVRPickItem::setStart
void setStart(double *start)
Definition:
LVRPickItem.cpp:57
lvr2::LVRPickItem::setEnd
void setEnd(double *end)
Definition:
LVRPickItem.cpp:88
lvr2::LVRPickItem::getStart
double * getStart()
Definition:
LVRPickItem.cpp:78
lvr2::LVRPickItem::m_arrow
LVRVtkArrow * m_arrow
Definition:
LVRPickItem.hpp:61
lvr2::LVRPickItem::m_start
double * m_start
Definition:
LVRPickItem.hpp:59
lvr2::LVRPickItem::m_end
double * m_end
Definition:
LVRPickItem.hpp:60
lvr2
Definition:
BaseBufferManipulators.hpp:39
lvr2::LVRPickItem::~LVRPickItem
virtual ~LVRPickItem()
Definition:
LVRPickItem.cpp:51
LVRPickItem.hpp
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