29#include "PointSequence.h"
30#include "SerializationFwd.h"
36#ifndef DOXYGEN_SHOULD_SKIP_THIS
86 template<
typename Iterator>
204 return m_type == Loop;
215 return m_type == Chain;
234#ifndef DOXYGEN_SHOULD_SKIP_THIS
A deserializer from a binary file.
Definition: Serialization.h:151
GF_CORE_API Deserializer & operator|(Deserializer &ar, Polyline &polyline)
Deserialize a polyline.
A sequence of points.
Definition: PointSequence.h:44
A polyline.
Definition: Polyline.h:47
Type
The type of polyline.
Definition: Polyline.h:52
@ Chain
The polyline is open.
Definition: Polyline.h:53
@ Loop
The polyline is closed.
Definition: Polyline.h:54
bool hasPrevPoint(std::size_t i) const
Check if there is a point before the i-th point.
bool hasNextPoint(std::size_t i) const
Check if there is a point after the i-th point.
Polyline(Span< const Vector2f > points, Type type=Chain)
Constructor from an array.
Definition: Polyline.h:73
bool contains(Vector2f point) const
Test if a point is inside the polyline.
Winding getWinding() const
Compute the winding of a simple loop polyline.
Vector2f getPrevExtensionPoint() const
Get the previous extension point of the first point.
Vector2f getNextPoint(std::size_t i) const
Get the point after the i-th point.
Polyline(Type type=Chain)
Default constructor.
Definition: Polyline.h:62
Polyline(Iterator first, Iterator last, Type type=Chain)
Constructor from points.
Definition: Polyline.h:87
void setType(Type type)
Set the type of the polyline.
Definition: Polyline.h:183
Vector2f getNextExtensionPoint() const
Get the next extension point of the last point.
bool isChain() const
Check is the polyline is a chain.
Definition: Polyline.h:214
bool isLoop() const
Check is the polyline is a loop.
Definition: Polyline.h:203
Type getType() const
Get the type of the polyline.
Definition: Polyline.h:192
Vector2f getPrevPoint(std::size_t i) const
Get the point before the i-th point.
A serializer to a binary file.
Definition: Serialization.h:43
GF_CORE_API Serializer & operator|(Serializer &ar, const Polyline &polyline)
Serialize a polyline.
A span.
Definition: Span.h:414
Winding
The direction of a polygon's rotation.
Definition: Winding.h:33
The namespace for gf classes.