correspondence_rejection_features.hpp
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  *  Copyright (c) 2012-, Open Perception, Inc.
00007  *
00008  *  All rights reserved.
00009  *
00010  *  Redistribution and use in source and binary forms, with or without
00011  *  modification, are permitted provided that the following conditions
00012  *  are met:
00013  *
00014  *   * Redistributions of source code must retain the above copyright
00015  *     notice, this list of conditions and the following disclaimer.
00016  *   * Redistributions in binary form must reproduce the above
00017  *     copyright notice, this list of conditions and the following
00018  *     disclaimer in the documentation and/or other materials provided
00019  *     with the distribution.
00020  *   * Neither the name of the copyright holder(s) nor the names of its
00021  *     contributors may be used to endorse or promote products derived
00022  *     from this software without specific prior written permission.
00023  *
00024  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00025  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00026  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00027  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00028  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00029  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00030  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00031  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00032  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00033  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00034  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00035  *  POSSIBILITY OF SUCH DAMAGE.
00036  *
00037  * $Id$
00038  *
00039  */
00040 #ifndef PCL_REGISTRATION_IMPL_CORRESPONDENCE_REJECTION_FEATURES_HPP_
00041 #define PCL_REGISTRATION_IMPL_CORRESPONDENCE_REJECTION_FEATURES_HPP_
00042 
00044 template <typename FeatureT> inline void 
00045 pcl::registration::CorrespondenceRejectorFeatures::setSourceFeature (
00046     const typename pcl::PointCloud<FeatureT>::ConstPtr &source_feature, const std::string &key)
00047 {
00048   if (features_map_.count (key) == 0)
00049     features_map_[key].reset (new FeatureContainer<FeatureT>);
00050   boost::static_pointer_cast<FeatureContainer<FeatureT> > (features_map_[key])->setSourceFeature (source_feature);
00051 }
00052 
00054 template <typename FeatureT> inline typename pcl::PointCloud<FeatureT>::ConstPtr 
00055 pcl::registration::CorrespondenceRejectorFeatures::getSourceFeature (const std::string &key)
00056 {
00057   if (features_map_.count (key) == 0)
00058     return (boost::shared_ptr<pcl::PointCloud<const FeatureT> > ());
00059   else
00060     return (boost::static_pointer_cast<FeatureContainer<FeatureT> > (features_map_[key])->getSourceFeature ());
00061 }
00062 
00064 template <typename FeatureT> inline void 
00065 pcl::registration::CorrespondenceRejectorFeatures::setTargetFeature (
00066     const typename pcl::PointCloud<FeatureT>::ConstPtr &target_feature, const std::string &key)
00067 {
00068   if (features_map_.count (key) == 0)
00069     features_map_[key].reset (new FeatureContainer<FeatureT>);
00070   boost::static_pointer_cast<FeatureContainer<FeatureT> > (features_map_[key])->setTargetFeature (target_feature);
00071 }
00072 
00074 template <typename FeatureT> inline typename pcl::PointCloud<FeatureT>::ConstPtr 
00075 pcl::registration::CorrespondenceRejectorFeatures::getTargetFeature (const std::string &key)
00076 {
00077   if (features_map_.count (key) == 0)
00078     return (boost::shared_ptr<const pcl::PointCloud<FeatureT> > ());
00079   else
00080     return (boost::static_pointer_cast<FeatureContainer<FeatureT> > (features_map_[key])->getTargetFeature ());
00081 }
00082 
00084 template <typename FeatureT> inline void 
00085 pcl::registration::CorrespondenceRejectorFeatures::setDistanceThreshold (
00086     double thresh, const std::string &key)
00087 {
00088   if (features_map_.count (key) == 0)
00089     features_map_[key].reset (new FeatureContainer<FeatureT>);
00090   boost::static_pointer_cast<FeatureContainer<FeatureT> > (features_map_[key])->setDistanceThreshold (thresh);
00091 }
00092 
00093 
00094 
00096 template <typename FeatureT> inline void 
00097 pcl::registration::CorrespondenceRejectorFeatures::setFeatureRepresentation (
00098   const typename pcl::PointRepresentation<FeatureT>::ConstPtr &fr,
00099   const std::string &key)
00100 {
00101   if (features_map_.count (key) == 0)
00102     features_map_[key].reset (new FeatureContainer<FeatureT>);
00103   boost::static_pointer_cast<FeatureContainer<FeatureT> > (features_map_[key])->setFeatureRepresentation (fr);
00104 }
00105 
00106 
00107 #endif /* PCL_REGISTRATION_IMPL_CORRESPONDENCE_REJECTION_FEATURES_HPP_ */


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:23:04