-
Notifications
You must be signed in to change notification settings - Fork 0
/
PointCloud.cpp
67 lines (55 loc) · 1.35 KB
/
PointCloud.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "PointCloud.h"
PointCloud::PointCloud()
{
//! PointCloud sýnýfý için constructor
}
PointCloud::~PointCloud()
{
//! PointCloud sýnýfý için destructor.
}
void PointCloud::setPointCloud(Point& p)
{
//! bu fonksiyon pointcloud sýnýfýnýn içinde bulunun points nesnesine deðer atama iþlevi görür
points.push_back(p);
}
void PointCloud::setPointCloud(list<Point> plist)
{
points.clear();
points = plist;
}
list<Point> PointCloud::getPointCloud() const
{
//! bu fonksiyon pointcloud sýnýfýnýn içindeki points deðerlerini döndürür
return points;
}
int PointCloud::getPointNumber() const
{
//! bu fonksiyon PointCloud sýnýfý içindeki pointNumber deðiþkenini return eder
return points.size();
}
PointCloud PointCloud::operator+(const PointCloud& firstobject)
{
PointCloud sumPC;
sumPC = *this;
std::list<Point> temp = firstobject.getPointCloud();
for (int i = 0; i < firstobject.getPointNumber(); i++)
{
sumPC.setPointCloud(temp.front());
temp.pop_front();
}
return sumPC;
}
const PointCloud& PointCloud::operator=(const PointCloud& firstObject)
{
list<Point> temp = firstObject.getPointCloud();
if (&firstObject != this)
{
points.clear();
for (int i = 0; i < firstObject.getPointNumber(); i++)
{
this->setPointCloud(temp.front());
temp.pop_front();
}
}
return *this;
}