LibrePCB Developers Documentation
Loading...
Searching...
No Matches
MeasureTool Class Referencefinal

Measure tool providing the measure functionality for the editor states. More...

#include <measuretool.h>

Inherits QObject.

+ Collaboration diagram for MeasureTool:

Signals

void statusBarMessageChanged (const QString &message, int timeoutMs=-1)
 

Public Member Functions

 MeasureTool ()=delete
 
 MeasureTool (const MeasureTool &other)=delete
 
 MeasureTool (GraphicsView &view, const LengthUnit &unit, QObject *parent=nullptr) noexcept
 
 ~MeasureTool () noexcept
 
void setSymbol (const Symbol *symbol) noexcept
 
void setFootprint (const Footprint *footprint) noexcept
 
void setSchematic (const Schematic *schematic) noexcept
 
void setBoard (const Board *board) noexcept
 
void enter () noexcept
 
void leave () noexcept
 
bool processKeyPressed (const QKeyEvent &e) noexcept
 
bool processKeyReleased (const QKeyEvent &e) noexcept
 
bool processGraphicsSceneMouseMoved (QGraphicsSceneMouseEvent &e) noexcept
 
bool processGraphicsSceneLeftMouseButtonPressed (QGraphicsSceneMouseEvent &e) noexcept
 
bool processCopy () noexcept
 
bool processRemove () noexcept
 
bool processAbortCommand () noexcept
 
MeasureTooloperator= (const MeasureTool &rhs)=delete
 

Private Member Functions

void updateCursorPosition (Qt::KeyboardModifiers modifiers) noexcept
 
void updateRulerPositions () noexcept
 
void updateStatusBarMessage () noexcept
 

Static Private Member Functions

static QSet< PointsnapCandidatesFromSymbol (const Symbol &symbol, const Transform &transform) noexcept
 
static QSet< PointsnapCandidatesFromFootprint (const Footprint &footprint, const Transform &transform) noexcept
 
static QSet< PointsnapCandidatesFromPath (const Path &path) noexcept
 
static QSet< PointsnapCandidatesFromCircle (const Point &center, const Length &diameter) noexcept
 

Private Attributes

QPointer< GraphicsViewmView
 
LengthUnit mUnit
 
QSet< PointmSnapCandidates
 
Point mLastScenePos
 
Point mCursorPos
 
bool mCursorSnapped
 
std::optional< PointmStartPos
 
std::optional< PointmEndPos
 

Detailed Description

Measure tool providing the measure functionality for the editor states.

Constructor & Destructor Documentation

◆ MeasureTool() [1/3]

MeasureTool ( )
delete

◆ MeasureTool() [2/3]

MeasureTool ( const MeasureTool other)
delete

◆ MeasureTool() [3/3]

MeasureTool ( GraphicsView view,
const LengthUnit unit,
QObject *  parent = nullptr 
)
explicitnoexcept

◆ ~MeasureTool()

~MeasureTool ( )
noexcept

Member Function Documentation

◆ setSymbol()

void setSymbol ( const Symbol symbol)
noexcept

◆ setFootprint()

void setFootprint ( const Footprint footprint)
noexcept

◆ setSchematic()

void setSchematic ( const Schematic schematic)
noexcept
+ Here is the call graph for this function:

◆ setBoard()

void setBoard ( const Board board)
noexcept
+ Here is the call graph for this function:

◆ enter()

void enter ( )
noexcept
+ Here is the call graph for this function:

◆ leave()

void leave ( )
noexcept
+ Here is the call graph for this function:

◆ processKeyPressed()

bool processKeyPressed ( const QKeyEvent &  e)
noexcept

◆ processKeyReleased()

bool processKeyReleased ( const QKeyEvent &  e)
noexcept

◆ processGraphicsSceneMouseMoved()

bool processGraphicsSceneMouseMoved ( QGraphicsSceneMouseEvent &  e)
noexcept
+ Here is the call graph for this function:

◆ processGraphicsSceneLeftMouseButtonPressed()

bool processGraphicsSceneLeftMouseButtonPressed ( QGraphicsSceneMouseEvent &  e)
noexcept

◆ processCopy()

bool processCopy ( )
noexcept
+ Here is the call graph for this function:

◆ processRemove()

bool processRemove ( )
noexcept
+ Here is the call graph for this function:

◆ processAbortCommand()

bool processAbortCommand ( )
noexcept
+ Here is the call graph for this function:

◆ operator=()

MeasureTool & operator= ( const MeasureTool rhs)
delete

◆ statusBarMessageChanged

void statusBarMessageChanged ( const QString &  message,
int  timeoutMs = -1 
)
signal
+ Here is the caller graph for this function:

◆ snapCandidatesFromSymbol()

QSet< Point > snapCandidatesFromSymbol ( const Symbol symbol,
const Transform transform 
)
staticprivatenoexcept
+ Here is the call graph for this function:

◆ snapCandidatesFromFootprint()

QSet< Point > snapCandidatesFromFootprint ( const Footprint footprint,
const Transform transform 
)
staticprivatenoexcept
+ Here is the call graph for this function:

◆ snapCandidatesFromPath()

QSet< Point > snapCandidatesFromPath ( const Path path)
staticprivatenoexcept
+ Here is the call graph for this function:

◆ snapCandidatesFromCircle()

QSet< Point > snapCandidatesFromCircle ( const Point center,
const Length diameter 
)
staticprivatenoexcept

◆ updateCursorPosition()

void updateCursorPosition ( Qt::KeyboardModifiers  modifiers)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateRulerPositions()

void updateRulerPositions ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateStatusBarMessage()

void updateStatusBarMessage ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ mView

QPointer<GraphicsView> mView
private

◆ mUnit

LengthUnit mUnit
private

◆ mSnapCandidates

QSet<Point> mSnapCandidates
private

◆ mLastScenePos

Point mLastScenePos
private

◆ mCursorPos

Point mCursorPos
private

◆ mCursorSnapped

bool mCursorSnapped
private

◆ mStartPos

std::optional<Point> mStartPos
private

◆ mEndPos

std::optional<Point> mEndPos
private

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