inlib  1.2.0
Public Types | Public Member Functions
inlib::func::in_polygon Class Reference

List of all members.

Public Types

typedef std::pair< double, double > point

Public Member Functions

 in_polygon ()
 in_polygon (const std::vector< point > &a_points)
virtual ~in_polygon ()
 in_polygon (const in_polygon &a_from)
in_polygonoperator= (const in_polygon &a_from)
bool in_domain (const point &) const
double value (const point &a_point) const
bool set (const std::vector< point > &a_points)
bool set (unsigned int a_index, const point &a_point)
const std::vector< point > & points () const

Detailed Description

Definition at line 226 of file func.


Member Typedef Documentation

typedef std::pair<double,double> inlib::func::in_polygon::point

Definition at line 228 of file func.


Constructor & Destructor Documentation

inlib::func::in_polygon::in_polygon ( ) [inline]

Definition at line 230 of file func.

{}
inlib::func::in_polygon::in_polygon ( const std::vector< point > &  a_points) [inline]

Definition at line 231 of file func.

{set(a_points);}
virtual inlib::func::in_polygon::~in_polygon ( ) [inline, virtual]

Definition at line 232 of file func.

{}
inlib::func::in_polygon::in_polygon ( const in_polygon a_from) [inline]

Definition at line 234 of file func.

  :m_points(a_from.m_points)
  {}

Member Function Documentation

bool inlib::func::in_polygon::in_domain ( const point ) const [inline]

Definition at line 242 of file func.

{return true;}
in_polygon& inlib::func::in_polygon::operator= ( const in_polygon a_from) [inline]

Definition at line 237 of file func.

                                                 {
    m_points = a_from.m_points;
    return *this;
  }
const std::vector<point>& inlib::func::in_polygon::points ( ) const [inline]

Definition at line 264 of file func.

{return m_points;}
bool inlib::func::in_polygon::set ( const std::vector< point > &  a_points) [inline]

Definition at line 248 of file func.

                                            {
    m_points = a_points;
    if(!m_points.size()) return false;
    //check closure :
    if((m_points.size()>=2) && (m_points[m_points.size()-1]!=m_points[0]) ) {
      m_points.push_back(m_points[0]);
    }
    return true;
  }
bool inlib::func::in_polygon::set ( unsigned int  a_index,
const point a_point 
) [inline]

Definition at line 258 of file func.

                                                     {
    if(a_index>=m_points.size()) return false;
    m_points[a_index] = a_point;
    return true;
  }
double inlib::func::in_polygon::value ( const point a_point) const [inline]

Definition at line 243 of file func.

                                           {
    if(!m_points.size()) return 0;
    return (inside(a_point,m_points)?1:0);
  }

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines