LibrePCB Developers Documentation
BoardEditorState Class Reference

The board editor state base class. More...

#include <boardeditorstate.h>

+ Inheritance diagram for BoardEditorState:
+ Collaboration diagram for BoardEditorState:

Public Types

enum class  FindFlag
 
using Context = BoardEditorFsm::Context
 

Signals

void requestLeavingState ()
 Signal to indicate that the current tool should be exited. More...
 
void statusBarMessageChanged (const QString &message, int timeoutMs=-1)
 

Public Member Functions

 BoardEditorState ()=delete
 
 BoardEditorState (const BoardEditorState &other)=delete
 
 BoardEditorState (const Context &context, QObject *parent=nullptr) noexcept
 
virtual ~BoardEditorState () noexcept
 
virtual bool entry () noexcept
 
virtual bool exit () noexcept
 
virtual bool processAddDevice (ComponentInstance &component, const Uuid &device, const Uuid &footprint) noexcept
 
virtual bool processImportDxf () noexcept
 
virtual bool processSelectAll () noexcept
 
virtual bool processCut () noexcept
 
virtual bool processCopy () noexcept
 
virtual bool processPaste () noexcept
 
virtual bool processMove (const Point &delta) noexcept
 
virtual bool processRotate (const Angle &rotation) noexcept
 
virtual bool processFlip (Qt::Orientation orientation) noexcept
 
virtual bool processSnapToGrid () noexcept
 
virtual bool processSetLocked (bool locked) noexcept
 
virtual bool processChangeLineWidth (int step) noexcept
 
virtual bool processResetAllTexts () noexcept
 
virtual bool processRemove () noexcept
 
virtual bool processEditProperties () noexcept
 
virtual bool processAbortCommand () noexcept
 
virtual bool processKeyPressed (const QKeyEvent &e) noexcept
 
virtual bool processKeyReleased (const QKeyEvent &e) noexcept
 
virtual bool processGraphicsSceneMouseMoved (QGraphicsSceneMouseEvent &e) noexcept
 
virtual bool processGraphicsSceneLeftMouseButtonPressed (QGraphicsSceneMouseEvent &e) noexcept
 
virtual bool processGraphicsSceneLeftMouseButtonReleased (QGraphicsSceneMouseEvent &e) noexcept
 
virtual bool processGraphicsSceneLeftMouseButtonDoubleClicked (QGraphicsSceneMouseEvent &e) noexcept
 
virtual bool processGraphicsSceneRightMouseButtonReleased (QGraphicsSceneMouseEvent &e) noexcept
 
virtual bool processSwitchToBoard (int index) noexcept
 
BoardEditorStateoperator= (const BoardEditorState &rhs)=delete
 

Protected Member Functions

BoardgetActiveBoard () noexcept
 
BoardGraphicsScenegetActiveBoardScene () noexcept
 
bool getIgnoreLocks () const noexcept
 
PositiveLength getGridInterval () const noexcept
 
const LengthUnitgetLengthUnit () const noexcept
 
QSet< const Layer * > getAllowedGeometryLayers () noexcept
 
void makeLayerVisible (const QString &layer) noexcept
 
void abortBlockingToolsInOtherEditors () noexcept
 
bool execCmd (UndoCommand *cmd)
 
QWidget * parentWidget () noexcept
 
QList< std::shared_ptr< QGraphicsItem > > findItemsAtPos (const Point &pos, FindFlags flags, const tl::optional< const Layer & > cuLayer=tl::nullopt, const QSet< const NetSignal * > &netsignals={}, const QVector< std::shared_ptr< QGraphicsItem > > &except={}) noexcept
 
template<typename T = QGraphicsItem>
std::shared_ptr< T > findItemAtPos (const Point &pos, FindFlags flags, const tl::optional< const Layer & > cuLayer=tl::nullopt, const QSet< const NetSignal * > &netsignals={}, const QVector< std::shared_ptr< QGraphicsItem > > &except={}) noexcept
 

Protected Attributes

Context mContext
 

Detailed Description

The board editor state base class.

Member Typedef Documentation

◆ Context

Member Enumeration Documentation

◆ FindFlag

enum class FindFlag
strong
Enumerator
Vias 
NetPoints 
NetLines 
Devices 
FootprintPads 
Planes 
Zones 
Polygons 
StrokeTexts 
Holes 
All 
AcceptNearMatch 
AcceptNextGridMatch 
SkipLowerPriorityMatches 

Constructor & Destructor Documentation

◆ BoardEditorState() [1/3]

BoardEditorState ( )
delete

◆ BoardEditorState() [2/3]

BoardEditorState ( const BoardEditorState other)
delete

◆ BoardEditorState() [3/3]

BoardEditorState ( const Context context,
QObject *  parent = nullptr 
)
explicitnoexcept

◆ ~BoardEditorState()

~BoardEditorState ( )
virtualnoexcept

Member Function Documentation

◆ entry()

virtual bool entry ( )
inlinevirtualnoexcept

Reimplemented in BoardEditorState_AddDevice, BoardEditorState_AddHole, BoardEditorState_AddStrokeText, BoardEditorState_AddVia, BoardEditorState_DrawPlane, BoardEditorState_DrawPolygon, BoardEditorState_DrawTrace, BoardEditorState_DrawZone, BoardEditorState_Measure, and BoardEditorState_Select.

+ Here is the caller graph for this function:

◆ exit()

◆ processAddDevice()

virtual bool processAddDevice ( ComponentInstance component,
const Uuid device,
const Uuid footprint 
)
inlinevirtualnoexcept

Reimplemented in BoardEditorState_AddDevice.

◆ processImportDxf()

virtual bool processImportDxf ( )
inlinevirtualnoexcept

Reimplemented in BoardEditorState_Select.

◆ processSelectAll()

virtual bool processSelectAll ( )
inlinevirtualnoexcept

Reimplemented in BoardEditorState_Select.

◆ processCut()

virtual bool processCut ( )
inlinevirtualnoexcept

Reimplemented in BoardEditorState_Select.

◆ processCopy()

virtual bool processCopy ( )
inlinevirtualnoexcept

◆ processPaste()

virtual bool processPaste ( )
inlinevirtualnoexcept

Reimplemented in BoardEditorState_Select.

◆ processMove()

virtual bool processMove ( const Point delta)
inlinevirtualnoexcept

Reimplemented in BoardEditorState_Select.

◆ processRotate()

virtual bool processRotate ( const Angle rotation)
inlinevirtualnoexcept

◆ processFlip()

virtual bool processFlip ( Qt::Orientation  orientation)
inlinevirtualnoexcept

◆ processSnapToGrid()

virtual bool processSnapToGrid ( )
inlinevirtualnoexcept

Reimplemented in BoardEditorState_Select.

◆ processSetLocked()

virtual bool processSetLocked ( bool  locked)
inlinevirtualnoexcept

Reimplemented in BoardEditorState_Select.

◆ processChangeLineWidth()

virtual bool processChangeLineWidth ( int  step)
inlinevirtualnoexcept

Reimplemented in BoardEditorState_Select.

◆ processResetAllTexts()

virtual bool processResetAllTexts ( )
inlinevirtualnoexcept

Reimplemented in BoardEditorState_Select.

◆ processRemove()

virtual bool processRemove ( )
inlinevirtualnoexcept

◆ processEditProperties()

virtual bool processEditProperties ( )
inlinevirtualnoexcept

Reimplemented in BoardEditorState_Select.

◆ processAbortCommand()

◆ processKeyPressed()

virtual bool processKeyPressed ( const QKeyEvent &  e)
inlinevirtualnoexcept

◆ processKeyReleased()

virtual bool processKeyReleased ( const QKeyEvent &  e)
inlinevirtualnoexcept

◆ processGraphicsSceneMouseMoved()

◆ processGraphicsSceneLeftMouseButtonPressed()

◆ processGraphicsSceneLeftMouseButtonReleased()

virtual bool processGraphicsSceneLeftMouseButtonReleased ( QGraphicsSceneMouseEvent &  e)
inlinevirtualnoexcept

Reimplemented in BoardEditorState_Select.

◆ processGraphicsSceneLeftMouseButtonDoubleClicked()

virtual bool processGraphicsSceneLeftMouseButtonDoubleClicked ( QGraphicsSceneMouseEvent &  e)
inlinevirtualnoexcept

◆ processGraphicsSceneRightMouseButtonReleased()

virtual bool processGraphicsSceneRightMouseButtonReleased ( QGraphicsSceneMouseEvent &  e)
inlinevirtualnoexcept

◆ processSwitchToBoard()

virtual bool processSwitchToBoard ( int  index)
inlinevirtualnoexcept

◆ operator=()

BoardEditorState & operator= ( const BoardEditorState rhs)
delete

◆ requestLeavingState

void requestLeavingState ( )
signal

Signal to indicate that the current tool should be exited.

This signal can be emitted by each state to signalize the FSM to leave the current state and entering the select tool.

+ Here is the caller graph for this function:

◆ statusBarMessageChanged

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

◆ getActiveBoard()

Board * getActiveBoard ( )
protectednoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActiveBoardScene()

BoardGraphicsScene * getActiveBoardScene ( )
protectednoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIgnoreLocks()

bool getIgnoreLocks ( ) const
protectednoexcept
+ Here is the call graph for this function:

◆ getGridInterval()

PositiveLength getGridInterval ( ) const
protectednoexcept
+ Here is the call graph for this function:

◆ getLengthUnit()

const LengthUnit & getLengthUnit ( ) const
protectednoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAllowedGeometryLayers()

QSet< const Layer * > getAllowedGeometryLayers ( )
protectednoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeLayerVisible()

void makeLayerVisible ( const QString &  layer)
protectednoexcept
+ Here is the caller graph for this function:

◆ abortBlockingToolsInOtherEditors()

void abortBlockingToolsInOtherEditors ( )
protectednoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ execCmd()

bool execCmd ( UndoCommand cmd)
protected
+ Here is the call graph for this function:

◆ parentWidget()

QWidget * parentWidget ( )
protectednoexcept
+ Here is the caller graph for this function:

◆ findItemsAtPos()

QList< std::shared_ptr< QGraphicsItem > > findItemsAtPos ( const Point pos,
FindFlags  flags,
const tl::optional< const Layer & >  cuLayer = tl::nullopt,
const QSet< const NetSignal * > &  netsignals = {},
const QVector< std::shared_ptr< QGraphicsItem > > &  except = {} 
)
protectednoexcept
+ Here is the call graph for this function:

◆ findItemAtPos()

std::shared_ptr< T > findItemAtPos ( const Point pos,
FindFlags  flags,
const tl::optional< const Layer & >  cuLayer = tl::nullopt,
const QSet< const NetSignal * > &  netsignals = {},
const QVector< std::shared_ptr< QGraphicsItem > > &  except = {} 
)
inlineprotectednoexcept

Member Data Documentation

◆ mContext

Context mContext
protected

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