ice_point_operators.cpp
Go to the documentation of this file.
2
3namespace visionx
4{
5
6 bool
7 eq(float lhs, float rhs, float tol = 1e-6f)
8 {
9 return std::abs(lhs - rhs) < tol;
10 }
11
12 bool
13 operator!=(const Point3D& lhs, const Point3D& rhs)
14 {
15 return !eq(lhs.x, rhs.x) || !eq(lhs.y, rhs.y) || !eq(lhs.z, rhs.z);
16 }
17
18 std::ostream&
19 operator<<(std::ostream& os, const Point3D& rhs)
20 {
21 return os << "[" << rhs.x << " " << rhs.y << " " << rhs.z << "]";
22 }
23
24 std::ostream&
25 operator<<(std::ostream& os, const RGBA& rhs)
26 {
27 return os << "[" << rhs.r << " " << rhs.g << " " << rhs.b << " " << rhs.a << "]";
28 }
29
30 bool
31 operator!=(const ColoredPoint3D& lhs, const ColoredPoint3D& rhs)
32 {
33 return lhs.point != rhs.point || lhs.color != rhs.color;
34 }
35
36 std::ostream&
37 operator<<(std::ostream& os, const ColoredPoint3D& rhs)
38 {
39 return os << "(" << rhs.point << " " << rhs.color << ")";
40 }
41
42 bool
43 operator!=(const LabeledPoint3D& lhs, const LabeledPoint3D& rhs)
44 {
45 return lhs.point != rhs.point || lhs.label != rhs.label;
46 }
47
48 std::ostream&
49 operator<<(std::ostream& os, const LabeledPoint3D& rhs)
50 {
51 return os << "(" << rhs.point << " " << rhs.label << ")";
52 }
53} // namespace visionx
ArmarX headers.
bool eq(float lhs, float rhs, float tol=1e-6f)
std::ostream & operator<<(std::ostream &os, const Point3D &rhs)
bool operator!=(const Point3D &lhs, const Point3D &rhs)