21#ifndef GF_POINT_SEQUENCE_H
22#define GF_POINT_SEQUENCE_H
29#include "SerializationFwd.h"
34#ifndef DOXYGEN_SHOULD_SKIP_THIS
64 template<
typename Iterator>
66 : m_points(first, last)
78 return m_points.empty();
87 m_points.push_back(point);
96 return m_points.size();
123 return m_points.
data();
134 return m_points.
data();
145 return m_points.
data() + m_points.size();
156 return m_points.
data() + m_points.size();
165 return m_points.front();
174 return m_points.back();
212 std::vector<Vector2f> m_points;
227#ifndef DOXYGEN_SHOULD_SKIP_THIS
A deserializer from a binary file.
Definition: Serialization.h:151
GF_CORE_API Deserializer & operator|(Deserializer &ar, PointSequence &sequence)
Deserialize a sequence.
A sequence of points.
Definition: PointSequence.h:44
const std::vector< Vector2f > & getRawPoints() const
Get the raw container of points.
Definition: PointSequence.h:207
PointSequence(Iterator first, Iterator last)
Constructor from points.
Definition: PointSequence.h:65
const Vector2f * end() const
Get an iterator past the last point.
Definition: PointSequence.h:144
Vector2f getPoint(std::size_t index) const
Get the i-th point of the sequence.
bool isEmpty() const
Check if the sequence is empty.
Definition: PointSequence.h:77
Vector2f * end()
Get an iterator past the last point.
Definition: PointSequence.h:155
std::vector< Vector2f > & getRawPoints()
Get the raw container of points.
Definition: PointSequence.h:200
std::size_t getPointCount() const
Get the number of points of the sequence.
Definition: PointSequence.h:95
Vector2f getLastPoint() const
Get the last point of the sequence.
Definition: PointSequence.h:173
PointSequence(Span< const Vector2f > points)
Constructor from an array.
PointSequence()=default
Default constructor.
Vector2f * begin()
Get an iterator to the first point.
Definition: PointSequence.h:133
Vector2f getFirstPoint() const
Get the first point of the sequence.
Definition: PointSequence.h:164
void reverse()
Reverse the points in the sequence.
void simplify(float distance=Epsilon)
Simplify the sequence.
Vector2f getCenter() const
Get the center of the sequence.
void addPoint(Vector2f point)
Add a point to the sequence.
Definition: PointSequence.h:86
void applyTransform(const Matrix3f &mat)
Apply a transformation to the sequence.
const Vector2f * begin() const
Get an iterator to the first point.
Definition: PointSequence.h:122
A serializer to a binary file.
Definition: Serialization.h:43
GF_CORE_API Serializer & operator|(Serializer &ar, const PointSequence &sequence)
Serialize a sequence.
A span.
Definition: Span.h:414
constexpr float Epsilon
Machine epsilon.
Definition: Math.h:94
The namespace for gf classes.
T data[N]
The internal representation of the vector.
Definition: Vector.h:270