#include <rpolygon.hpp>
|
| constexpr | RPolygon ()=default |
| | Default constructor.
|
| |
| constexpr auto | begin () const -> const_iterator |
| | Iterator to first vertex (the origin).
|
| |
| constexpr auto | end () const -> const_iterator |
| | Past-the-end iterator.
|
| |
| constexpr | RPolygon (Point< T > origin, std::vector< Vector2< T > > vecs) |
| | Constructs a new RPolygon object from origin and vectors.
|
| |
| constexpr | RPolygon (std::span< const Point< T > > pointset) |
| | Constructs a new RPolygon object from a set of points.
|
| |
| constexpr bool | operator== (const RPolygon &rhs) const |
| | Equality comparison operator.
|
| |
| constexpr bool | operator!= (const RPolygon &rhs) const |
| | Inequality comparison operator.
|
| |
| constexpr auto | operator+= (const Vector2< T > &vector_offset) -> RPolygon & |
| | Adds a vector to the origin of the rectilinear polygon.
|
| |
| constexpr auto | operator-= (const Vector2< T > &vector_offset) -> RPolygon & |
| | Subtracts a vector from the origin of the rectilinear polygon.
|
| |
| constexpr const Point< T > & | origin () const |
| | Gets the origin point of the polygon.
|
| |
| constexpr const std::vector< Vector2< T > > & | vectors () const |
| | Gets the displacement vectors of the polygon.
|
| |
| constexpr auto | vertices () const -> std::vector< Point< T > > |
| | Gets all vertices of the polygon as points.
|
| |
| constexpr auto | signed_area () const -> T |
| | Calculates the signed area of the rectilinear polygon.
|
| |
| constexpr auto | is_rectilinear () const -> bool |
| | Checks if the polygon is rectilinear (all edges are horizontal or vertical)
|
| |
◆ const_iterator
◆ RPolygon() [1/3]
◆ RPolygon() [2/3]
Constructs a new RPolygon object from origin and vectors.
- Parameters
-
| [in] | origin | The origin point of the polygon |
| [in] | vecs | Vector of displacement vectors from origin |
◆ RPolygon() [3/3]
Constructs a new RPolygon object from a set of points.
This constructor takes a std::span of Point<T> objects representing the vertices of the rectilinear polygon. The first point in the span is used as the origin of the polygon, and the remaining points are used to construct the vectors that define the edges of the polygon.
- Parameters
-
| [in] | pointset | A span of Point<T> objects representing the vertices of the rectilinear polygon. |
◆ begin()
Iterator to first vertex (the origin).
◆ end()
◆ is_rectilinear()
Checks if the polygon is rectilinear (all edges are horizontal or vertical)
◆ operator!=()
Inequality comparison operator.
◆ operator+=()
Adds a vector to the origin of the rectilinear polygon.
This method adds the given vector to the origin point of the rectilinear polygon, effectively translating the entire polygon by the specified vector.
- Parameters
-
| [in] | vector_offset | The vector to add to the origin. |
- Returns
- A reference to the modified RPolygon object.
◆ operator-=()
Subtracts a vector from the origin of the rectilinear polygon.
This method subtracts the given vector from the origin point of the rectilinear polygon, effectively translating the entire polygon by the negative of the specified vector.
- Parameters
-
| [in] | vector_offset | The vector to subtract from the origin. |
- Returns
- A reference to the modified RPolygon object.
◆ operator==()
Equality comparison operator.
◆ origin()
Gets the origin point of the polygon.
◆ signed_area()
Calculates the signed area of the rectilinear polygon.
This method calculates the signed area of the rectilinear polygon represented by this RPolygon object using the shoelace formula.
- Returns
- The signed area of the rectilinear polygon.
◆ vectors()
Gets the displacement vectors of the polygon.
◆ vertices()
Gets all vertices of the polygon as points.
The documentation for this class was generated from the following file: