Sparkle 0.0.1
Loading...
Searching...
No Matches
spk::IPolygon< TVertex > Struct Template Reference

Stores vertex points and winding order for polygon triangulation. More...

#include <spk_polygon.hpp>

Collaboration diagram for spk::IPolygon< TVertex >:
Collaboration graph

Public Types

using Order = PolygonOrder
 Alias for polygon ordering enumeration.

Static Public Member Functions

static IPolygon< TVertex > makeTriangle (const TVertex &p_a, const TVertex &p_b, const TVertex &p_c)
 Creates a triangle polygon.
static IPolygon< TVertex > makeQuad (const TVertex &p_a, const TVertex &p_b, const TVertex &p_c, const TVertex &p_d, const PolygonOrder p_order=PolygonOrder::TriangleFanFromFirst)
 Creates a quad polygon.

Public Attributes

PolygonOrder order = PolygonOrder::TriangleFanFromFirst
 Polygon triangulation order.
std::vector< TVertex > points
 Polygon vertex points.

Detailed Description

template<typename TVertex>
struct spk::IPolygon< TVertex >

Stores vertex points and winding order for polygon triangulation.

Template Parameters
TVertexVertex type stored in the polygon.
static IPolygon< TVertex > makeTriangle(const TVertex &p_a, const TVertex &p_b, const TVertex &p_c)
Creates a triangle polygon.
Definition spk_polygon.hpp:46

Member Function Documentation

◆ makeQuad()

template<typename TVertex>
IPolygon< TVertex > spk::IPolygon< TVertex >::makeQuad ( const TVertex & p_a,
const TVertex & p_b,
const TVertex & p_c,
const TVertex & p_d,
const PolygonOrder p_order = PolygonOrder::TriangleFanFromFirst )
inlinestatic

Creates a quad polygon.

Parameters
p_aFirst vertex.
p_bSecond vertex.
p_cThird vertex.
p_dFourth vertex.
p_orderTriangulation order.
Returns
Quad polygon.
Here is the caller graph for this function:

◆ makeTriangle()

template<typename TVertex>
IPolygon< TVertex > spk::IPolygon< TVertex >::makeTriangle ( const TVertex & p_a,
const TVertex & p_b,
const TVertex & p_c )
inlinestatic

Creates a triangle polygon.

Parameters
p_aFirst vertex.
p_bSecond vertex.
p_cThird vertex.
Returns
Triangle polygon with triangle-fan order.
Here is the caller graph for this function:

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