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

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

Fn: void Polygon::add(const t_vertex& vertex)

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

Fn: Polygon<t_new_type, t_new_vertex_type> Polygon::as() const

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

Fn: Bounds<2, t_type> Polygon::bounds() const

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

Fn: void Polygon::clear()

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

Fn: IntersectionTypes Polygon::contains(const Bounds<2, t_type, t_vertex>& bounds) const

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

Fn: IntersectionTypes Polygon::contains(const Triangle<2, t_type, t_vertex>& tri) const

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

Fn: bool Polygon::contains(const t_vertex& vector) const

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

Fn: LineSegment<2, t_type, t_vertex> Polygon::edge(uint04 index) const

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

Fn: inline uint04 Polygon::edgeCount() const

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

Fn: void Polygon::insert(uint04 index, const t_vertex& vertex)

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

Fn: bool Polygon::operator==(const Polygon& polygon) const

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

Fn: t_type Polygon::perimeter() const

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

Fn: void Polygon::removeRows(uint04 index)

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

Fn: void Polygon::replace(uint04 index, const t_vertex& vector)

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

Fn: inline void Polygon::setVertices(const Buffer<t_vertex>& vertices)

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

Fn: void Polygon::simplify()

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

Fn: const t_vertex& Polygon::vertex(uint04 index) const

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

Fn: inline uint04 Polygon::visibleVertexCount() const

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

Fn: inline const Buffer<t_vertex>& Polygon::vertices() const

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: