LibrePCB Developers Documentation
BoardPlaneFragmentsBuilder Class Referencefinal

Plane fragments builder working on a librepcb::Board. More...

#include <boardplanefragmentsbuilder.h>

Inherits QObject.

+ Collaboration diagram for BoardPlaneFragmentsBuilder:

Classes

struct  JobData
 
struct  KeepoutZoneData
 
struct  PadData
 
struct  PlaneData
 
struct  PolygonData
 
struct  TraceData
 
struct  ViaData
 

Signals

void started ()
 
void finished ()
 
void boardPlanesModified ()
 

Public Member Functions

 BoardPlaneFragmentsBuilder (bool rebuildAirWires=false, QObject *parent=nullptr) noexcept
 
 BoardPlaneFragmentsBuilder (const BoardPlaneFragmentsBuilder &other)=delete
 
 ~BoardPlaneFragmentsBuilder () noexcept
 
void runSynchronously (Board &board, const QSet< const Layer * > *layers=nullptr)
 Build and apply plane fragments synchronously (blocking) More...
 
bool startAsynchronously (Board &board, const QSet< const Layer * > *layers=nullptr) noexcept
 Start building plane fragments asynchronously. More...
 
bool isBusy () const noexcept
 Check if there is currently a build in progress. More...
 
void cancel () noexcept
 Cancel the current asynchronous job. More...
 
BoardPlaneFragmentsBuilderoperator= (const BoardPlaneFragmentsBuilder &rhs)=delete
 

Private Member Functions

std::shared_ptr< JobDatacreateJob (Board &board, const QSet< const Layer * > *filter) noexcept
 
std::shared_ptr< JobDatarun (std::shared_ptr< JobData > data, bool exceptionOnError)
 
bool applyToBoard (std::shared_ptr< JobData > data) noexcept
 

Static Private Member Functions

static QVector< std::pair< Point, Angle > > determineThermalSpokes (const PadGeometry &geometry) noexcept
 
static PositiveLength maxArcTolerance () noexcept
 

Private Attributes

const bool mRebuildAirWires
 
QFuture< std::shared_ptr< JobData > > mFuture
 
QFutureWatcher< std::shared_ptr< JobData > > mWatcher
 
bool mAbort
 

Detailed Description

Plane fragments builder working on a librepcb::Board.

Constructor & Destructor Documentation

◆ BoardPlaneFragmentsBuilder() [1/2]

BoardPlaneFragmentsBuilder ( bool  rebuildAirWires = false,
QObject *  parent = nullptr 
)
explicitnoexcept

◆ BoardPlaneFragmentsBuilder() [2/2]

◆ ~BoardPlaneFragmentsBuilder()

+ Here is the call graph for this function:

Member Function Documentation

◆ runSynchronously()

void runSynchronously ( Board board,
const QSet< const Layer * > *  layers = nullptr 
)

Build and apply plane fragments synchronously (blocking)

Parameters
boardThe board to rebuild the planes of.
layersIf not nullptr, rebuild only planes which are scheduled to rebuild and located on the given layers (quick rebuild). If nullptr (default), rebuild all planes (more reliable, but slower).
Exceptions
Exceptionif any error occurred.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ startAsynchronously()

bool startAsynchronously ( Board board,
const QSet< const Layer * > *  layers = nullptr 
)
noexcept

Start building plane fragments asynchronously.

The calculated fragments will automatically be applied to the board once the rebuild is finished.

Parameters
boardThe board to rebuild the planes of.
layersIf not nullptr, rebuild only planes which are scheduled to rebuild and located on the given layers (quick rebuild). If nullptr (default), rebuild all planes (more reliable, but slower).
Return values
trueIf the build started.
falseIf none of the planes need a rebuild, thus did not start a rebuild.
+ Here is the call graph for this function:

◆ isBusy()

bool isBusy ( ) const
noexcept

Check if there is currently a build in progress.

Return values
trueif a build is in progress.
falseif idle.

◆ cancel()

void cancel ( )
noexcept

Cancel the current asynchronous job.

+ Here is the caller graph for this function:

◆ operator=()

BoardPlaneFragmentsBuilder & operator= ( const BoardPlaneFragmentsBuilder rhs)
delete

◆ started

void started ( )
signal
+ Here is the caller graph for this function:

◆ finished

void finished ( )
signal
+ Here is the caller graph for this function:

◆ boardPlanesModified

void boardPlanesModified ( )
signal
+ Here is the caller graph for this function:

◆ createJob()

std::shared_ptr< BoardPlaneFragmentsBuilder::JobData > createJob ( Board board,
const QSet< const Layer * > *  filter 
)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ run()

std::shared_ptr< BoardPlaneFragmentsBuilder::JobData > run ( std::shared_ptr< JobData data,
bool  exceptionOnError 
)
private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ determineThermalSpokes()

QVector< std::pair< Point, Angle > > determineThermalSpokes ( const PadGeometry geometry)
staticprivatenoexcept

◆ applyToBoard()

bool applyToBoard ( std::shared_ptr< JobData data)
privatenoexcept
+ Here is the caller graph for this function:

◆ maxArcTolerance()

static PositiveLength maxArcTolerance ( )
inlinestaticprivatenoexcept

Returns the maximum allowed arc tolerance when flattening arcs. Do not change this if you don't know exactly what you're doing (it affects all planes in all existing boards)!

+ Here is the caller graph for this function:

Member Data Documentation

◆ mRebuildAirWires

const bool mRebuildAirWires
private

◆ mFuture

QFuture<std::shared_ptr<JobData> > mFuture
private

◆ mWatcher

QFutureWatcher<std::shared_ptr<JobData> > mWatcher
private

◆ mAbort

bool mAbort
private

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