To store and treat a triangle. More...
#include <Figure.h>
Public Member Functions | |
| Triangle () | |
| Default constructor. | |
| Triangle (const Point< real_t > &v1, const Point< real_t > &v2, const Point< real_t > &v3, int code=1) | |
| Constructor with vertices and code. | |
| void | setVertex1 (const Point< real_t > &v) |
| Assign first vertex of triangle. | |
| void | setVertex2 (const Point< real_t > &v) |
| Assign second vertex of triangle. | |
| void | setVertex3 (const Point< real_t > &v) |
| Assign third vertex of triangle. | |
| real_t | getSignedDistance (const Point< real_t > &p) const |
| Return signed distance of a given point from the current triangle. | |
| Triangle & | operator+= (Point< real_t > a) |
| Operator +=. | |
| Triangle & | operator+= (real_t a) |
| Operator *=. | |
| virtual real_t | getSignedDistance (const Point< real_t > &p) const |
| Return signed distance from a given point to current figure. | |
| void | getSignedDistance (const Grid &g, Vect< real_t > &d) const |
| Calculate signed distance to current figure with respect to grid points. | |
| real_t | dLine (const Point< real_t > &p, const Point< real_t > &a, const Point< real_t > &b) const |
| Compute signed distance from a line. | |
Public Member Functions inherited from Figure | |
| Figure () | |
| Default constructor. | |
| Figure (const Figure &f) | |
| Copy constructor. | |
| virtual | ~Figure () |
| Destructor. | |
| void | setCode (int code) |
| Choose a code for the domain defined by the figure. | |
| Figure & | operator= (const Figure &f) |
| Operator =. | |
| void | getSignedDistance (const Grid &g, Vect< real_t > &d) const |
| Calculate signed distance to current figure with respect to grid points. | |
| real_t | dLine (const Point< real_t > &p, const Point< real_t > &a, const Point< real_t > &b) const |
| Compute signed distance from a line. | |
To store and treat a triangle.
| Triangle | ( | ) |
Default constructor.
Constructs a unit triangle with vertices (0,0), (1,0) and (0,1)
| Triangle | ( | const Point< real_t > & | v1, |
| const Point< real_t > & | v2, | ||
| const Point< real_t > & | v3, | ||
| int | code = 1 |
||
| ) |
Constructor with vertices and code.
| [in] | v1 | Coordinates of first vertex of triangle |
| [in] | v2 | Coordinates of second vertex of triangle |
| [in] | v3 | Coordinates of third vertex of triangle |
| [in] | code | Code to assign to the generated figure [Default: 1] |
| real_t dLine | ( | const Point< real_t > & | p, |
| const Point< real_t > & | a, | ||
| const Point< real_t > & | b | ||
| ) | const |
Compute signed distance from a line.
| [in] | p | Point for which distance is computed |
| [in] | a | First vertex of line |
| [in] | b | Second vertex of line |
|
virtual |
|
virtual |
Return signed distance of a given point from the current triangle.
The computed distance is negative if p lies in the triangle, positive if it is outside, and 0 on its boundary
| [in] | p | Point<double> instance |
Reimplemented from Figure.
| Triangle & operator+= | ( | real_t | a | ) |
Operator *=.
Scale triangle by a factor a