/usr/include/pcl-1.7/pcl/common/generate.h is in libpcl-dev 1.7.2-14build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | /*
* Software License Agreement (BSD License)
*
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2010-2012, Willow Garage, Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of the copyright holder(s) nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*
*/
#ifndef PCL_COMMON_GENERATE_H_
#define PCL_COMMON_GENERATE_H_
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/common/random.h>
namespace pcl
{
namespace common
{
/** \brief CloudGenerator class generates a point cloud using some randoom number generator.
* Generators can be found in \file common/random.h and easily extensible.
*
* \ingroup common
* \author Nizar Sallem
*/
template <typename PointT, typename GeneratorT>
class CloudGenerator
{
public:
typedef typename GeneratorT::Parameters GeneratorParameters;
/// Default constructor
CloudGenerator ();
/** Consttructor with single generator to ensure all X, Y and Z values are within same range
* \param params paramteres for X, Y and Z values generation. Uniqueness is ensured through
* seed incrementation
*/
CloudGenerator (const GeneratorParameters& params);
/** Constructor with independant generators per axis
* \param x_params parameters for x values generation
* \param y_params parameters for y values generation
* \param z_params parameters for z values generation
*/
CloudGenerator (const GeneratorParameters& x_params,
const GeneratorParameters& y_params,
const GeneratorParameters& z_params);
/** Set parameters for x, y and z values. Uniqueness is ensured through seed incrementation.
* \param params parameteres for X, Y and Z values generation.
*/
void
setParameters (const GeneratorParameters& params);
/** Set parameters for x values generation
* \param x_params paramters for x values generation
*/
void
setParametersForX (const GeneratorParameters& x_params);
/** Set parameters for y values generation
* \param y_params paramters for y values generation
*/
void
setParametersForY (const GeneratorParameters& y_params);
/** Set parameters for z values generation
* \param z_params paramters for z values generation
*/
void
setParametersForZ (const GeneratorParameters& z_params);
/// \return x values generation parameters
const GeneratorParameters&
getParametersForX () const;
/// \return y values generation parameters
const GeneratorParameters&
getParametersForY () const;
/// \return z values generation parameters
const GeneratorParameters&
getParametersForZ () const;
/// \return a single random generated point
PointT
get ();
/** Generates a cloud with X Y Z picked within given ranges. This function assumes that
* cloud is properly defined else it raises errors and does nothing.
* \param[out] cloud cloud to generate coordinates for
* \return 0 if generation went well else -1.
*/
int
fill (pcl::PointCloud<PointT>& cloud);
/** Generates a cloud of specified dimensions with X Y Z picked within given ranges.
* \param[in] width width of generated cloud
* \param[in] height height of generated cloud
* \param[out] cloud output cloud
* \return 0 if generation went well else -1.
*/
int
fill (int width, int height, pcl::PointCloud<PointT>& cloud);
private:
GeneratorT x_generator_, y_generator_, z_generator_;
};
template <typename GeneratorT>
class CloudGenerator<pcl::PointXY, GeneratorT>
{
public:
typedef typename GeneratorT::Parameters GeneratorParameters;
CloudGenerator ();
CloudGenerator (const GeneratorParameters& params);
CloudGenerator (const GeneratorParameters& x_params,
const GeneratorParameters& y_params);
void
setParameters (const GeneratorParameters& params);
void
setParametersForX (const GeneratorParameters& x_params);
void
setParametersForY (const GeneratorParameters& y_params);
const GeneratorParameters&
getParametersForX () const;
const GeneratorParameters&
getParametersForY () const;
pcl::PointXY
get ();
int
fill (pcl::PointCloud<pcl::PointXY>& cloud);
int
fill (int width, int height, pcl::PointCloud<pcl::PointXY>& cloud);
private:
GeneratorT x_generator_;
GeneratorT y_generator_;
};
}
}
#include <pcl/common/impl/generate.hpp>
#endif
|