Visual Servoing Platform
version 3.6.1 under development (2024-12-12)
|
#include <visp3/core/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) | |
vpTriangle & | 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 53 of file vpTriangle.h.
BEGIN_VISP_NAMESPACE vpTriangle::vpTriangle | ( | ) |
Basic constructor.
By default, the three 2D points coordinates which define the triangle are , and .
Definition at line 46 of file vpTriangle.cpp.
vpTriangle::vpTriangle | ( | const vpTriangle & | tri | ) |
Copy constructor
tri | : The triangle used for the initialisation. |
Definition at line 73 of file vpTriangle.cpp.
|
virtual |
Basic destructor
Definition at line 83 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 61 of file vpTriangle.cpp.
vpTriangle & 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 113 of file vpTriangle.cpp.
|
inline |
Return the area of the triangle. The area is computed when the triangle is built from three image points.
Definition at line 102 of file vpTriangle.h.
|
inline |
Get the apexes of the triangle.
iP1 | : first apex. |
iP2 | : second apex. |
iP3 | : third apex. |
Definition at line 89 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 161 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 88 of file vpTriangle.cpp.