concave_hull.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) 2009-2012, 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 Willow Garage, Inc. 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: concave_hull.h 6126 2012-07-03 20:19:58Z aichim $
00037  *
00038  */
00039 
00040 #include <pcl/pcl_config.h>
00041 #ifdef HAVE_QHULL
00042 
00043 #ifndef PCL_CONCAVE_HULL_H
00044 #define PCL_CONCAVE_HULL_H
00045 
00046 #include <pcl/surface/convex_hull.h>
00047 
00048 namespace pcl
00049 {
00051 
00055   template<typename PointInT>
00056   class ConcaveHull : public MeshConstruction<PointInT>
00057   {
00058     protected:
00059       using PCLBase<PointInT>::input_;
00060       using PCLBase<PointInT>::indices_;
00061       using PCLBase<PointInT>::initCompute;
00062       using PCLBase<PointInT>::deinitCompute;
00063 
00064     public:
00065       using MeshConstruction<PointInT>::reconstruct;
00066 
00067       typedef pcl::PointCloud<PointInT> PointCloud;
00068       typedef typename PointCloud::Ptr PointCloudPtr;
00069       typedef typename PointCloud::ConstPtr PointCloudConstPtr;
00070 
00072       ConcaveHull () : alpha_ (0), keep_information_ (false), voronoi_centers_ (), dim_(0)
00073       {
00074       };
00075 
00082       void
00083       reconstruct (PointCloud &points, 
00084                    std::vector<pcl::Vertices> &polygons);
00085 
00089       void
00090       reconstruct (PointCloud &output);
00091 
00098       inline void
00099       setAlpha (double alpha)
00100       {
00101         alpha_ = alpha;
00102       }
00103 
00105       inline double
00106       getAlpha ()
00107       {
00108         return (alpha_);
00109       }
00110 
00114       inline void
00115       setVoronoiCenters (PointCloudPtr voronoi_centers)
00116       {
00117         voronoi_centers_ = voronoi_centers;
00118       }
00119 
00124       void
00125       setKeepInformation (bool value)
00126       {
00127         keep_information_ = value;
00128       }
00129 
00131       inline int
00132       getDim () const
00133       {
00134         return dim_;
00135       }
00136 
00138       inline int
00139       getDimension () const
00140       {
00141         return dim_;
00142       }
00143 
00147       void 
00148       setDimension (int dimension)
00149       {
00150         if ((dimension == 2) || (dimension == 3))
00151           dim_ = dimension;
00152         else
00153           PCL_ERROR ("[pcl::%s::setDimension] Invalid input dimension specified!\n", getClassName ().c_str ());
00154       }
00155 
00156     protected:
00158       std::string
00159       getClassName () const
00160       {
00161         return ("ConcaveHull");
00162       }
00163 
00164     protected:
00171       void
00172       performReconstruction (PointCloud &points, 
00173                              std::vector<pcl::Vertices> &polygons);
00174 
00175       virtual void
00176       performReconstruction (PolygonMesh &output);
00177 
00178       virtual void
00179       performReconstruction (std::vector<pcl::Vertices> &polygons);
00180 
00184       double alpha_;
00185 
00189       bool keep_information_;
00190 
00192       PointCloudPtr voronoi_centers_;
00193       
00195       int dim_;
00196   };
00197 }
00198 
00199 #endif  //#ifndef PCL_CONCAVE_HULL
00200 #endif


pcl
Author(s): Open Perception
autogenerated on Mon Oct 6 2014 03:14:42