(9)

To store and treat a figure (or shape) information. More...

Inheritance diagram for Figure:
Brick Circle Ellipse Polygon Rectangle Sphere Triangle

Public Member Functions

 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.
 
virtual real_t getSignedDistance (const Point< real_t > &p) const
 Return signed distance from a given point to current figure. More...
 
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 figure (or shape) information.

This class is essentially useful to construct data for mesh generators and for distance calculations.

Author
Rachid Touzani

Member Function Documentation

◆ dLine()

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.

Parameters
[in]pPoint for which distance is computed
[in]aFirst vertex of line
[in]bSecond vertex of line
Returns
Signed distance

◆ getSignedDistance() [1/2]

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

Return signed distance from a given point to current figure.

Parameters
[in]pPoint instance from which distance is computed

Reimplemented in Polygon, Triangle, Ellipse, Sphere, Circle, Brick, and Rectangle.

◆ getSignedDistance() [2/2]

void getSignedDistance ( const Grid g,
Vect< real_t > &  d 
) const

Calculate signed distance to current figure with respect to grid points.

Parameters
[in]gGrid instance
[in]dVect instance containing calculated distance from each grid index to Figure
Remarks
Vector d doesn't need to be sized before invoking this function