1
2#pragma once
3
4#include <vector>
5#include "EdgeHolder.h"
6
7namespace msdfgen {
8
9/// A single closed contour of a shape.
10class Contour {
11
12public:
13 /// The sequence of edges that make up the contour.
14 std::vector<EdgeHolder> edges;
15
16 /// Adds an edge to the contour.
17 void addEdge(const EdgeHolder &edge);
18#ifdef MSDFGEN_USE_CPP11
19 void addEdge(EdgeHolder &&edge);
20#endif
21 /// Creates a new edge in the contour and returns its reference.
22 EdgeHolder & addEdge();
23 /// Adjusts the bounding box to fit the contour.
24 void bound(double &l, double &b, double &r, double &t) const;
25 /// Adjusts the bounding box to fit the contour border's mitered corners.
26 void boundMiters(double &l, double &b, double &r, double &t, double border, double miterLimit, int polarity) const;
27 /// Computes the winding of the contour. Returns 1 if positive, -1 if negative.
28 int winding() const;
29 /// Reverses the sequence of edges on the contour.
30 void reverse();
31
32};
33
34}
35