Point2D.H File Reference

#include "Image/Dims.H"
#include "Util/Promotions.H"
#include "Util/log.H"
#include <cmath>
#include <string>
#include <vector>
Include dependency graph for Point2D.H:

Go to the source code of this file.

Classes

class  Point2D< T >
 This is a basic class to encode 2D integer coordinates. More...

Functions

template<class T , class U >
bool operator== (const Point2D< T > &p1, const Point2D< U > &p2)
 == operator
template<class T , class U >
bool operator!= (const Point2D< T > &p1, const Point2D< U > &p2)
 != operator
template<class T , class U >
bool operator> (const Point2D< T > &p1, const Point2D< U > &p2)
 > operator
template<class T , class U >
bool operator< (const Point2D< T > &p1, const Point2D< U > &p2)
 < operator
template<class T >
std::string convertToString (const Point2D< T > &val)
 Point2D<T> overload: format is "<i>,<j>".
template<class T >
void convertFromString (const std::string &str, Point2D< T > &val)
 Point2D<T> overload: format is "<i>,<j>".
template<class T >
bool pnpoly (const std::vector< Point2D< T > > &polygon, const Point2D< T > &p)
 Is a point inside a polygon?
template<class T >
Point2D< T > centroid (const std::vector< Point2D< T > > &polygon)
 Where is the center of mass of a polygon?
template<class T >
double area (const std::vector< Point2D< T > > &polygon, const bool getsigned=false)
 What is the area of a polygon?
template<class T >
double angleMeasure (const Point2D< T > &A, const Point2D< T > &B, const Point2D< T > &C)
 What is the measure (in radians, signed -pi to pi) of angle BAC?
template<class T >
bool pnTriangle (const Point2D< T > &A, const Point2D< T > &B, const Point2D< T > &C, const Point2D< T > &P)
 determine if a point P is inside a triangle with vertices A,B,C

Detailed Description

A basic 2D point class

Definition in file Point2D.H.


Function Documentation

template<class T >
double angleMeasure ( const Point2D< T > &  A,
const Point2D< T > &  B,
const Point2D< T > &  C 
) [inline]

What is the measure (in radians, signed -pi to pi) of angle BAC?

Definition at line 451 of file Point2D.H.

References Point2D< T >::distance(), and Point2D< T >::i.

template<class T >
double area ( const std::vector< Point2D< T > > &  polygon,
const bool  getsigned = false 
) [inline]

What is the area of a polygon?

Definition at line 439 of file Point2D.H.

Referenced by findPeaks(), getMaskedMinMaxAvg(), BitObject::reset(), segmentLandmark(), segmentObject(), segmentObjectClean(), and ViewPort3D::triangulate().

template<class T >
Point2D< T > centroid ( const std::vector< Point2D< T > > &  polygon  )  [inline]

Where is the center of mass of a polygon?

Definition at line 429 of file Point2D.H.

template<class T >
void convertFromString ( const std::string str,
Point2D< T > &  val 
) [inline]

Point2D<T> overload: format is "<i>,<j>".

Definition at line 60 of file Point2D.C.

References Point2D< T >::i, conversion_error::raise(), and split().

template<class T >
std::string convertToString ( const Point2D< T > &  val  )  [inline]

Point2D<T> overload: format is "<i>,<j>".

Definition at line 54 of file Point2D.C.

References Point2D< T >::i.

template<class T , class U >
bool operator!= ( const Point2D< T > &  p1,
const Point2D< U > &  p2 
) [inline]

!= operator

Definition at line 332 of file Point2D.H.

References Point2D< T >::i.

template<class T , class U >
bool operator< ( const Point2D< T > &  p1,
const Point2D< U > &  p2 
) [inline]

< operator

Definition at line 342 of file Point2D.H.

template<class T , class U >
bool operator== ( const Point2D< T > &  p1,
const Point2D< U > &  p2 
) [inline]

== operator

Definition at line 327 of file Point2D.H.

References Point2D< T >::i.

template<class T , class U >
bool operator> ( const Point2D< T > &  p1,
const Point2D< U > &  p2 
) [inline]

> operator

Definition at line 337 of file Point2D.H.

References Point2D< T >::i.

template<class T >
bool pnpoly ( const std::vector< Point2D< T > > &  polygon,
const Point2D< T > &  p 
) [inline]

Is a point inside a polygon?

Definition at line 412 of file Point2D.H.

References Point2D< T >::i.

Referenced by TestImages::getAllObjMask(), and TestImages::getObjFromPos().

template<class T >
bool pnTriangle ( const Point2D< T > &  A,
const Point2D< T > &  B,
const Point2D< T > &  C,
const Point2D< T > &  P 
) [inline]

determine if a point P is inside a triangle with vertices A,B,C

Definition at line 468 of file Point2D.H.

References Point2D< T >::i.

Generated on Sun May 8 08:42:42 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3