-
Notifications
You must be signed in to change notification settings - Fork 6
/
pointcloud.cpp
34 lines (27 loc) · 921 Bytes
/
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
#include "pointcloud.h"
const std::vector<PointCloud::Point> &PointCloud::getPts()const
{
return *m_ptsPtr;
}
void PointCloud::push_back(const Point &pt)
{
m_ptsPtr->push_back(pt);
}
const PointCloud PointCloud::clone()const
{
PointCloud pt(*m_ptsPtr);
return pt;
}
void PointCloud::storage(const std::string &fileAddr)const
{
std::fstream file(fileAddr, std::ios::app);
if (!file)
return;
for (auto it = m_ptsPtr->begin(); it != m_ptsPtr->end(); ++it)
file << it->getX() << " " << it->getY() << " " << it->getZ() << " " << it->getR() << " " << it->getG() << " " << it->getB() << std::endl;
}
void PointCloud::storage(std::fstream &fout)const
{
for (auto it = m_ptsPtr->begin(); it != m_ptsPtr->end(); ++it)
fout << it->getX() << " " << it->getY() << " " << it->getZ() << " " << it->getR() << " " << it->getG() << " " << it->getB() << std::endl;
}