Rasterfarm-SDK
Loading...
Searching...
No Matches
Polygon Class Reference

#include <polygon.h>

Inheritance diagram for Polygon:
VectorArray< Vector2f > VectorArray< Vector3f >

Public Member Functions

 Polygon ()
 
 Polygon (const Vertex2fArray &vertex)
 
float getArea () const
 
bool isClockWise () const
 
bool isConvex () const
 
 Polygon ()
 
 Polygon (const Vector3fArray &vertex)
 
 operator Primitive2D::Polygon ()
 
uint addVertex (const Vertex3f &v)
 
Vector4f getPlaneEquation () const
 
Vertex3f centroid () const
 
float getArea () const
 
float getBoundingRadius () const
 
Vertex3f normal () const
 
- Public Member Functions inherited from VectorArray< Vector2f >
 VectorArray (const HeapArray< U > &other)
 
 VectorArray (const VectorArray< U > &other)
 
 VectorArray (const Initializer< Vector2f > &list)
 
 VectorArray (size_t size=0)
 
 VectorArray (const typename HeapArray< Vector2f >::iterator &itBegin, const typename HeapArray< Vector2f >::iterator itEnd)
 
 VectorArray (size_t size, const Vector2f &init)
 
- Public Member Functions inherited from VectorArray< Vector3f >
 VectorArray (const HeapArray< U > &other)
 
 VectorArray (const VectorArray< U > &other)
 
 VectorArray (const Initializer< Vector3f > &list)
 
 VectorArray (size_t size=0)
 
 VectorArray (const typename HeapArray< Vector3f >::iterator &itBegin, const typename HeapArray< Vector3f >::iterator itEnd)
 
 VectorArray (size_t size, const Vector3f &init)
 

Static Public Member Functions

static bool isConvex (const Vertex2fArray &vertex)
 
static bool isMonotone (const Vertex2fArray &vertex)
 
static HeapArray< Vertex2fArraydecomposeNonConvexToMonotone (const Vertex2fArray &p)
 
static HeapArray< Vertex2fArraydecomposeMonotoneToConvex (const Vertex2fArray &polygon)
 
static HeapArray< Vertex2fArraydecomposeNonConvex (const Vertex2fArray &polygon)
 
static bool isPlanar (const Vertex3fArray &contour)
 
static QuaternionFloat orient (const Vector3f &normalFrom, const Vector3f &normalTo)
 
static QuaternionFloat transform2D (const Vector3f &normal)
 

Detailed Description

A closed, simple Polygon. NOTE: Polygons with holes can be decomposed using class ContourTessellation. Holes can be also be described analytically as Negative-Polygons or Anti-Polygons with contour orientations oppposite that of a Polygon. NOTE: Polygons that are self-intersecting can be detected using class ContourTessellation and decomposed into a set of Polygons.

A convex or closed polygon.

Constructor & Destructor Documentation

◆ Polygon() [1/4]

Polygon::Polygon ( )

◆ Polygon() [2/4]

Polygon::Polygon ( const Vertex2fArray & vertex)
Parameters
Anarray of vertices ordered by connected segments.

◆ Polygon() [3/4]

Polygon::Polygon ( )

◆ Polygon() [4/4]

Polygon::Polygon ( const Vector3fArray & vertex)
Parameters
Anarray of vertices ordered by connected segments.

Member Function Documentation

◆ addVertex()

uint Polygon::addVertex ( const Vertex3f & v)
Parameters
Vertexto add to this polygon.
Returns
The index of the vertex within Polygon::vertex.

◆ centroid()

Vertex3f Polygon::centroid ( ) const

◆ decomposeMonotoneToConvex()

static HeapArray< Vertex2fArray > Polygon::decomposeMonotoneToConvex ( const Vertex2fArray & polygon)
static
Parameters
Amonotone Polygon.
Returns
An array containing convex polygons.

◆ decomposeNonConvex()

static HeapArray< Vertex2fArray > Polygon::decomposeNonConvex ( const Vertex2fArray & polygon)
static
Parameters
Non-convexPolygon.
Returns
An array containing convex polygons.

◆ decomposeNonConvexToMonotone()

static HeapArray< Vertex2fArray > Polygon::decomposeNonConvexToMonotone ( const Vertex2fArray & p)
static
Parameters
Non-convexPolygon.
Returns
An array containing monotone polygons.

◆ getArea() [1/2]

float Polygon::getArea ( ) const
inline

The shoelace formula

◆ getArea() [2/2]

float Polygon::getArea ( ) const

◆ getBoundingRadius()

float Polygon::getBoundingRadius ( ) const

◆ getPlaneEquation()

Vector4f Polygon::getPlaneEquation ( ) const

◆ isClockWise()

bool Polygon::isClockWise ( ) const
inline

◆ isConvex() [1/2]

bool Polygon::isConvex ( ) const
inline

◆ isConvex() [2/2]

static bool Polygon::isConvex ( const Vertex2fArray & vertex)
static

◆ isMonotone()

static bool Polygon::isMonotone ( const Vertex2fArray & vertex)
static

A monotone-polygon is defined as a polygon with a single inner-curve regardless of axis. This means a given vertex orientations will change at most 2 times. NOTE: convex polygons are always monotone.

Parameters
APolygon contour with > 4 vertices.
Returns
True if the Polygon is monotone.

◆ isPlanar()

static bool Polygon::isPlanar ( const Vertex3fArray & contour)
static

◆ normal()

Vertex3f Polygon::normal ( ) const

◆ operator Primitive2D::Polygon()

Polygon::operator Primitive2D::Polygon ( )

◆ orient()

static QuaternionFloat Polygon::orient ( const Vector3f & normalFrom,
const Vector3f & normalTo )
static

Get the Quaternion delta required to rotate the Face from-and-to the given normal vectors.

Returns
Quaternion delta rotation.

◆ transform2D()

static QuaternionFloat Polygon::transform2D ( const Vector3f & normal)
static

Get the Quaternion delta required to rotate the Face onto the XY plane.

Returns
Quaternion delta rotation.

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