AMCAX Kernel 1.0.0.0
AMCAX::Polygon2 Class Reference

The polygon in 2D. More...

#include <math/Polygon2.hpp>

Public Member Functions

AMCAX_API Polygon2 (int nv)
 Construct with a specified number of vertices. More...
 
AMCAX_API Polygon2 (const std::vector< Point2 > &verts)
 Construct from a vector of vertices. More...
 
AMCAX_API double Deflection () const
 Get the deflection. More...
 
AMCAX_API void SetDeflection (double def)
 Set the deflection. More...
 
AMCAX_API int NVertices () const
 Get the number of vertices. More...
 
AMCAX_API const std::vector< Point2 > & Vertices () const
 Get the vertices. More...
 
AMCAX_API std::vector< Point2 > & Vertices ()
 Get the vertices. More...
 

Friends

AMCAX_API friend std::ostream & operator<< (std::ostream &os, const Polygon2 &poly)
 Write the polygon. More...
 
AMCAX_API friend std::istream & operator>> (std::istream &is, Polygon2 &poly)
 Read the polygon. More...
 

Detailed Description

The polygon in 2D.

If the polygon is closed, the first point and the last point coincide.

Constructor & Destructor Documentation

◆ Polygon2() [1/2]

AMCAX_API AMCAX::Polygon2::Polygon2 ( int  nv)
explicit

Construct with a specified number of vertices.

Parameters
nvThe number of vertices

◆ Polygon2() [2/2]

AMCAX_API AMCAX::Polygon2::Polygon2 ( const std::vector< Point2 > &  verts)
explicit

Construct from a vector of vertices.

Parameters
vertsThe vertices

Member Function Documentation

◆ Deflection()

AMCAX_API double AMCAX::Polygon2::Deflection ( ) const

Get the deflection.

Returns
The deflection

◆ NVertices()

AMCAX_API int AMCAX::Polygon2::NVertices ( ) const

Get the number of vertices.

Returns
The number of vertices

◆ SetDeflection()

AMCAX_API void AMCAX::Polygon2::SetDeflection ( double  def)

Set the deflection.

Parameters
defThe deflection

◆ Vertices() [1/2]

AMCAX_API std::vector< Point2 > & AMCAX::Polygon2::Vertices ( )

Get the vertices.

Returns
The vertices

◆ Vertices() [2/2]

AMCAX_API const std::vector< Point2 > & AMCAX::Polygon2::Vertices ( ) const

Get the vertices.

Returns
The vectices

Friends And Related Function Documentation

◆ operator<<

AMCAX_API friend std::ostream & operator<< ( std::ostream &  os,
const Polygon2 poly 
)
friend

Write the polygon.

Parameters
osThe output stream
polyThe polygon
Returns
The output stream

◆ operator>>

AMCAX_API friend std::istream & operator>> ( std::istream &  is,
Polygon2 poly 
)
friend

Read the polygon.

Parameters
isThe input stream
polyThe polygon
Returns
The input stream

The documentation for this class was generated from the following file: