generate.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-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 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 PCL_COMMON_GENERATE_H_
00041 #define PCL_COMMON_GENERATE_H_
00042 
00043 #include <pcl/point_cloud.h>
00044 #include <pcl/point_types.h>
00045 #include <pcl/common/random.h>
00046 
00047 namespace pcl
00048 {
00049 
00050   namespace common
00051   {
00058     template <typename PointT, typename GeneratorT>
00059     class CloudGenerator
00060     {
00061       public:
00062       typedef typename GeneratorT::Parameters GeneratorParameters;
00063 
00065       CloudGenerator ();
00066 
00071       CloudGenerator (const GeneratorParameters& params);
00072 
00078       CloudGenerator (const GeneratorParameters& x_params,
00079                       const GeneratorParameters& y_params,
00080                       const GeneratorParameters& z_params);
00081 
00085       void
00086       setParameters (const GeneratorParameters& params);
00087       
00091       void
00092       setParametersForX (const GeneratorParameters& x_params);
00093 
00097       void
00098       setParametersForY (const GeneratorParameters& y_params);
00099       
00103       void
00104       setParametersForZ (const GeneratorParameters& z_params);
00105 
00107       const GeneratorParameters& 
00108       getParametersForX () const;
00109 
00111       const GeneratorParameters& 
00112       getParametersForY () const;
00113 
00115       const GeneratorParameters& 
00116       getParametersForZ () const;
00117       
00119       PointT 
00120       get ();
00121         
00127       int
00128       fill (pcl::PointCloud<PointT>& cloud);
00129 
00136       int 
00137       fill (int width, int height, pcl::PointCloud<PointT>& cloud);
00138       
00139       private:
00140         GeneratorT x_generator_, y_generator_, z_generator_;
00141     };
00142 
00143     template <typename GeneratorT>
00144     class CloudGenerator<pcl::PointXY, GeneratorT>
00145     {
00146       public:
00147       typedef typename GeneratorT::Parameters GeneratorParameters;
00148       
00149       CloudGenerator ();
00150       
00151       CloudGenerator (const GeneratorParameters& params);
00152 
00153       CloudGenerator (const GeneratorParameters& x_params,
00154                       const GeneratorParameters& y_params);
00155       
00156       void
00157       setParameters (const GeneratorParameters& params);
00158 
00159       void
00160       setParametersForX (const GeneratorParameters& x_params);
00161 
00162       void
00163       setParametersForY (const GeneratorParameters& y_params);
00164 
00165       const GeneratorParameters& 
00166       getParametersForX () const;
00167 
00168       const GeneratorParameters& 
00169       getParametersForY () const;
00170 
00171       pcl::PointXY
00172       get ();
00173 
00174       int 
00175       fill (pcl::PointCloud<pcl::PointXY>& cloud);
00176 
00177       int 
00178       fill (int width, int height, pcl::PointCloud<pcl::PointXY>& cloud);
00179       
00180       private:
00181         GeneratorT x_generator_;
00182         GeneratorT y_generator_;
00183     };
00184   }
00185 }
00186 
00187 #include <pcl/common/impl/generate.hpp>
00188 
00189 #endif


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:24:19