VICUS Library
Documentation of Vicus library
Loading...
Searching...
No Matches
VICUS::Polygon3D Class Reference

#include <VICUS_Polygon3D.h>

Inheritance diagram for VICUS::Polygon3D:
[legend]

Public Member Functions

 Polygon3D ()=default
 
 Polygon3D (const IBKMK::Polygon3D &poly3D)
 
 Polygon3D (IBKMK::Polygon2D::type_t t, const IBKMK::Vector3D &a, const IBKMK::Vector3D &b, const IBKMK::Vector3D &c)
 
 Polygon3D (const IBKMK::Polygon2D &p2d, const IBKMK::Vector3D &offset, const IBKMK::Vector3D &normal, const IBKMK::Vector3D &xAxis)
 
 Polygon3D (const std::vector< IBKMK::Vector3D > &vertexes)
 
void readXML (const TiXmlElement *element)
 
TiXmlElement * writeXML (TiXmlElement *parent) const
 

Detailed Description

Class Polygon3D stores a planar polygon in 3D space. This class merely wraps IBKMK::Polygon3D and provides read/write functionality.

Constructor & Destructor Documentation

◆ Polygon3D() [1/5]

VICUS::Polygon3D::Polygon3D ( )
default

◆ Polygon3D() [2/5]

VICUS::Polygon3D::Polygon3D ( const IBKMK::Polygon3D &  poly3D)
inlineexplicit

Conversion constructor

◆ Polygon3D() [3/5]

VICUS::Polygon3D::Polygon3D ( IBKMK::Polygon2D::type_t  t,
const IBKMK::Vector3D &  a,
const IBKMK::Vector3D &  b,
const IBKMK::Vector3D &  c 
)
inline

Initializing constructor. Vertexes a, b and c must be given in counter-clockwise order, so that (b-a) x (c-a) yields the normal vector of the plane. If t is Polygon2D::T_Rectangle, vertex c actually corresponds to vertex d of the rectangle, and vertex c is computed internally.

◆ Polygon3D() [4/5]

VICUS::Polygon3D::Polygon3D ( const IBKMK::Polygon2D &  p2d,
const IBKMK::Vector3D &  offset,
const IBKMK::Vector3D &  normal,
const IBKMK::Vector3D &  xAxis 
)
inline

Constructs a polygon from 2D polygon with normal vector, xaxis and offset.

◆ Polygon3D() [5/5]

VICUS::Polygon3D::Polygon3D ( const std::vector< IBKMK::Vector3D > &  vertexes)
inline

Constructs a polygon from a 3D polyline (which might be invalid in any number of ways). The normal vector will be deduced from rotation direction of the polygon, and the x-axis vector will be the vector from first to second vertex at a suitable (automatically selected) vertex of the polygon.

Note
Once all collinear points have been removed the offset point will be the first vertex of the polygon. Use offset() to retrieve the offset.

Member Function Documentation

◆ readXML()

void VICUS::Polygon3D::readXML ( const TiXmlElement *  element)

◆ writeXML()

TiXmlElement * VICUS::Polygon3D::writeXML ( TiXmlElement *  parent) const

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