Fawkes API  Fawkes Development Version
fawkes::pcl_utils::PolygonComparison< PointT > Class Template Reference

Check if point is inside or outside a given polygon. More...

#include <comparisons.h>

Inheritance diagram for fawkes::pcl_utils::PolygonComparison< PointT >:

Public Types

typedef boost::shared_ptr< PolygonComparison< PointT > > Ptr
 Shared pointer. More...
 
typedef boost::shared_ptr< const PolygonComparison< PointT > > ConstPtr
 Constant shared pointer. More...
 

Public Member Functions

 PolygonComparison (const pcl::PointCloud< PointT > &polygon, bool inside=true)
 Constructor. More...
 
virtual ~PolygonComparison ()
 Virtual empty destructor. More...
 
virtual bool evaluate (const PointT &point) const
 Evaluate for given pixel. More...
 

Protected Attributes

bool inside_
 Flag to determine whether to do inside or outside check. More...
 
const pcl::PointCloud< PointT > & polygon_
 The polygon to check against. More...
 

Detailed Description

template<typename PointT>
class fawkes::pcl_utils::PolygonComparison< PointT >

Check if point is inside or outside a given polygon.

This comparison determines if a given point is inside or outside a given polygon. A flag can be set to have an inside or outside check. The class uses pcl::isPointIn2DPolygon() to determine if the point is inside the polygon. Not that we assume planar data, for example points projected into a segmented plane.

Author
Tim Niemueller

Definition at line 47 of file comparisons.h.

Member Typedef Documentation

◆ ConstPtr

template<typename PointT>
typedef boost::shared_ptr<const PolygonComparison<PointT> > fawkes::pcl_utils::PolygonComparison< PointT >::ConstPtr

Constant shared pointer.

Definition at line 54 of file comparisons.h.

◆ Ptr

template<typename PointT>
typedef boost::shared_ptr<PolygonComparison<PointT> > fawkes::pcl_utils::PolygonComparison< PointT >::Ptr

Shared pointer.

Definition at line 52 of file comparisons.h.

Constructor & Destructor Documentation

◆ PolygonComparison()

template<typename PointT>
fawkes::pcl_utils::PolygonComparison< PointT >::PolygonComparison ( const pcl::PointCloud< PointT > &  polygon,
bool  inside = true 
)
inline

Constructor.

Parameters
polygonpolygon to compare against, it must have at least three points
insideif true filter points inside the polygon, false for outside

Definition at line 60 of file comparisons.h.

◆ ~PolygonComparison()

template<typename PointT>
virtual fawkes::pcl_utils::PolygonComparison< PointT >::~PolygonComparison ( )
inlinevirtual

Virtual empty destructor.

Definition at line 66 of file comparisons.h.

Member Function Documentation

◆ evaluate()

template<typename PointT>
virtual bool fawkes::pcl_utils::PolygonComparison< PointT >::evaluate ( const PointT &  point) const
inlinevirtual

Evaluate for given pixel.

Parameters
pointpoint to compare
Returns
true if the point is inside/outside (depending on constructor parameter) the polygon, false otherwise

Definition at line 73 of file comparisons.h.

References fawkes::pcl_utils::PolygonComparison< PointT >::inside_, and fawkes::pcl_utils::PolygonComparison< PointT >::polygon_.

Member Data Documentation

◆ inside_

template<typename PointT>
bool fawkes::pcl_utils::PolygonComparison< PointT >::inside_
protected

Flag to determine whether to do inside or outside check.

Definition at line 83 of file comparisons.h.

Referenced by fawkes::pcl_utils::PolygonComparison< PointT >::evaluate().

◆ polygon_

template<typename PointT>
const pcl::PointCloud<PointT>& fawkes::pcl_utils::PolygonComparison< PointT >::polygon_
protected

The polygon to check against.

Definition at line 85 of file comparisons.h.

Referenced by fawkes::pcl_utils::PolygonComparison< PointT >::evaluate().


The documentation for this class was generated from the following file: