LibrePCB Developers Documentation
PackageEditorFsm Class Referencefinal

The PackageEditorFsm class is the finit state machine (FSM) of the package editor. More...

#include <packageeditorfsm.h>

Inherits QObject.

+ Collaboration diagram for PackageEditorFsm:

Classes

struct  Context
 

Signals

void toolChanged (EditorWidgetBase::Tool newTool)
 
void availableFeaturesChanged ()
 
void statusBarMessageChanged (const QString &message, int timeoutMs=-1)
 

Public Member Functions

 PackageEditorFsm ()=delete
 
 PackageEditorFsm (const PackageEditorFsm &other)=delete
 
 PackageEditorFsm (const Context &context) noexcept
 
virtual ~PackageEditorFsm () noexcept
 
EditorWidgetBase::Tool getCurrentTool () const noexcept
 
std::shared_ptr< FootprintgetCurrentFootprint () const noexcept
 
const QSet< EditorWidgetBase::Feature > & getAvailableFeatures () const noexcept
 
void updateAvailableFeatures () noexcept
 
bool processChangeCurrentFootprint (const std::shared_ptr< Footprint > &fpt) noexcept
 
bool processKeyPressed (const QKeyEvent &e) noexcept
 
bool processKeyReleased (const QKeyEvent &e) noexcept
 
bool processGraphicsSceneMouseMoved (QGraphicsSceneMouseEvent &e) noexcept
 
bool processGraphicsSceneLeftMouseButtonPressed (QGraphicsSceneMouseEvent &e) noexcept
 
bool processGraphicsSceneLeftMouseButtonReleased (QGraphicsSceneMouseEvent &e) noexcept
 
bool processGraphicsSceneLeftMouseButtonDoubleClicked (QGraphicsSceneMouseEvent &e) noexcept
 
bool processGraphicsSceneRightMouseButtonReleased (QGraphicsSceneMouseEvent &e) noexcept
 
bool processSelectAll () noexcept
 
bool processCut () noexcept
 
bool processCopy () noexcept
 
bool processPaste () noexcept
 
bool processMove (const Point &delta) noexcept
 
bool processRotate (const Angle &rotation) noexcept
 
bool processMirror (Qt::Orientation orientation) noexcept
 
bool processFlip (Qt::Orientation orientation) noexcept
 
bool processMoveAlign () noexcept
 
bool processSnapToGrid () noexcept
 
bool processRemove () noexcept
 
bool processEditProperties () noexcept
 
bool processGenerateOutline () noexcept
 
bool processGenerateCourtyard () noexcept
 
bool processAbortCommand () noexcept
 
bool processStartSelecting () noexcept
 
bool processStartAddingFootprintThtPads () noexcept
 
bool processStartAddingFootprintSmtPads (FootprintPad::Function function) noexcept
 
bool processStartAddingNames () noexcept
 
bool processStartAddingValues () noexcept
 
bool processStartDrawLines () noexcept
 
bool processStartDrawArcs () noexcept
 
bool processStartDrawRects () noexcept
 
bool processStartDrawPolygons () noexcept
 
bool processStartDrawCircles () noexcept
 
bool processStartDrawTexts () noexcept
 
bool processStartDrawZones () noexcept
 
bool processStartAddingHoles () noexcept
 
bool processStartDxfImport () noexcept
 
bool processStartMeasure () noexcept
 
bool processStartReNumberPads () noexcept
 
PackageEditorFsmoperator= (const PackageEditorFsm &rhs)=delete
 

Private Types

enum class  State
 

Private Member Functions

PackageEditorStategetCurrentState () const noexcept
 
bool setNextState (State state) noexcept
 
bool leaveCurrentState () noexcept
 
bool enterNextState (State state) noexcept
 
bool switchToPreviousState () noexcept
 

Private Attributes

Context mContext
 
QMap< State, PackageEditorState * > mStates
 
State mCurrentState
 
State mPreviousState
 
QScopedPointer< PrimitiveTextGraphicsItemmSelectFootprintGraphicsItem
 
QSet< EditorWidgetBase::FeaturemAvailableFeatures
 

Detailed Description

The PackageEditorFsm class is the finit state machine (FSM) of the package editor.

Member Enumeration Documentation

◆ State

enum class State
strongprivate
Enumerator
IDLE 
SELECT 
ADD_THT_PADS 
ADD_SMT_PADS_STANDARD 
ADD_SMT_PADS_THERMAL 
ADD_SMT_PADS_BGA 
ADD_SMT_PADS_EDGE_CONNECTOR 
ADD_SMT_PADS_TEST 
ADD_SMT_PADS_LOCAL_FIDUCIAL 
ADD_SMT_PADS_GLOBAL_FIDUCIAL 
ADD_NAMES 
ADD_VALUES 
DRAW_LINE 
DRAW_ARC 
DRAW_RECT 
DRAW_POLYGON 
DRAW_CIRCLE 
DRAW_TEXT 
DRAW_ZONE 
ADD_HOLES 
MEASURE 
RENUMBER_PADS 

Constructor & Destructor Documentation

◆ PackageEditorFsm() [1/3]

PackageEditorFsm ( )
delete

◆ PackageEditorFsm() [2/3]

PackageEditorFsm ( const PackageEditorFsm other)
delete

◆ PackageEditorFsm() [3/3]

PackageEditorFsm ( const Context context)
explicitnoexcept

◆ ~PackageEditorFsm()

~PackageEditorFsm ( )
virtualnoexcept
+ Here is the call graph for this function:

Member Function Documentation

◆ getCurrentTool()

EditorWidgetBase::Tool getCurrentTool ( ) const
noexcept
+ Here is the caller graph for this function:

◆ getCurrentFootprint()

std::shared_ptr< Footprint > getCurrentFootprint ( ) const
noexcept

◆ getAvailableFeatures()

const QSet< EditorWidgetBase::Feature > & getAvailableFeatures ( ) const
inlinenoexcept

◆ updateAvailableFeatures()

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

◆ processChangeCurrentFootprint()

bool processChangeCurrentFootprint ( const std::shared_ptr< Footprint > &  fpt)
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

◆ processGraphicsSceneLeftMouseButtonPressed()

bool processGraphicsSceneLeftMouseButtonPressed ( QGraphicsSceneMouseEvent &  e)
noexcept

◆ processGraphicsSceneLeftMouseButtonReleased()

bool processGraphicsSceneLeftMouseButtonReleased ( QGraphicsSceneMouseEvent &  e)
noexcept

◆ processGraphicsSceneLeftMouseButtonDoubleClicked()

bool processGraphicsSceneLeftMouseButtonDoubleClicked ( QGraphicsSceneMouseEvent &  e)
noexcept

◆ processGraphicsSceneRightMouseButtonReleased()

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

◆ processSelectAll()

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

◆ processCut()

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

◆ processCopy()

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

◆ processPaste()

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

◆ processMove()

bool processMove ( const Point delta)
noexcept

◆ processRotate()

bool processRotate ( const Angle rotation)
noexcept

◆ processMirror()

bool processMirror ( Qt::Orientation  orientation)
noexcept

◆ processFlip()

bool processFlip ( Qt::Orientation  orientation)
noexcept

◆ processMoveAlign()

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

◆ processSnapToGrid()

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

◆ processRemove()

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

◆ processEditProperties()

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

◆ processGenerateOutline()

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

◆ processGenerateCourtyard()

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

◆ processAbortCommand()

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

◆ processStartSelecting()

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

◆ processStartAddingFootprintThtPads()

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

◆ processStartAddingFootprintSmtPads()

bool processStartAddingFootprintSmtPads ( FootprintPad::Function  function)
noexcept

◆ processStartAddingNames()

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

◆ processStartAddingValues()

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

◆ processStartDrawLines()

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

◆ processStartDrawArcs()

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

◆ processStartDrawRects()

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

◆ processStartDrawPolygons()

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

◆ processStartDrawCircles()

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

◆ processStartDrawTexts()

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

◆ processStartDrawZones()

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

◆ processStartAddingHoles()

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

◆ processStartDxfImport()

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

◆ processStartMeasure()

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

◆ processStartReNumberPads()

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

◆ operator=()

PackageEditorFsm & operator= ( const PackageEditorFsm rhs)
delete

◆ toolChanged

void toolChanged ( EditorWidgetBase::Tool  newTool)
signal
+ Here is the caller graph for this function:

◆ availableFeaturesChanged

void availableFeaturesChanged ( )
signal
+ 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:

◆ getCurrentState()

PackageEditorState * getCurrentState ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setNextState()

bool setNextState ( State  state)
privatenoexcept
+ Here is the caller graph for this function:

◆ leaveCurrentState()

bool leaveCurrentState ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enterNextState()

bool enterNextState ( State  state)
privatenoexcept
+ Here is the call graph for this function:

◆ switchToPreviousState()

bool switchToPreviousState ( )
privatenoexcept
+ Here is the call graph for this function:

Member Data Documentation

◆ mContext

Context mContext
private

◆ mStates

QMap<State, PackageEditorState*> mStates
private

◆ mCurrentState

State mCurrentState
private

◆ mPreviousState

State mPreviousState
private

◆ mSelectFootprintGraphicsItem

QScopedPointer<PrimitiveTextGraphicsItem> mSelectFootprintGraphicsItem
private

◆ mAvailableFeatures

QSet<EditorWidgetBase::Feature> mAvailableFeatures
private

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