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