point_types.h
Go to the documentation of this file.
00001 /*
00002  * Software License Agreement (BSD License)
00003  *
00004  *  Point Cloud Library (PCL) - www.pointclouds.org
00005  *  Copyright (c) 2010-2011, Willow Garage, Inc.
00006  *
00007  *  All rights reserved.
00008  *
00009  *  Redistribution and use in source and binary forms, with or without
00010  *  modification, are permitted provided that the following conditions
00011  *  are met:
00012  *
00013  *   * Redistributions of source code must retain the above copyright
00014  *     notice, this list of conditions and the following disclaimer.
00015  *   * Redistributions in binary form must reproduce the above
00016  *     copyright notice, this list of conditions and the following
00017  *     disclaimer in the documentation and/or other materials provided
00018  *     with the distribution.
00019  *   * Neither the name of the copyright holder(s) nor the names of its
00020  *     contributors may be used to endorse or promote products derived
00021  *     from this software without specific prior written permission.
00022  *
00023  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00024  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00025  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00026  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00027  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00028  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00029  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00030  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00031  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00032  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00033  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00034  *  POSSIBILITY OF SUCH DAMAGE.
00035  *
00036  * $Id$
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 }  // namespace traits
00146 }  // namespace pcl
00147 
00148 #endif  // BACKPORT_PCL_CENTROID
00149 #endif  // PCL18_BACKPORTS_POINT_TYPES_H


mcl_3dl
Author(s): Atsushi Watanabe
autogenerated on Thu Jun 20 2019 20:04:43