Visual Servoing Platform
version 3.4.0
|
#include <vpTriangle.h>
Public Member Functions | |
vpTriangle () | |
vpTriangle (const vpTriangle &tri) | |
virtual | ~vpTriangle () |
vpTriangle & | operator= (const vpTriangle &tri) |
vpTriangle (const vpImagePoint &iP1, const vpImagePoint &iP2, const vpImagePoint &iP3) | |
void | buildFrom (const vpImagePoint &iP1, const vpImagePoint &iP2, const vpImagePoint &iP3) |
bool | inTriangle (const vpImagePoint &iP, double threshold=0.00001) |
void | getTriangleApexes (vpImagePoint &iP1, vpImagePoint &iP2, vpImagePoint &iP3) const |
double | getArea () const |
Defines a 2D triangle.
A triangle is internally represented by three 2D points.
By default the three coordinates in the frame (see vpImagePoint class documentation for more details about the frame.) are , and .
Definition at line 58 of file vpTriangle.h.
vpTriangle::vpTriangle | ( | ) |
Basic constructor.
By default, the three 2D points coordinates which define the triangle are , and .
Definition at line 49 of file vpTriangle.cpp.
vpTriangle::vpTriangle | ( | const vpTriangle & | tri | ) |
Copy constructor
tri | : The triangle used for the initialisation. |
Definition at line 76 of file vpTriangle.cpp.
|
virtual |
Basic destructor
Definition at line 86 of file vpTriangle.cpp.
vpTriangle::vpTriangle | ( | const vpImagePoint & | iP1, |
const vpImagePoint & | iP2, | ||
const vpImagePoint & | iP3 | ||
) |
Constructor which initialise the triangle thanks to the three 2D points , and
iP1 | : The first apex of the triangle. |
iP2 | : The first apex of the triangle. |
iP3 | : The first apex of the triangle. |
Definition at line 64 of file vpTriangle.cpp.
void vpTriangle::buildFrom | ( | const vpImagePoint & | iP1, |
const vpImagePoint & | iP2, | ||
const vpImagePoint & | iP3 | ||
) |
Initialise the triangle thanks to the three 2D points , and
iP1 | : The first apex of the triangle. |
iP2 | : The first apex of the triangle. |
iP3 | : The first apex of the triangle. |
Definition at line 116 of file vpTriangle.cpp.
References vpMatrix::det(), vpImagePoint::get_i(), vpImagePoint::get_j(), and vpMatrix::inverseByLU().
|
inline |
Return the area of the triangle. The area is computed when the triangle is built from three image points.
Definition at line 107 of file vpTriangle.h.
|
inline |
Get the apexes of the triangle.
iP1 | : first apex. |
iP2 | : second apex. |
iP3 | : third apex. |
Definition at line 94 of file vpTriangle.h.
bool vpTriangle::inTriangle | ( | const vpImagePoint & | iP, |
double | threshold = 0.00001 |
||
) |
Check if the 2D point is inside the triangle.
iP | : The point which coulb be inside the triangle. |
threshold | : A threshold used to define the accuracy of the computation when the point is very near from the edges of the triangle. 0 is the smallest value. |
Definition at line 162 of file vpTriangle.cpp.
References vpImagePoint::get_i(), and vpImagePoint::get_j().
vpTriangle & vpTriangle::operator= | ( | const vpTriangle & | tri | ) |
Assign tri to this triangle and return a reference to this triangle.
Definition at line 91 of file vpTriangle.cpp.