8#include "point_3d_h.hpp"
16 using IsPolygonPoint = std::integral_constant<bool, (std::is_same<Point3D<typename T::ValueType>, T>::value
17 || std::is_same<Point3DH<typename T::ValueType>, T>::value)
18 && std::is_floating_point<typename T::ValueType>::value>;
21 using EnablePolygonPoint = std::enable_if<IsPolygonPoint<T>::value>;
26 template <
class T,
class ENABLE =
void>
31 static_assert(IsPolygonPoint<T>::value,
"CVB: Polygon type must be Point3D or Point3DH with floating point type");
35 class Polygon3D<T, typename EnablePolygonPoint<T>::type> final
55 : points_(std::move(points))
77 template <std::
size_t N>
80 static_assert(N >= 3,
"CVB: Poligon3D must have at least three points");
92 return points_[index];
103 return points_.at(index);
113 return points_.size();
123 return points_.cbegin();
163 return points_.cend();
203 return points_.crbegin();
243 return points_.crend();
284 return points_ == polygon.points_;
295 return !(*
this == polygon);
300 explicit operator Polygon3D<C>() const noexcept
303 points.reserve(points_.size());
304 for (
const auto &point : points_)
305 points.emplace_back(
static_cast<C
>(point));
300 explicit operator Polygon3D<C>() const noexcept {
…}
27 class Polygon3D final {
…};
A polygon in 3D space.
Definition polygon_3d.hpp:28
auto Begin() const noexcept
Iterator access.
Definition polygon_3d.hpp:131
auto CREnd() const noexcept
Iterator access.
Definition polygon_3d.hpp:241
auto end() const noexcept
Iterator access.
Definition polygon_3d.hpp:191
Polygon3D(const std::vector< T > &points) noexcept
Construct a polygon from a vector.
Definition polygon_3d.hpp:67
auto rbegin() const noexcept
Iterator access.
Definition polygon_3d.hpp:231
auto REnd() const noexcept
Iterator access.
Definition polygon_3d.hpp:251
auto cend() const noexcept
Iterator access.
Definition polygon_3d.hpp:181
const T & At(std::size_t index) const
Gets the point ata given index.
Definition polygon_3d.hpp:101
auto CRBegin() const noexcept
Iterator access.
Definition polygon_3d.hpp:201
const T & operator[](std::size_t index) const noexcept
Gets the point at a given index.
Definition polygon_3d.hpp:90
auto crend() const noexcept
Iterator access.
Definition polygon_3d.hpp:261
auto crbegin() const noexcept
Iterator access.
Definition polygon_3d.hpp:221
auto begin() const noexcept
Iterator access.
Definition polygon_3d.hpp:151
auto RBegin() const noexcept
Iterator access.
Definition polygon_3d.hpp:211
bool operator!=(const Polygon3D< T > &polygon) const noexcept
Compares to an other polygon.
Definition polygon_3d.hpp:293
Polygon3D(const T(&list)[N]) noexcept
Construct a polygon with an initializer list.
Definition polygon_3d.hpp:78
bool operator==(const Polygon3D< T > &polygon) const noexcept
Compares to an other polygon.
Definition polygon_3d.hpp:282
auto CBegin() const noexcept
Iterator access.
Definition polygon_3d.hpp:121
auto End() const noexcept
Iterator access.
Definition polygon_3d.hpp:171
Polygon3D(std::vector< T > &&points)
Construct a polygon from a vector.
Definition polygon_3d.hpp:54
std::size_t NumPoints() const noexcept
Gets the number of points in this polygon.
Definition polygon_3d.hpp:111
auto rend() const noexcept
Iterator access.
Definition polygon_3d.hpp:271
auto CEnd() const noexcept
Iterator access.
Definition polygon_3d.hpp:161
auto cbegin() const noexcept
Iterator access.
Definition polygon_3d.hpp:141
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17