20#ifndef LIBREPCB_CORE_TANGENTPATHJOINER_H
21#define LIBREPCB_CORE_TANGENTPATHJOINER_H
26#include "../geometry/path.h"
67 static QVector<Path>
join(QVector<Path> paths, qint64 timeoutMs = -1,
68 bool* timedOut =
nullptr) noexcept;
110 const Point& end)
const {
123 QVector<Vertex> vertices;
125 if (!vertices.isEmpty()) {
134 return Path(vertices);
138 static void findAllPaths(QVector<Result>& result,
const QVector<Path>& paths,
139 const QElapsedTimer& timer, qint64 timeoutMs,
140 const Result& prefix = Result(),
141 bool* timedOut =
nullptr) noexcept;
143 static
std::optional<Result>
join(const QVector<
Path>& paths,
144 const Result& prefix,
int index,
145 bool reverse) noexcept;
The Path class represents a list of vertices connected by straight lines or circular arc segments.
Definition path.h:57
Path & reverse() noexcept
Definition path.cpp:253
QVector< Vertex > & getVertices() noexcept
Definition path.h:73
qreal calcAreaOfStraightSegments() const noexcept
Definition path.cpp:99
UnsignedLength getTotalStraightLength() const noexcept
Definition path.cpp:86
bool isClosed() const noexcept
Definition path.cpp:55
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
Helper class to join tangent paths (polylines) together.
Definition tangentpathjoiner.h:57
static QVector< Path > join(QVector< Path > paths, qint64 timeoutMs=-1, bool *timedOut=nullptr) noexcept
Definition tangentpathjoiner.cpp:36
~TangentPathJoiner()=delete
TangentPathJoiner(const TangentPathJoiner &other)=delete
static void findAllPaths(QVector< Result > &result, const QVector< Path > &paths, const QElapsedTimer &timer, qint64 timeoutMs, const Result &prefix=Result(), bool *timedOut=nullptr) noexcept
Definition tangentpathjoiner.cpp:173
TangentPathJoiner()=delete
Definition occmodel.cpp:76
Definition tangentpathjoiner.h:79
qreal calcLengthOrArea(const QVector< Path > &paths) const noexcept
Definition tangentpathjoiner.h:99
Point startPos
Definition tangentpathjoiner.h:83
QSet< Point > junctions
Definition tangentpathjoiner.h:82
Path buildPath(const QVector< Path > &paths) const
Definition tangentpathjoiner.h:122
Result()
Definition tangentpathjoiner.h:87
qreal lengthAreaCache
Definition tangentpathjoiner.h:85
QVector< Segment > segments
Definition tangentpathjoiner.h:80
Result sub(int index, bool reverse, const Point &start, const Point &end) const
Definition tangentpathjoiner.h:109
QSet< int > indices
Definition tangentpathjoiner.h:81
Point endPos
Definition tangentpathjoiner.h:84
bool isClosed() const noexcept
Definition tangentpathjoiner.h:95
Definition tangentpathjoiner.h:74
bool reverse
Definition tangentpathjoiner.h:76
int index
Definition tangentpathjoiner.h:75