Smolgui
Immediate gui library based on SFML
Loading...
Searching...
No Matches
Polygon.h File Reference
#include <cmath>
#include "sgui/Core/Shapes.h"
#include "sgui/Core/Polygon.tpp"
Include dependency graph for Polygon.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sgui::Polygon< N >
 Polygon is a series of N points, ranged in clock-wise order and that form a convex shape. More...

Namespaces

namespace  sgui

Typedefs

using sgui::Tetragon = Polygon <4>
using sgui::Hexagon = Polygon <6>
using sgui::Octogon = Polygon <8>

Functions

template<size_t N>
Polygon< N > sgui::makeRegularPolygon (const sf::Vector2f &center, const float size)
 make a regular polygon, like hexagon or octogon, around a center
template<size_t N>
constexpr sf::Vector2f sgui::centroid (const Polygon< N > &polygon)
 Return center of polygon.
template<size_t N>
constexpr sf::FloatRect sgui::boundingBox (const Polygon< N > &polygon)
 Return a box that bounds polygon.