AMCAX Kernel 1.0.0.0
AMCAX::Polygon3 Class Reference

Class of 3D polygon. More...

#include <math/Polygon3.hpp>

Public Member Functions

 Polygon3 ()=default
 Default constructor.
 
AMCAX_API Polygon3 (int nv, bool hasParams)
 Construct with a specified number of vertices. More...
 
AMCAX_API Polygon3 (const std::vector< Point3 > &verts)
 Construct from a vector of vertices. More...
 
AMCAX_API Polygon3 (const std::vector< Point3 > &verts, const std::vector< double > &params)
 Construct from a vector of vertices and a vector of parameters. More...
 
AMCAX_API std::shared_ptr< Polygon3Copy () const
 Copy the polygon. 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< Point3 > & Vertices () const
 Get the vertices. More...
 
AMCAX_API std::vector< Point3 > & Vertices ()
 Get the vertices. More...
 
AMCAX_API bool HasParameters () const
 Do the vertices have parameters. More...
 
AMCAX_API const std::vector< double > & Parameters () const
 Get the parameters. More...
 
AMCAX_API std::vector< double > & Parameters ()
 Get the parameters. More...
 

Friends

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

Detailed Description

Class of 3D polygon.

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

Constructor & Destructor Documentation

◆ Polygon3() [1/3]

AMCAX_API AMCAX::Polygon3::Polygon3 ( int  nv,
bool  hasParams 
)

Construct with a specified number of vertices.

Parameters
nvThe number of vertices
hasParamsDo the vertices have parameters

◆ Polygon3() [2/3]

AMCAX_API AMCAX::Polygon3::Polygon3 ( const std::vector< Point3 > &  verts)
explicit

Construct from a vector of vertices.

Parameters
vertsThe vertices

◆ Polygon3() [3/3]

AMCAX_API AMCAX::Polygon3::Polygon3 ( const std::vector< Point3 > &  verts,
const std::vector< double > &  params 
)

Construct from a vector of vertices and a vector of parameters.

Parameters
vertsThe vertices
paramsThe parameters

Member Function Documentation

◆ Copy()

AMCAX_API std::shared_ptr< Polygon3 > AMCAX::Polygon3::Copy ( ) const

Copy the polygon.

Returns
The copied polygon

◆ Deflection()

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

Get the deflection.

Returns
The deflection

◆ HasParameters()

AMCAX_API bool AMCAX::Polygon3::HasParameters ( ) const

Do the vertices have parameters.

Returns
True if the parameters are not null

◆ NVertices()

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

Get the number of vertices.

Returns
The number of vertices

◆ Parameters() [1/2]

AMCAX_API std::vector< double > & AMCAX::Polygon3::Parameters ( )

Get the parameters.

Returns
The parameters

◆ Parameters() [2/2]

AMCAX_API const std::vector< double > & AMCAX::Polygon3::Parameters ( ) const

Get the parameters.

Returns
The parameters

◆ SetDeflection()

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

Set the deflection.

Parameters
defThe deflection

◆ Vertices() [1/2]

AMCAX_API std::vector< Point3 > & AMCAX::Polygon3::Vertices ( )

Get the vertices.

Returns
The vertices

◆ Vertices() [2/2]

AMCAX_API const std::vector< Point3 > & AMCAX::Polygon3::Vertices ( ) const

Get the vertices.

Returns
The vertices

Friends And Related Function Documentation

◆ operator<<

AMCAX_API friend std::ostream & operator<< ( std::ostream &  os,
const Polygon3 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,
Polygon3 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: