LibrePCB Developers Documentation
TangentPathJoiner Class Reference

Helper class to join tangent paths (polylines) together. More...

#include <tangentpathjoiner.h>

+ Collaboration diagram for TangentPathJoiner:

Classes

struct  Result
 
struct  Segment
 

Public Member Functions

 TangentPathJoiner ()=delete
 
 TangentPathJoiner (const TangentPathJoiner &other)=delete
 
 ~TangentPathJoiner ()=delete
 
TangentPathJoineroperator= (const TangentPathJoiner &rhs)=delete
 

Static Public Member Functions

static QVector< Pathjoin (QVector< Path > paths, qint64 timeoutMs=-1, bool *timedOut=nullptr) noexcept
 

Static Private Member Functions

static void findAllPaths (QVector< Result > &result, const QVector< Path > &paths, const QElapsedTimer &timer, qint64 timeoutMs, const Result &prefix=Result(), bool *timedOut=nullptr) noexcept
 
static tl::optional< Resultjoin (const QVector< Path > &paths, const Result &prefix, int index, bool reverse) noexcept
 

Detailed Description

Helper class to join tangent paths (polylines) together.

The algorithm performs the following tasks:

  • Invalid paths (less than 2 vertices) are removed.
  • Any already closed path is returned as-is.
  • Any joined, closed paths are searched, starting with the longest path.
  • Then joined, open paths are searched, starting with the longest path.
  • Any remaining (non tangent) paths are returned as-is.
Note
If there are many possible solutions (many paths located at the same coordinate), finding the solution can take a lot of time. Therefore a timeout can be specified to abort a too long operation, then a non- optimal (but still valid) result is returned.

Constructor & Destructor Documentation

◆ TangentPathJoiner() [1/2]

TangentPathJoiner ( )
delete

◆ TangentPathJoiner() [2/2]

TangentPathJoiner ( const TangentPathJoiner other)
delete

◆ ~TangentPathJoiner()

~TangentPathJoiner ( )
delete

Member Function Documentation

◆ join() [1/2]

QVector< Path > join ( QVector< Path paths,
qint64  timeoutMs = -1,
bool *  timedOut = nullptr 
)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

TangentPathJoiner& operator= ( const TangentPathJoiner rhs)
delete

◆ findAllPaths()

void findAllPaths ( QVector< Result > &  result,
const QVector< Path > &  paths,
const QElapsedTimer &  timer,
qint64  timeoutMs,
const Result prefix = Result(),
bool *  timedOut = nullptr 
)
staticprivatenoexcept
+ Here is the caller graph for this function:

◆ join() [2/2]

tl::optional< TangentPathJoiner::Result > join ( const QVector< Path > &  paths,
const Result prefix,
int  index,
bool  reverse 
)
staticprivatenoexcept
+ Here is the call graph for this function:

The documentation for this class was generated from the following files: