plane_clipper3D.h
/*
* Software License Agreement (BSD License)
*
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2010-2011, 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.
*
*/
#ifndef PCL_PLANE_CLIPPER3D_H_
#define PCL_PLANE_CLIPPER3D_H_
#include "clipper3D.h"
namespace pcl
{
/**
* @author Suat Gedikli <gedikli@willowgarage.com>
* @brief Implementation of a plane clipper in 3D
* \ingroup filters
*/
template<typename PointT>
class PlaneClipper3D : public Clipper3D<PointT>
{
public:
typedef boost::shared_ptr< PlaneClipper3D<PointT> > Ptr;
typedef boost::shared_ptr< const PlaneClipper3D<PointT> > ConstPtr;
/**
* @author Suat Gedikli <gedikli@willowgarage.com>
* @brief Constructor taking the homogeneous representation of the plane as a Eigen::Vector4f
* @param[in] plane_params plane parameters, need not necessarily be normalized
*/
PlaneClipper3D (const Eigen::Vector4f& plane_params);
virtual ~PlaneClipper3D () throw ();
/**
* \brief Set new plane parameters
* \param plane_params
*/
void setPlaneParameters (const Eigen::Vector4f& plane_params);
/**
* \brief return the current plane parameters
* \return the current plane parameters
*/
const Eigen::Vector4f& getPlaneParameters () const;
virtual bool
clipPoint3D (const PointT& point) const;
virtual bool
clipLineSegment3D (PointT& from, PointT& to) const;
virtual void
clipPlanarPolygon3D (std::vector<PointT, Eigen::aligned_allocator<PointT> >& polygon) const;
virtual void
clipPlanarPolygon3D (const std::vector<PointT, Eigen::aligned_allocator<PointT> >& polygon, std::vector<PointT, Eigen::aligned_allocator<PointT> >& clipped_polygon) const;
virtual void
clipPointCloud3D (const pcl::PointCloud<PointT> &cloud_in, std::vector<int>& clipped, const std::vector<int>& indices = std::vector<int> ()) const;
virtual Clipper3D<PointT>*
clone () const;
protected:
float
getDistance (const PointT& point) const;
private:
Eigen::Vector4f plane_params_;
};
}
#include <pcl/filters/impl/plane_clipper3D.hpp>
#endif // PCL_PLANE_CLIPPER3D_H_
pcl::PlaneClipper3D::getDistance
float getDistance(const PointT &point) const
Definition: plane_clipper3D.hpp:70
pcl::PlaneClipper3D::getPlaneParameters
const Eigen::Vector4f & getPlaneParameters() const
return the current plane parameters
Definition: plane_clipper3D.hpp:58
pcl::PlaneClipper3D::Ptr
boost::shared_ptr< PlaneClipper3D< PointT > > Ptr
Definition: plane_clipper3D.h:54
pcl::PlaneClipper3D::clipPointCloud3D
virtual void clipPointCloud3D(const pcl::PointCloud< PointT > &cloud_in, std::vector< int > &clipped, const std::vector< int > &indices=std::vector< int >()) const
interface to clip a point cloud
Definition: plane_clipper3D.hpp:180
pcl
Definition: cloud_iterator.h:46
pcl::PlaneClipper3D::PlaneClipper3D
PlaneClipper3D(const Eigen::Vector4f &plane_params)
Constructor taking the homogeneous representation of the plane as a Eigen::Vector4f.
Definition: plane_clipper3D.hpp:41
std
Definition: multi_grid_octree_data.hpp:45
pcl::PlaneClipper3D::clipPoint3D
virtual bool clipPoint3D(const PointT &point) const
interface to clip a single point
Definition: plane_clipper3D.hpp:76
Eigen
Definition: bfgs.h:10
pcl::PlaneClipper3D::~PlaneClipper3D
virtual ~PlaneClipper3D()
Definition: plane_clipper3D.hpp:47
pcl::PlaneClipper3D::ConstPtr
boost::shared_ptr< const PlaneClipper3D< PointT > > ConstPtr
Definition: plane_clipper3D.h:55
pcl::PlaneClipper3D::setPlaneParameters
void setPlaneParameters(const Eigen::Vector4f &plane_params)
Set new plane parameters.
Definition: plane_clipper3D.hpp:52
pcl::PlaneClipper3D::clone
virtual Clipper3D< PointT > * clone() const
polymorphic method to clone the underlying clipper with its parameters.
Definition: plane_clipper3D.hpp:64
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points. ...
Definition: projection_matrix.h:53
pcl::PlaneClipper3D::clipPlanarPolygon3D
virtual void clipPlanarPolygon3D(std::vector< PointT, Eigen::aligned_allocator< PointT > > &polygon) const
Definition: plane_clipper3D.hpp:171
pcl::PointXYZRGB
A point structure representing Euclidean xyz coordinates, and the RGB color.
Definition: point_types.hpp:594
pcl::PlaneClipper3D::clipLineSegment3D
virtual bool clipLineSegment3D(PointT &from, PointT &to) const
Definition: plane_clipper3D.hpp:85
pcl::PlaneClipper3D
Implementation of a plane clipper in 3D.
Definition: plane_clipper3D.h:50
pcl::Clipper3D
Base class for 3D clipper objects.
Definition: clipper3D.h:52