API Documentation
Loading...
Searching...
No Matches
Polygon< t_type, t_vertex > Class Template Reference

An N-sided polygon. More...

#include <Polygon.hpp>

Public Member Functions

void add (const t_vertex &vertex)
 
void addVertices (const t_vertex *vertices, uint04 size)
 
template<class t_new_type , class t_new_vertex_type = Vertex<2, t_new_type>>
Polygon< t_new_type, t_new_vertex_type > as () const
 
decltype(auto) begin ()
 
decltype(auto) begin () const
 
decltype(auto) begin (uint04 index)
 
decltype(auto) begin (uint04 index) const
 
Bounds< 2, t_type, t_vertex > bounds () const
 
void clear ()
 
Polygon clip (const Bounds< t_vertex::NumberOfDimensions(), t_type > &bounds) const
 
template<class t_precision >
IntersectionTypes contains (const Bounds< 2, t_type, t_vertex > &o_bounds) const
 
template<class t_precision >
IntersectionTypes contains (const LineSegment< 2, t_type, t_vertex > &line) const
 
template<class t_precision , class t_other_vertex >
IntersectionTypes contains (const Polygon< t_type, t_other_vertex > &poly) const
 
template<class t_precision >
IntersectionTypes contains (const Triangle< 2, t_type, t_vertex > &tri) const
 
bool contains (const Vertex< 2, t_type > &vector) const
 
LineSegment< 2, t_type, t_vertex > edge (uint04 index) const
 
uint04 edgeCount () const
 
decltype(auto) end ()
 
decltype(auto) end () const
 
void flip ()
 
bool hasClockwiseWinding () const
 
void insert (uint04 index, const t_vertex &vertex)
 
bool isConvex () const
 
bool isEquivalent (const Polygon &polygon, fltp08 epsilon)
 
bool operator!= (const Polygon &polygon) const
 
Polygonoperator= (const Polygon &poly)
 
Polygonoperator= (Polygon &&poly)
 
bool operator== (const Polygon &polygon) const
 
Polygon opheimSimplification (t_type min_tol, t_type max_tol) const
 
t_type perimeter () const
 
Plane< 3, t_type > plane () const
 
 Polygon ()
 
 Polygon (Buffer< t_vertex > &vertices)
 
 Polygon (const Buffer< Vertex< 3, fltp08 > > &points)
 
 Polygon (const Polygon &polygon)
 
 Polygon (Polygon &&polygon) noexcept
 
 Polygon (uint04 allocated_size)
 
void remove (uint04 index)
 
void replace (uint04 index, const t_vertex &vector)
 
void setPlane (const Plane< 3, t_type > &plane)
 
void setVertices (const Buffer< t_vertex > &vertices)
 
void simplify ()
 
bool validate () const
 
const t_vertex & vertex (uint04 index) const
 
uint04 vertexCount () const
 
const Buffer< t_vertex > & vertices () const
 

Detailed Description

template<class t_type, class t_vertex = Vertex<2, t_type>>
class NDEVR::Polygon< t_type, t_vertex >

An N-sided polygon.


Class: Polygon

Author: Tyler Parke

Date: 2017-11-19

Constructor & Destructor Documentation

◆ Polygon() [1/6]

template<class t_type , class t_vertex = Vertex<2, t_type>>
Polygon ( )
inline

◆ Polygon() [2/6]

template<class t_type , class t_vertex = Vertex<2, t_type>>
Polygon ( const Polygon< t_type, t_vertex > & polygon)
inline

◆ Polygon() [3/6]

template<class t_type , class t_vertex = Vertex<2, t_type>>
Polygon ( Polygon< t_type, t_vertex > && polygon)
inlinenoexcept

◆ Polygon() [4/6]

template<class t_type , class t_vertex = Vertex<2, t_type>>
Polygon ( Buffer< t_vertex > & vertices)
inlineexplicit

◆ Polygon() [5/6]

template<class t_type , class t_vertex = Vertex<2, t_type>>
Polygon ( const Buffer< Vertex< 3, fltp08 > > & points)
inlineexplicit

◆ Polygon() [6/6]

template<class t_type , class t_vertex = Vertex<2, t_type>>
Polygon ( uint04 allocated_size)
inlineexplicit

Member Function Documentation

◆ add()

template<class t_type , class t_vertex = Vertex<2, t_type>>
void add ( const t_vertex & vertex)
inline

Adds vertex.

Author: Tyler Parke

Date: 2017-11-19

Parameters: vertex - The vertex to add.

◆ addVertices()

template<class t_type , class t_vertex = Vertex<2, t_type>>
void addVertices ( const t_vertex * vertices,
uint04 size )
inline

◆ as()

template<class t_type , class t_vertex = Vertex<2, t_type>>
template<class t_new_type , class t_new_vertex_type = Vertex<2, t_new_type>>
Polygon< t_new_type, t_new_vertex_type > as ( ) const
inline

Gets as.

Author: Tyler Parke

Date: 2017-11-19

Returns
A Polygon<t_new_type,t_new_vertex_type>

◆ begin() [1/4]

template<class t_type , class t_vertex = Vertex<2, t_type>>
decltype(auto) begin ( )
inline

◆ begin() [2/4]

template<class t_type , class t_vertex = Vertex<2, t_type>>
decltype(auto) begin ( ) const
inline

◆ begin() [3/4]

template<class t_type , class t_vertex = Vertex<2, t_type>>
decltype(auto) begin ( uint04 index)
inline

◆ begin() [4/4]

template<class t_type , class t_vertex = Vertex<2, t_type>>
decltype(auto) begin ( uint04 index) const
inline

◆ bounds()

template<class t_type , class t_vertex = Vertex<2, t_type>>
Bounds< 2, t_type, t_vertex > bounds ( ) const
inline

Gets the bounds.

Author: Tyler Parke

Date: 2017-11-19

Returns
A Bounds<2,t_type>

◆ clear()

template<class t_type , class t_vertex = Vertex<2, t_type>>
void clear ( )
inline

Clears this object to its blank/initial state.

Author: Tyler Parke

Date: 2017-11-19

◆ clip()

template<class t_type , class t_vertex = Vertex<2, t_type>>
Polygon clip ( const Bounds< t_vertex::NumberOfDimensions(), t_type > & bounds) const
inline

◆ contains() [1/5]

template<class t_type , class t_vertex = Vertex<2, t_type>>
template<class t_precision >
IntersectionTypes contains ( const Bounds< 2, t_type, t_vertex > & o_bounds) const
inline

Determines if this collection contains a given object.

Author: Tyler Parke

Date: 2017-11-19

Parameters: bounds - The const Bounds<2,t_type,t_vertex>& to test for containment.

Returns
The IntersectionTypes.

◆ contains() [2/5]

template<class t_type , class t_vertex = Vertex<2, t_type>>
template<class t_precision >
IntersectionTypes contains ( const LineSegment< 2, t_type, t_vertex > & line) const
inline

◆ contains() [3/5]

template<class t_type , class t_vertex = Vertex<2, t_type>>
template<class t_precision , class t_other_vertex >
IntersectionTypes contains ( const Polygon< t_type, t_other_vertex > & poly) const
inline

◆ contains() [4/5]

template<class t_type , class t_vertex = Vertex<2, t_type>>
template<class t_precision >
IntersectionTypes contains ( const Triangle< 2, t_type, t_vertex > & tri) const
inline

Determines if this collection contains a given object.

Author: Tyler Parke

Date: 2017-11-19

Parameters: tri - The const Triangle<2,t_type,t_vertex>& to test for containment.

Returns
The IntersectionTypes.

◆ contains() [5/5]

template<class t_type , class t_vertex = Vertex<2, t_type>>
bool contains ( const Vertex< 2, t_type > & vector) const
inline

Query if this object contains the given vector.

Author: Tyler Parke

Date: 2017-11-19

Parameters: vector - The const t_vertex& to test for containment.

Returns
True if the object is in this collection, false if not.

◆ edge()

template<class t_type , class t_vertex = Vertex<2, t_type>>
LineSegment< 2, t_type, t_vertex > edge ( uint04 index) const
inline

Edges the given index.

Author: Tyler Parke

Date: 2017-11-19

Parameters: index - Zero-based index of the.

Returns
A LineSegment<2,t_type,t_vertex>

◆ edgeCount()

template<class t_type , class t_vertex = Vertex<2, t_type>>
uint04 edgeCount ( ) const
inline

Edge count.

Author: Tyler Parke

Date: 2017-11-19

Returns
An uint04.

◆ end() [1/2]

template<class t_type , class t_vertex = Vertex<2, t_type>>
decltype(auto) end ( )
inline

◆ end() [2/2]

template<class t_type , class t_vertex = Vertex<2, t_type>>
decltype(auto) end ( ) const
inline

◆ flip()

template<class t_type , class t_vertex = Vertex<2, t_type>>
void flip ( )
inline

◆ hasClockwiseWinding()

template<class t_type , class t_vertex = Vertex<2, t_type>>
bool hasClockwiseWinding ( ) const
inline

◆ insert()

template<class t_type , class t_vertex = Vertex<2, t_type>>
void insert ( uint04 index,
const t_vertex & vertex )
inline

Inserts.

Author: Tyler Parke

Date: 2017-11-19

Parameters: index - Zero-based index of the. vertex - The vertex.

◆ isConvex()

template<class t_type , class t_vertex = Vertex<2, t_type>>
bool isConvex ( ) const
inline

◆ isEquivalent()

template<class t_type , class t_vertex = Vertex<2, t_type>>
bool isEquivalent ( const Polygon< t_type, t_vertex > & polygon,
fltp08 epsilon )
inline

◆ operator!=()

template<class t_type , class t_vertex = Vertex<2, t_type>>
bool operator!= ( const Polygon< t_type, t_vertex > & polygon) const
inline

◆ operator=() [1/2]

template<class t_type , class t_vertex = Vertex<2, t_type>>
Polygon & operator= ( const Polygon< t_type, t_vertex > & poly)
inline

◆ operator=() [2/2]

template<class t_type , class t_vertex = Vertex<2, t_type>>
Polygon & operator= ( Polygon< t_type, t_vertex > && poly)
inline

◆ operator==()

template<class t_type , class t_vertex = Vertex<2, t_type>>
bool operator== ( const Polygon< t_type, t_vertex > & polygon) const
inline

Equality operator.

Author: Tyler Parke

Date: 2017-11-19

Parameters: polygon - The polygon.

Returns
True if the parameters are considered equivalent.

◆ opheimSimplification()

template<class t_type , class t_vertex = Vertex<2, t_type>>
Polygon opheimSimplification ( t_type min_tol,
t_type max_tol ) const
inline

◆ perimeter()

template<class t_type , class t_vertex = Vertex<2, t_type>>
t_type perimeter ( ) const
inline

Gets the perimeter.

Author: Tyler Parke

Date: 2017-11-19

Returns
A t_type.

◆ plane()

template<class t_type , class t_vertex = Vertex<2, t_type>>
Plane< 3, t_type > plane ( ) const
inline

◆ remove()

template<class t_type , class t_vertex = Vertex<2, t_type>>
void remove ( uint04 index)
inline

Removes the given index.

Author: Tyler Parke

Date: 2017-11-19

Parameters: index - The index to removeRows.

◆ replace()

template<class t_type , class t_vertex = Vertex<2, t_type>>
void replace ( uint04 index,
const t_vertex & vector )
inline

Replaces.

Author: Tyler Parke

Date: 2017-11-19

Parameters: index - Zero-based index of the. vector - The vector.

◆ setPlane()

template<class t_type , class t_vertex = Vertex<2, t_type>>
void setPlane ( const Plane< 3, t_type > & plane)
inline

◆ setVertices()

template<class t_type , class t_vertex = Vertex<2, t_type>>
void setVertices ( const Buffer< t_vertex > & vertices)
inline

Sets the vertices.

Author: Tyler Parke

Date: 2017-11-19

Parameters: vertices - The vertices.

◆ simplify()

template<class t_type , class t_vertex = Vertex<2, t_type>>
void simplify ( )
inline

Removes all duplicate adjacent vertices.

Author: Tyler Parke

Date: 2017-05-16

Parameters: index - The index to removeRows.

◆ validate()

template<class t_type , class t_vertex = Vertex<2, t_type>>
bool validate ( ) const
inline

◆ vertex()

template<class t_type , class t_vertex = Vertex<2, t_type>>
const t_vertex & vertex ( uint04 index) const
inline

Vertices the given index.

Author: Tyler Parke

Date: 2017-11-19

Parameters: index - Zero-based index of the.

Returns
A reference to a const t_vertex.

◆ vertexCount()

template<class t_type , class t_vertex = Vertex<2, t_type>>
uint04 vertexCount ( ) const
inline

Vertex count.

Author: Tyler Parke

Date: 2017-11-19

Returns
An uint04.

◆ vertices()

template<class t_type , class t_vertex = Vertex<2, t_type>>
const Buffer< t_vertex > & vertices ( ) const
inline

Gets the vertices.

Author: Tyler Parke

Date: 2017-11-19

Returns
A reference to a const Buffer<t_vertex>

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