pcl_point_operators.cpp
Go to the documentation of this file.
1 #include "pcl_point_operators.h"
2 
3 
4 namespace pcl
5 {
6 
7  template <typename PointT>
8  static bool neq_xyz(const PointT& lhs, const PointT& rhs)
9  {
10  return lhs.x != rhs.x || lhs.y != rhs.y || lhs.z != rhs.z;
11  }
12 
13  template <typename PointT>
14  static std::ostream& out_xyz(std::ostream& os, const PointT& rhs)
15  {
16  return os << "[" << rhs.x << " " << rhs.y << " " << rhs.z << "]";
17  }
18 
19 
20  template <typename PointT>
21  static bool neq_rgba(const PointT& lhs, const PointT& rhs)
22  {
23  return lhs.r != rhs.r || lhs.g != rhs.g || lhs.b != rhs.b || lhs.a != rhs.a;
24  }
25 
26  template <typename PointT>
27  static std::ostream& out_rgba(std::ostream& os, const PointT& rhs)
28  {
29  return os << "[" << rhs.r << " " << rhs.g << " " << rhs.b << " " << rhs.a << "]";
30  }
31 
32 
33  bool operator!=(const PointXYZ& lhs, const PointXYZ& rhs)
34  {
35  return neq_xyz(lhs, rhs);
36  }
37 
38  std::ostream& operator<<(std::ostream& os, const PointXYZ& rhs)
39  {
40  return os << "[" << rhs.x << " " << rhs.y << " " << rhs.z << "]";
41  }
42 
43 
44  bool operator!=(const PointXYZRGBA& lhs, const PointXYZRGBA& rhs)
45  {
46  return neq_xyz(lhs, rhs) || neq_rgba(lhs, rhs);
47  }
48 
49  std::ostream& operator<<(std::ostream& os, const PointXYZRGBA& rhs)
50  {
51  os << "(";
52  out_xyz(os, rhs) << " ";
53  return out_rgba(os, rhs) << ")";
54  }
55 
56 
57  bool operator!=(const PointXYZL& lhs, const PointXYZL& rhs)
58  {
59  return neq_xyz(lhs, rhs) || lhs.label != rhs.label;
60  }
61 
62  std::ostream& operator<<(std::ostream& os, const PointXYZL& rhs)
63  {
64  os << "(";
65  return out_xyz(os, rhs) << " " << rhs.label << ")";
66  }
67 }
68 
pcl
Definition: pcl_point_operators.cpp:4
pcl_point_operators.h
armarx::PointT
pcl::PointXYZRGBL PointT
Definition: Common.h:28
pcl::operator<<
std::ostream & operator<<(std::ostream &os, const PointXYZ &rhs)
Definition: pcl_point_operators.cpp:38
pcl::operator!=
bool operator!=(const PointXYZ &lhs, const PointXYZ &rhs)
Definition: pcl_point_operators.cpp:33