20 #ifndef LIBREPCB_CORE_TANGENTPATHJOINER_H 21 #define LIBREPCB_CORE_TANGENTPATHJOINER_H 26 #include "../geometry/path.h" 28 #include <optional/tl/optional.hpp> 67 static QVector<Path>
join(QVector<Path> paths,
68 qint64 timeoutMs = -1) noexcept;
86 Result() : segments(), indices(), startPos(), endPos(), length(0) {}
89 return (!segments.isEmpty()) && (startPos == endPos);
97 if (segments.isEmpty()) {
106 QVector<Vertex> vertices;
107 foreach (
const Segment& segment, segments) {
108 if (!vertices.isEmpty()) {
117 return Path(vertices);
121 static void findAllPaths(QVector<Result>& result,
const QVector<Path>& paths,
122 const QElapsedTimer& timer, qint64 timeoutMs,
125 static tl::optional<Result>
join(
const QVector<Path>& paths,
Point endPos
Definition: tangentpathjoiner.h:83
bool isClosed() const noexcept
Definition: tangentpathjoiner.h:88
Definition: occmodel.cpp:76
Definition: tangentpathjoiner.h:79
Path buildPath(const QVector< Path > &paths) const
Definition: tangentpathjoiner.h:105
Helper class to join tangent paths (polylines) together.
Definition: tangentpathjoiner.h:57
Point startPos
Definition: tangentpathjoiner.h:82
~TangentPathJoiner()=delete
bool reverse
Definition: tangentpathjoiner.h:76
TangentPathJoiner()=delete
TangentPathJoiner & operator=(const TangentPathJoiner &rhs)=delete
Path & reverse() noexcept
Definition: path.cpp:226
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5...
Definition: point.h:78
Result sub(int index, bool reverse, const Point &start, const Point &end, const UnsignedLength &l) const
Definition: tangentpathjoiner.h:92
QSet< int > indices
Definition: tangentpathjoiner.h:81
Result()
Definition: tangentpathjoiner.h:86
QVector< Vertex > & getVertices() noexcept
Definition: path.h:72
The Path class represents a list of vertices connected by straight lines or circular arc segments...
Definition: path.h:57
static QVector< Path > join(QVector< Path > paths, qint64 timeoutMs=-1) noexcept
Definition: tangentpathjoiner.cpp:36
UnsignedLength length
Definition: tangentpathjoiner.h:84
Definition: tangentpathjoiner.h:74
int index
Definition: tangentpathjoiner.h:75
static void findAllPaths(QVector< Result > &result, const QVector< Path > &paths, const QElapsedTimer &timer, qint64 timeoutMs, const Result &prefix=Result()) noexcept
Definition: tangentpathjoiner.cpp:166
QVector< Segment > segments
Definition: tangentpathjoiner.h:80
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition: length.h:670