Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef PCL18_BACKPORTS_POINT_TYPES_H
00041 #define PCL18_BACKPORTS_POINT_TYPES_H
00042
00043 #include <pcl/point_types.h>
00044
00045 #ifdef BACKPORT_PCL_CENTROID
00046
00047 #include <vector>
00048 #include <bitset>
00049
00050 #include <pcl/pcl_macros.h>
00051 #include <pcl/register_point_struct.h>
00052 #include <boost/mpl/contains.hpp>
00053 #include <boost/mpl/fold.hpp>
00054 #include <boost/mpl/vector.hpp>
00055
00056 namespace pcl
00057 {
00058 namespace traits
00059 {
00076 template <typename PointT, typename Field>
00077 struct has_field : boost::mpl::contains<typename pcl::traits::fieldList<PointT>::type, Field>::type
00078 {
00079 };
00080
00082 template <typename PointT, typename Field>
00083 struct has_all_fields : boost::mpl::fold<
00084 Field,
00085 boost::mpl::bool_<true>,
00086 boost::mpl::and_<boost::mpl::_1,
00087 has_field<PointT, boost::mpl::_2>>>::type
00088 {
00089 };
00090
00092 template <typename PointT, typename Field>
00093 struct has_any_field : boost::mpl::fold<
00094 Field,
00095 boost::mpl::bool_<false>,
00096 boost::mpl::or_<boost::mpl::_1,
00097 has_field<PointT, boost::mpl::_2>>>::type
00098 {
00099 };
00100
00102 template <typename PointT>
00103 struct has_xyz : has_all_fields<
00104 PointT, boost::mpl::vector<pcl::fields::x,
00105 pcl::fields::y,
00106 pcl::fields::z>>
00107 {
00108 };
00109
00112 template <typename PointT>
00113 struct has_normal : has_all_fields<
00114 PointT, boost::mpl::vector<pcl::fields::normal_x,
00115 pcl::fields::normal_y,
00116 pcl::fields::normal_z>>
00117 {
00118 };
00119
00121 template <typename PointT>
00122 struct has_curvature : has_field<PointT, pcl::fields::curvature>
00123 {
00124 };
00125
00127 template <typename PointT>
00128 struct has_intensity : has_field<PointT, pcl::fields::intensity>
00129 {
00130 };
00131
00133 template <typename PointT>
00134 struct has_color : has_any_field<
00135 PointT, boost::mpl::vector<pcl::fields::rgb,
00136 pcl::fields::rgba>>
00137 {
00138 };
00139
00141 template <typename PointT>
00142 struct has_label : has_field<PointT, pcl::fields::label>
00143 {
00144 };
00145 }
00146 }
00147
00148 #endif // BACKPORT_PCL_CENTROID
00149 #endif // PCL18_BACKPORTS_POINT_TYPES_H