To store and treat a polygonal figure. More...
Public Member Functions | |
polygon () | |
Default constructor. | |
Polygon (const Vect< Point< real_t > > &v, int code=1) | |
Constructor. More... | |
void | setVertices (const Vect< Point< real_t > > &v) |
Assign vertices of polygon. More... | |
real_t | getSignedDistance (const Point< real_t > &p) const |
Return signed distance of a given point from the current polygon. More... | |
Polygon & | operator+= (Point< real_t > a) |
Operator +=. More... | |
Polygon & | operator+= (real_t a) |
Operator *=. More... | |
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. More... | |
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. More... | |
To store and treat a polygonal figure.
Constructor.
[in] | v | Vect instance containing list of coordinates of polygon vertices |
[in] | code | Code to assign to the generated domain (Default value = 1) |
Return signed distance of a given point from the current polygon.
The computed distance is negative if p
lies in the polygon, negative if it is outside, and 0 on its boundary
[in] | p | Point<double> instance |
Reimplemented from Figure.