Point Cloud Library (PCL)  1.3.1
concave_hull.h
Go to the documentation of this file.
00001 /*
00002  * Software License Agreement (BSD License)
00003  *
00004  *  Copyright (c) 2010, Willow Garage, Inc.
00005  *  All rights reserved.
00006  *
00007  *  Redistribution and use in source and binary forms, with or without
00008  *  modification, are permitted provided that the following conditions
00009  *  are met:
00010  *
00011  *   * Redistributions of source code must retain the above copyright
00012  *     notice, this list of conditions and the following disclaimer.
00013  *   * Redistributions in binary form must reproduce the above
00014  *     copyright notice, this list of conditions and the following
00015  *     disclaimer in the documentation and/or other materials provided
00016  *     with the distribution.
00017  *   * Neither the name of Willow Garage, Inc. nor the names of its
00018  *     contributors may be used to endorse or promote products derived
00019  *     from this software without specific prior written permission.
00020  *
00021  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00022  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00024  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00025  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00026  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00027  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00028  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00029  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00030  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00031  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00032  *  POSSIBILITY OF SUCH DAMAGE.
00033  *
00034  * $Id: concave_hull.h 1864 2011-07-23 00:35:06Z rusu $
00035  *
00036  */
00037 
00038 #include <pcl/pcl_config.h>
00039 #ifdef HAVE_QHULL
00040 
00041 #ifndef PCL_CONCAVE_HULL_H
00042 #define PCL_CONCAVE_HULL_H
00043 
00044 #include "pcl/surface/convex_hull.h"
00045 
00046 namespace pcl
00047 {
00049 
00053   template<typename PointInT>
00054   class ConcaveHull : public PCLBase<PointInT>
00055   {
00056     using PCLBase<PointInT>::input_;
00057     using PCLBase<PointInT>::indices_;
00058     using PCLBase<PointInT>::initCompute;
00059     using PCLBase<PointInT>::deinitCompute;
00060 
00061     public:
00062       typedef pcl::PointCloud<PointInT> PointCloud;
00063       typedef typename PointCloud::Ptr PointCloudPtr;
00064       typedef typename PointCloud::ConstPtr PointCloudConstPtr;
00065 
00067       ConcaveHull () : alpha_ (0), keep_information_ (false), voronoi_centers_ ()
00068       {
00069       };
00070 
00077       void
00078       reconstruct (PointCloud &points, 
00079                    std::vector<pcl::Vertices> &polygons);
00080 
00084       void
00085       reconstruct (PointCloud &output);
00086 
00093       inline void
00094       setAlpha (double alpha)
00095       {
00096         alpha_ = alpha;
00097       }
00098 
00100       inline double
00101       getAlpha ()
00102       {
00103         return (alpha_);
00104       }
00105 
00109       inline void
00110       setVoronoiCenters (PointCloudPtr voronoi_centers)
00111       {
00112         voronoi_centers_ = voronoi_centers;
00113       }
00114 
00119       void
00120       setKeepInformation (bool value)
00121       {
00122         keep_information_ = value;
00123       }
00124 
00125     protected:
00127       std::string
00128       getClassName () const
00129       {
00130         return ("ConcaveHull");
00131       }
00132 
00133     private:
00135       double alpha_;
00136 
00138       bool keep_information_;
00139 
00141       PointCloudPtr voronoi_centers_;
00142 
00149       void
00150       performReconstruction (PointCloud &points, 
00151                              std::vector<pcl::Vertices> &polygons);
00152   };
00153 }
00154 
00155 #endif  //#ifndef PCL_CONCAVE_HULL
00156 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines