Skip to content

Commit 127ed89

Browse files
committed
Split common/include/pcl/impl/point_types.hpp
* Move pcl::Array* into common/include/pcl/array_types.h * Move pcl::Vector* into common/include/pcl/vector_types.h Signed-off-by: Ramir Sultanov <sumir0@proton.me>
1 parent e5ce18f commit 127ed89

3 files changed

Lines changed: 109 additions & 19 deletions

File tree

common/include/pcl/array_types.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Software License Agreement (BSD License)
3+
*
4+
* Point Cloud Library (PCL) - www.pointclouds.org
5+
* Copyright (c) 2025-, Open Perception, Inc.
6+
*
7+
* All rights reserved.
8+
*
9+
* Redistribution and use in source and binary forms, with or without
10+
* modification, are permitted provided that the following conditions
11+
* are met:
12+
*
13+
* * Redistributions of source code must retain the above copyright
14+
* notice, this list of conditions and the following disclaimer.
15+
* * Redistributions in binary form must reproduce the above
16+
* copyright notice, this list of conditions and the following
17+
* disclaimer in the documentation and/or other materials provided
18+
* with the distribution.
19+
* * Neither the name of the copyright holder(s) nor the names of its
20+
* contributors may be used to endorse or promote products derived
21+
* from this software without specific prior written permission.
22+
*
23+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26+
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27+
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29+
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33+
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34+
* POSSIBILITY OF SUCH DAMAGE.
35+
*
36+
*/
37+
38+
#pragma once
39+
40+
#include <Eigen/Core>
41+
42+
namespace pcl
43+
{
44+
using Array3fMap = Eigen::Map<Eigen::Array3f>;
45+
using Array3fMapConst = const Eigen::Map<const Eigen::Array3f>;
46+
using Array4fMap = Eigen::Map<Eigen::Array4f, Eigen::Aligned>;
47+
using Array4fMapConst =
48+
const Eigen::Map<const Eigen::Array4f, Eigen::Aligned>;
49+
} // namespace pcl

common/include/pcl/impl/point_types.hpp

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,14 @@
3838

3939
#pragma once
4040

41+
#include <pcl/array_types.h> // for pcl::Array* types
4142
#include <pcl/memory.h> // for PCL_MAKE_ALIGNED_OPERATOR_NEW
4243
#include <pcl/pcl_config.h> // for PCL_XYZ_POINT_TYPES, PCL_NORMAL_POINT_TYPES
4344
#include <pcl/pcl_macros.h> // for PCL_EXPORTS
4445
#include <pcl/PCLPointField.h> // for PCLPointField
4546
#include <pcl/point_types.h> // implementee
4647
#include <pcl/register_point_struct.h> // for POINT_CLOUD_REGISTER_POINT_STRUCT, POINT_CLOUD_REGISTER_POINT_WRAPPER
48+
#include <pcl/vector_types.h> // for pcl::Vector* types
4749

4850
#include <boost/mpl/and.hpp> // for boost::mpl::and_
4951
#include <boost/mpl/bool.hpp> // for boost::mpl::bool_
@@ -184,29 +186,10 @@ namespace pcl
184186
template<> struct descriptorSize<Narf36> { static constexpr const int value = 36; };
185187
template<int N> struct descriptorSize<Histogram<N>> { static constexpr const int value = N; };
186188

187-
188189
template<typename FeaturePointT>
189190
static constexpr int descriptorSize_v = descriptorSize<FeaturePointT>::value;
190191
}
191192
}
192-
193-
using Vector2fMap = Eigen::Map<Eigen::Vector2f>;
194-
using Vector2fMapConst = const Eigen::Map<const Eigen::Vector2f>;
195-
using Array3fMap = Eigen::Map<Eigen::Array3f>;
196-
using Array3fMapConst = const Eigen::Map<const Eigen::Array3f>;
197-
using Array4fMap = Eigen::Map<Eigen::Array4f, Eigen::Aligned>;
198-
using Array4fMapConst = const Eigen::Map<const Eigen::Array4f, Eigen::Aligned>;
199-
using Vector3fMap = Eigen::Map<Eigen::Vector3f>;
200-
using Vector3fMapConst = const Eigen::Map<const Eigen::Vector3f>;
201-
using Vector4fMap = Eigen::Map<Eigen::Vector4f, Eigen::Aligned>;
202-
using Vector4fMapConst = const Eigen::Map<const Eigen::Vector4f, Eigen::Aligned>;
203-
204-
using Vector3c = Eigen::Matrix<std::uint8_t, 3, 1>;
205-
using Vector3cMap = Eigen::Map<Vector3c>;
206-
using Vector3cMapConst = const Eigen::Map<const Vector3c>;
207-
using Vector4c = Eigen::Matrix<std::uint8_t, 4, 1>;
208-
using Vector4cMap = Eigen::Map<Vector4c, Eigen::Aligned>;
209-
using Vector4cMapConst = const Eigen::Map<const Vector4c, Eigen::Aligned>;
210193

211194
#define PCL_ADD_UNION_POINT4D \
212195
union EIGEN_ALIGN16 { \

common/include/pcl/vector_types.h

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
* Software License Agreement (BSD License)
3+
*
4+
* Point Cloud Library (PCL) - www.pointclouds.org
5+
* Copyright (c) 2025-, Open Perception, Inc.
6+
*
7+
* All rights reserved.
8+
*
9+
* Redistribution and use in source and binary forms, with or without
10+
* modification, are permitted provided that the following conditions
11+
* are met:
12+
*
13+
* * Redistributions of source code must retain the above copyright
14+
* notice, this list of conditions and the following disclaimer.
15+
* * Redistributions in binary form must reproduce the above
16+
* copyright notice, this list of conditions and the following
17+
* disclaimer in the documentation and/or other materials provided
18+
* with the distribution.
19+
* * Neither the name of the copyright holder(s) nor the names of its
20+
* contributors may be used to endorse or promote products derived
21+
* from this software without specific prior written permission.
22+
*
23+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26+
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27+
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29+
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33+
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34+
* POSSIBILITY OF SUCH DAMAGE.
35+
*
36+
*/
37+
38+
#pragma once
39+
40+
#include <Eigen/Core>
41+
42+
namespace pcl
43+
{
44+
using Vector2fMap = Eigen::Map<Eigen::Vector2f>;
45+
using Vector2fMapConst = const Eigen::Map<const Eigen::Vector2f>;
46+
using Vector3fMap = Eigen::Map<Eigen::Vector3f>;
47+
using Vector3fMapConst = const Eigen::Map<const Eigen::Vector3f>;
48+
using Vector4fMap = Eigen::Map<Eigen::Vector4f, Eigen::Aligned>;
49+
using Vector4fMapConst =
50+
const Eigen::Map<const Eigen::Vector4f, Eigen::Aligned>;
51+
52+
using Vector3c = Eigen::Matrix<std::uint8_t, 3, 1>;
53+
using Vector3cMap = Eigen::Map<Vector3c>;
54+
using Vector3cMapConst = const Eigen::Map<const Vector3c>;
55+
using Vector4c = Eigen::Matrix<std::uint8_t, 4, 1>;
56+
using Vector4cMap = Eigen::Map<Vector4c, Eigen::Aligned>;
57+
using Vector4cMapConst = const Eigen::Map<const Vector4c, Eigen::Aligned>;
58+
} // namespace pcl

0 commit comments

Comments
 (0)