Loading...
Searching...
No Matches
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.
*
*/
#pragma once
#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:
using Ptr = shared_ptr< PlaneClipper3D<PointT> >;
using ConstPtr = shared_ptr< const PlaneClipper3D<PointT> >;
PCL_MAKE_ALIGNED_OPERATOR_NEW
/**
* @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 () noexcept = default;
/**
* \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, Indices& clipped, const Indices& indices = Indices ()) 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>
pcl::Clipper3D
Base class for 3D clipper objects.
Definition clipper3D.h:55
pcl::PlaneClipper3D::setPlaneParameters
void setPlaneParameters(const Eigen::Vector4f &plane_params)
Set new plane parameters.
Definition plane_clipper3D.hpp:47
pcl::PlaneClipper3D::getPlaneParameters
const Eigen::Vector4f & getPlaneParameters() const
return the current plane parameters
Definition plane_clipper3D.hpp:53
pcl::PlaneClipper3D::clipPoint3D
virtual bool clipPoint3D(const PointT &point) const
interface to clip a single point
Definition plane_clipper3D.hpp:71
pcl::PlaneClipper3D::ConstPtr
shared_ptr< const PlaneClipper3D< PointT > > ConstPtr
Definition plane_clipper3D.h:55
pcl::PlaneClipper3D::clone
virtual Clipper3D< PointT > * clone() const
polymorphic method to clone the underlying clipper with its parameters.
Definition plane_clipper3D.hpp:59
pcl::PlaneClipper3D::clipLineSegment3D
virtual bool clipLineSegment3D(PointT &from, PointT &to) const
Definition plane_clipper3D.hpp:80
pcl::PlaneClipper3D::clipPlanarPolygon3D
virtual void clipPlanarPolygon3D(std::vector< PointT, Eigen::aligned_allocator< PointT > > &polygon) const
Definition plane_clipper3D.hpp:166
pcl::PlaneClipper3D::Ptr
shared_ptr< PlaneClipper3D< PointT > > Ptr
Definition plane_clipper3D.h:54
pcl::PlaneClipper3D::clipPointCloud3D
virtual void clipPointCloud3D(const pcl::PointCloud< PointT > &cloud_in, Indices &clipped, const Indices &indices=Indices()) const
interface to clip a point cloud
Definition plane_clipper3D.hpp:175
pcl::PlaneClipper3D::PlaneClipper3D
PCL_MAKE_ALIGNED_OPERATOR_NEW PlaneClipper3D(const Eigen::Vector4f &plane_params)
Constructor taking the homogeneous representation of the plane as a Eigen::Vector4f.
Definition plane_clipper3D.hpp:41
pcl::PlaneClipper3D::~PlaneClipper3D
virtual ~PlaneClipper3D() noexcept=default
pcl::PlaneClipper3D::getDistance
float getDistance(const PointT &point) const
Definition plane_clipper3D.hpp:65
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition point_cloud.h:174
PCL_MAKE_ALIGNED_OPERATOR_NEW
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
Definition memory.h:86
Eigen
Definition bfgs.h:10
pcl
Definition convolution.h:46
pcl::Indices
IndicesAllocator<> Indices
Type used for indices in PCL.
Definition types.h:133