LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BES_DrawTrace Class Referencefinal

The BES_DrawTrace class. More...

#include <bes_drawtrace.h>

+ Inheritance diagram for BES_DrawTrace:
+ Collaboration diagram for BES_DrawTrace:

Public Member Functions

 BES_DrawTrace (BoardEditor &editor, Ui::BoardEditor &editorUi, GraphicsView &editorGraphicsView, UndoStack &undoStack)
 
 ~BES_DrawTrace ()
 
ProcRetVal process (BEE_Base *event) noexceptoverride
 
bool entry (BEE_Base *event) noexceptoverride
 
bool exit (BEE_Base *event) noexceptoverride
 
- Public Member Functions inherited from BES_Base
 BES_Base (BoardEditor &editor, Ui::BoardEditor &editorUi, GraphicsView &editorGraphicsView, UndoStack &undoStack)
 
virtual ~BES_Base ()
 

Private Types

enum  SubState
 Internal FSM States (substates) More...
 
enum  WireMode
 The WireMode enum contains all available wire modes. More...
 

Private Member Functions

ProcRetVal processSubStateIdle (BEE_Base *event) noexcept
 
ProcRetVal processSubStatePositioning (BEE_Base *event) noexcept
 
ProcRetVal processIdleSceneEvent (BEE_Base *event) noexcept
 
ProcRetVal processPositioningSceneEvent (BEE_Base *event) noexcept
 
bool startPositioning (Board &board, const Point &pos, BI_NetPoint *fixedPoint=nullptr) noexcept
 
bool addNextNetPoint (Board &board, const Point &pos) noexcept
 
bool abortPositioning (bool showErrMsgBox) noexcept
 
BI_ViafindVia (Board &board, const Point &pos, NetSignal *netsignal=nullptr) const noexcept
 
BI_FootprintPadfindPad (Board &board, const Point &pos, GraphicsLayer *layer=nullptr, NetSignal *netsignal=nullptr) const noexcept
 
BI_NetPointfindNetPoint (Board &board, const Point &pos, GraphicsLayer *layer=nullptr, NetSignal *netsignal=nullptr, const QSet< BI_NetPoint * > &except={}) const noexcept
 
BI_NetLinefindNetLine (Board &board, const Point &pos, GraphicsLayer *layer=nullptr, NetSignal *netsignal=nullptr, const QSet< BI_NetLine * > &except={}) const noexcept
 
void updateNetpointPositions (const Point &cursorPos) noexcept
 
void layerComboBoxIndexChanged (int index) noexcept
 
void wireWidthComboBoxTextChanged (const QString &width) noexcept
 
void updateWireModeActionsCheckedState () noexcept
 
Point calcMiddlePointPos (const Point &p1, const Point p2, WireMode mode) const noexcept
 

Private Attributes

SubState mSubState
 the current substate More...
 
WireMode mCurrentWireMode
 the current wire mode More...
 
QString mCurrentLayerName
 the current board layer name More...
 
PositiveLength mCurrentWidth
 the current wire width More...
 
BI_NetLineAnchormFixedStartAnchor
 
BI_NetLinemPositioningNetLine1
 line between fixed point and p1 More...
 
BI_NetPointmPositioningNetPoint1
 the first netpoint to place More...
 
BI_NetLinemPositioningNetLine2
 line between p1 and p2 More...
 
BI_NetPointmPositioningNetPoint2
 the second netpoint to place More...
 
QHash< WireMode, QAction * > mWireModeActions
 
QList< QAction * > mActionSeparators
 
QLabel * mLayerLabel
 
QComboBox * mLayerComboBox
 
QLabel * mWidthLabel
 
QComboBox * mWidthComboBox
 

Additional Inherited Members

- Public Types inherited from BES_Base
enum  ProcRetVal
 process() return values More...
 
- Protected Attributes inherited from BES_Base
workspace::WorkspacemWorkspace
 
ProjectmProject
 
CircuitmCircuit
 
BoardEditormEditor
 
Ui::BoardEditor & mEditorUi
 allows access to BoardEditor UI More...
 
GraphicsViewmEditorGraphicsView
 allows access to the board editor graphics view More...
 
UndoStackmUndoStack
 

Detailed Description

The BES_DrawTrace class.

Todo:
This class is incredible ugly and buggy :-D

Member Enumeration Documentation

enum SubState
private

Internal FSM States (substates)

Enumerator
SubState_Idle 

idle state [initial state]

SubState_PositioningNetPoint 

in this state, an undo command is active!

enum WireMode
private

The WireMode enum contains all available wire modes.

Note
The first item must have the value 0!
Enumerator
WireMode_HV 

horizontal - vertical [default]

WireMode_VH 

vertical - horizontal

WireMode_9045 

90° - 45°

WireMode_4590 

45° - 90°

WireMode_Straight 

straight

WireMode_COUNT 

count of wire modes

Constructor & Destructor Documentation

BES_DrawTrace ( BoardEditor editor,
Ui::BoardEditor &  editorUi,
GraphicsView editorGraphicsView,
UndoStack undoStack 
)
explicit

Member Function Documentation

BES_Base::ProcRetVal process ( BEE_Base event)
overridevirtualnoexcept

Implements BES_Base.

bool entry ( BEE_Base event)
overridevirtualnoexcept

Reimplemented from BES_Base.

+ Here is the call graph for this function:

bool exit ( BEE_Base event)
overridevirtualnoexcept

Reimplemented from BES_Base.

BES_Base::ProcRetVal processSubStateIdle ( BEE_Base event)
privatenoexcept
BES_Base::ProcRetVal processSubStatePositioning ( BEE_Base event)
privatenoexcept
BES_Base::ProcRetVal processIdleSceneEvent ( BEE_Base event)
privatenoexcept

+ Here is the call graph for this function:

BES_Base::ProcRetVal processPositioningSceneEvent ( BEE_Base event)
privatenoexcept

+ Here is the call graph for this function:

bool startPositioning ( Board board,
const Point pos,
BI_NetPoint fixedPoint = nullptr 
)
privatenoexcept

+ Here is the call graph for this function:

bool addNextNetPoint ( Board board,
const Point pos 
)
privatenoexcept

+ Here is the call graph for this function:

bool abortPositioning ( bool  showErrMsgBox)
privatenoexcept

+ Here is the call graph for this function:

BI_Via * findVia ( Board board,
const Point pos,
NetSignal netsignal = nullptr 
) const
privatenoexcept
BI_FootprintPad * findPad ( Board board,
const Point pos,
GraphicsLayer layer = nullptr,
NetSignal netsignal = nullptr 
) const
privatenoexcept

+ Here is the call graph for this function:

BI_NetPoint * findNetPoint ( Board board,
const Point pos,
GraphicsLayer layer = nullptr,
NetSignal netsignal = nullptr,
const QSet< BI_NetPoint * > &  except = {} 
) const
privatenoexcept
BI_NetLine * findNetLine ( Board board,
const Point pos,
GraphicsLayer layer = nullptr,
NetSignal netsignal = nullptr,
const QSet< BI_NetLine * > &  except = {} 
) const
privatenoexcept
void updateNetpointPositions ( const Point cursorPos)
privatenoexcept
void layerComboBoxIndexChanged ( int  index)
privatenoexcept

+ Here is the caller graph for this function:

void wireWidthComboBoxTextChanged ( const QString &  width)
privatenoexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void updateWireModeActionsCheckedState ( )
privatenoexcept
Point calcMiddlePointPos ( const Point p1,
const Point  p2,
WireMode  mode 
) const
privatenoexcept

+ Here is the call graph for this function:

Member Data Documentation

SubState mSubState
private

the current substate

WireMode mCurrentWireMode
private

the current wire mode

QString mCurrentLayerName
private

the current board layer name

PositiveLength mCurrentWidth
private

the current wire width

BI_NetLineAnchor* mFixedStartAnchor
private

the fixed netline anchor (start point of the line)

BI_NetLine* mPositioningNetLine1
private

line between fixed point and p1

BI_NetPoint* mPositioningNetPoint1
private

the first netpoint to place

BI_NetLine* mPositioningNetLine2
private

line between p1 and p2

BI_NetPoint* mPositioningNetPoint2
private

the second netpoint to place

QHash<WireMode, QAction*> mWireModeActions
private
QList<QAction*> mActionSeparators
private
QLabel* mLayerLabel
private
QComboBox* mLayerComboBox
private
QLabel* mWidthLabel
private
QComboBox* mWidthComboBox
private

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