(9)

To store and treat a polygonal figure. More...

Inheritance diagram for Polygon:
Figure

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...
 
Polygonoperator+= (Point< real_t > a)
 Operator +=. More...
 
Polygonoperator+= (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.
 
Figureoperator= (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...
 

Detailed Description

To store and treat a polygonal figure.

Constructor & Destructor Documentation

◆ Polygon()

Polygon ( const Vect< Point< real_t > > &  v,
int  code = 1 
)

Constructor.

Parameters
[in]vVect instance containing list of coordinates of polygon vertices
[in]codeCode to assign to the generated domain (Default value = 1)

Member Function Documentation

◆ getSignedDistance()

real_t getSignedDistance ( const Point< real_t > &  p) const
virtual

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

Parameters
[in]pPoint<double> instance

Reimplemented from Figure.

◆ operator+=() [1/2]

Polygon& operator+= ( Point< real_t a)

Operator +=.

Translate polygon by a vector a

◆ operator+=() [2/2]

Polygon& operator+= ( real_t  a)

Operator *=.

Scale polygon by a factor a

◆ setVertices()

void setVertices ( const Vect< Point< real_t > > &  v)

Assign vertices of polygon.

Parameters
[in]vVector containing vertices coordinates in counter clockwise order