/usr/include/pcl-1.7/pcl/common/common.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 190 191 192 193 194 195 196 | /*
* Software License Agreement (BSD License)
*
* Copyright (c) 2010, 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_H_
#define PCL_COMMON_H_
#include <pcl/pcl_base.h>
#include <cfloat>
/**
* \file pcl/common/common.h
* Define standard C methods and C++ classes that are common to all methods
* \ingroup common
*/
/*@{*/
namespace pcl
{
/** \brief Compute the smallest angle between two vectors in the [ 0, PI ) interval in 3D.
* \param v1 the first 3D vector (represented as a \a Eigen::Vector4f)
* \param v2 the second 3D vector (represented as a \a Eigen::Vector4f)
* \return the angle between v1 and v2
* \ingroup common
*/
inline double
getAngle3D (const Eigen::Vector4f &v1, const Eigen::Vector4f &v2);
/** \brief Compute both the mean and the standard deviation of an array of values
* \param values the array of values
* \param mean the resultant mean of the distribution
* \param stddev the resultant standard deviation of the distribution
* \ingroup common
*/
inline void
getMeanStd (const std::vector<float> &values, double &mean, double &stddev);
/** \brief Get a set of points residing in a box given its bounds
* \param cloud the point cloud data message
* \param min_pt the minimum bounds
* \param max_pt the maximum bounds
* \param indices the resultant set of point indices residing in the box
* \ingroup common
*/
template <typename PointT> inline void
getPointsInBox (const pcl::PointCloud<PointT> &cloud, Eigen::Vector4f &min_pt,
Eigen::Vector4f &max_pt, std::vector<int> &indices);
/** \brief Get the point at maximum distance from a given point and a given pointcloud
* \param cloud the point cloud data message
* \param pivot_pt the point from where to compute the distance
* \param max_pt the point in cloud that is the farthest point away from pivot_pt
* \ingroup common
*/
template<typename PointT> inline void
getMaxDistance (const pcl::PointCloud<PointT> &cloud, const Eigen::Vector4f &pivot_pt, Eigen::Vector4f &max_pt);
/** \brief Get the point at maximum distance from a given point and a given pointcloud
* \param cloud the point cloud data message
* \param pivot_pt the point from where to compute the distance
* \param indices the vector of point indices to use from \a cloud
* \param max_pt the point in cloud that is the farthest point away from pivot_pt
* \ingroup common
*/
template<typename PointT> inline void
getMaxDistance (const pcl::PointCloud<PointT> &cloud, const std::vector<int> &indices,
const Eigen::Vector4f &pivot_pt, Eigen::Vector4f &max_pt);
/** \brief Get the minimum and maximum values on each of the 3 (x-y-z) dimensions in a given pointcloud
* \param cloud the point cloud data message
* \param min_pt the resultant minimum bounds
* \param max_pt the resultant maximum bounds
* \ingroup common
*/
template <typename PointT> inline void
getMinMax3D (const pcl::PointCloud<PointT> &cloud, PointT &min_pt, PointT &max_pt);
/** \brief Get the minimum and maximum values on each of the 3 (x-y-z) dimensions in a given pointcloud
* \param cloud the point cloud data message
* \param min_pt the resultant minimum bounds
* \param max_pt the resultant maximum bounds
* \ingroup common
*/
template <typename PointT> inline void
getMinMax3D (const pcl::PointCloud<PointT> &cloud,
Eigen::Vector4f &min_pt, Eigen::Vector4f &max_pt);
/** \brief Get the minimum and maximum values on each of the 3 (x-y-z) dimensions in a given pointcloud
* \param cloud the point cloud data message
* \param indices the vector of point indices to use from \a cloud
* \param min_pt the resultant minimum bounds
* \param max_pt the resultant maximum bounds
* \ingroup common
*/
template <typename PointT> inline void
getMinMax3D (const pcl::PointCloud<PointT> &cloud, const std::vector<int> &indices,
Eigen::Vector4f &min_pt, Eigen::Vector4f &max_pt);
/** \brief Get the minimum and maximum values on each of the 3 (x-y-z) dimensions in a given pointcloud
* \param cloud the point cloud data message
* \param indices the vector of point indices to use from \a cloud
* \param min_pt the resultant minimum bounds
* \param max_pt the resultant maximum bounds
* \ingroup common
*/
template <typename PointT> inline void
getMinMax3D (const pcl::PointCloud<PointT> &cloud, const pcl::PointIndices &indices,
Eigen::Vector4f &min_pt, Eigen::Vector4f &max_pt);
/** \brief Compute the radius of a circumscribed circle for a triangle formed of three points pa, pb, and pc
* \param pa the first point
* \param pb the second point
* \param pc the third point
* \return the radius of the circumscribed circle
* \ingroup common
*/
template <typename PointT> inline double
getCircumcircleRadius (const PointT &pa, const PointT &pb, const PointT &pc);
/** \brief Get the minimum and maximum values on a point histogram
* \param histogram the point representing a multi-dimensional histogram
* \param len the length of the histogram
* \param min_p the resultant minimum
* \param max_p the resultant maximum
* \ingroup common
*/
template <typename PointT> inline void
getMinMax (const PointT &histogram, int len, float &min_p, float &max_p);
/** \brief Calculate the area of a polygon given a point cloud that defines the polygon
* \param polygon point cloud that contains those vertices that comprises the polygon. Vertices are stored in counterclockwise.
* \return the polygon area
* \ingroup common
*/
template<typename PointT> inline float
calculatePolygonArea (const pcl::PointCloud<PointT> &polygon);
/** \brief Get the minimum and maximum values on a point histogram
* \param cloud the cloud containing multi-dimensional histograms
* \param idx point index representing the histogram that we need to compute min/max for
* \param field_name the field name containing the multi-dimensional histogram
* \param min_p the resultant minimum
* \param max_p the resultant maximum
* \ingroup common
*/
PCL_EXPORTS void
getMinMax (const pcl::PCLPointCloud2 &cloud, int idx, const std::string &field_name,
float &min_p, float &max_p);
/** \brief Compute both the mean and the standard deviation of an array of values
* \param values the array of values
* \param mean the resultant mean of the distribution
* \param stddev the resultant standard deviation of the distribution
* \ingroup common
*/
PCL_EXPORTS void
getMeanStdDev (const std::vector<float> &values, double &mean, double &stddev);
}
/*@}*/
#include <pcl/common/impl/common.hpp>
#endif //#ifndef PCL_COMMON_H_
|