-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathPoint.h
executable file
·62 lines (54 loc) · 1.22 KB
/
Point.h
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
/*
*基本点类型
*罗中飞,2015.12
*/
#ifndef point_h
#define point_h
#include <vector>
#include <memory>
namespace td
{
class Point
{
public:
Point();
//构造函数:Point(x,y,z)
Point(double, double, double);
~Point();
//可以用来sort和作为map的key
friend bool operator<(const Point &_pnta, const Point &_pntb)
{
if (_pnta.x<_pntb.x){
return true;
}
else if (_pnta.x>_pntb.x){
return false;
}
else if (_pnta.y<_pntb.y){
return true;
}
else if (_pnta.y>_pntb.y){
return false;
}
else if (_pnta.z<_pntb.z){
return true;
}
else if (_pnta.z>_pntb.z){
return false;
}
else{
return false;
}
}
//设置点的属性
void setPoint(double, double, double);
public:
double x;
double y;
double z;
bool operator==(const Point& pnt);
};
typedef std::vector<td::Point> PointCloud;
typedef std::shared_ptr<PointCloud> Ptr;
}
#endif;