
#include "Image/Dims.H"#include "Util/Promotions.H"#include "Util/log.H"#include <cmath>#include <string>#include <vector>
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 | |
A basic 2D point class
Definition in file Point2D.H.
| 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.
| 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().
| Point2D< T > centroid | ( | const std::vector< Point2D< T > > & | polygon | ) | [inline] |
| 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().
| 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.
| 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().
1.6.3