Skip to content

Commit 2dc0aaa

Browse files
committed
Move MomentInvariants to feature types header
Signed-off-by: Ramir Sultanov <sumir0@proton.me>
1 parent 7d18805 commit 2dc0aaa

6 files changed

Lines changed: 29 additions & 35 deletions

File tree

common/include/pcl/feature_types.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
/** @{*/
1818
namespace pcl
1919
{
20-
20+
/** \brief Members: float j1, j2, j3
21+
* \ingroup common
22+
*/
23+
struct MomentInvariants;
2124
} // namespace pcl
2225
/** @} */
2326

common/include/pcl/impl/feature_types.hpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,24 @@
1616

1717
namespace pcl
1818
{
19+
PCL_EXPORTS std::ostream& operator << (std::ostream& os, const MomentInvariants& p);
20+
/** \brief A point structure representing the three moment invariants.
21+
* \ingroup common
22+
*/
23+
struct MomentInvariants
24+
{
25+
float j1 = 0.f, j2 = 0.f, j3 = 0.f;
1926

27+
inline constexpr MomentInvariants () = default;
28+
29+
inline constexpr MomentInvariants (float _j1, float _j2, float _j3): j1 (_j1), j2 (_j2), j3 (_j3) {}
30+
31+
friend std::ostream& operator << (std::ostream& os, const MomentInvariants& p);
32+
};
2033
} // namespace pcl
34+
35+
POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::MomentInvariants,
36+
(float, j1, j1)
37+
(float, j2, j2)
38+
(float, j3, j3)
39+
)

common/include/pcl/impl/point_types.hpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,21 +1094,6 @@ namespace pcl
10941094
friend std::ostream& operator << (std::ostream& os, const PointWithViewpoint& p);
10951095
};
10961096

1097-
PCL_EXPORTS std::ostream& operator << (std::ostream& os, const MomentInvariants& p);
1098-
/** \brief A point structure representing the three moment invariants.
1099-
* \ingroup common
1100-
*/
1101-
struct MomentInvariants
1102-
{
1103-
float j1 = 0.f, j2 = 0.f, j3 = 0.f;
1104-
1105-
inline constexpr MomentInvariants () = default;
1106-
1107-
inline constexpr MomentInvariants (float _j1, float _j2, float _j3): j1 (_j1), j2 (_j2), j3 (_j3) {}
1108-
1109-
friend std::ostream& operator << (std::ostream& os, const MomentInvariants& p);
1110-
};
1111-
11121097
PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PrincipalRadiiRSD& p);
11131098
/** \brief A point structure representing the minimum and maximum surface radii (in meters) computed using RSD.
11141099
* \ingroup common
@@ -1903,12 +1888,6 @@ POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointWithViewpoint,
19031888
)
19041889
POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointWithViewpoint, pcl::_PointWithViewpoint)
19051890

1906-
POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::MomentInvariants,
1907-
(float, j1, j1)
1908-
(float, j2, j2)
1909-
(float, j3, j3)
1910-
)
1911-
19121891
POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PrincipalRadiiRSD,
19131892
(float, r_min, r_min)
19141893
(float, r_max, r_max)

common/include/pcl/point_types.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,6 @@ namespace pcl
184184
*/
185185
struct PointWithViewpoint;
186186

187-
/** \brief Members: float j1, j2, j3
188-
* \ingroup common
189-
*/
190-
struct MomentInvariants;
191-
192187
/** \brief Members: float r_min, r_max
193188
* \ingroup common
194189
*/

common/src/feature_types.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,10 @@
99

1010
namespace pcl
1111
{
12-
12+
std::ostream&
13+
operator << (std::ostream& os, const MomentInvariants& p)
14+
{
15+
os << "(" << p.j1 << "," << p.j2 << "," << p.j3 << ")";
16+
return (os);
17+
}
1318
} // namespace pcl

common/src/point_types.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,6 @@ namespace pcl
232232
return (os);
233233
}
234234

235-
std::ostream&
236-
operator << (std::ostream& os, const MomentInvariants& p)
237-
{
238-
os << "(" << p.j1 << "," << p.j2 << "," << p.j3 << ")";
239-
return (os);
240-
}
241-
242235
std::ostream&
243236
operator << (std::ostream& os, const PrincipalRadiiRSD& p)
244237
{

0 commit comments

Comments
 (0)