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

The SES_DrawWire class. More...

#include <ses_drawwire.h>

+ Inheritance diagram for SES_DrawWire:
+ Collaboration diagram for SES_DrawWire:

Public Member Functions

 SES_DrawWire (SchematicEditor &editor, Ui::SchematicEditor &editorUi, GraphicsView &editorGraphicsView, UndoStack &undoStack)
 
 ~SES_DrawWire ()
 
ProcRetVal process (SEE_Base *event) noexceptoverride
 
bool entry (SEE_Base *event) noexceptoverride
 
bool exit (SEE_Base *event) noexceptoverride
 
- Public Member Functions inherited from SES_Base
 SES_Base (SchematicEditor &editor, Ui::SchematicEditor &editorUi, GraphicsView &editorGraphicsView, UndoStack &undoStack)
 
virtual ~SES_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 (SEE_Base *event) noexcept
 
ProcRetVal processSubStatePositioning (SEE_Base *event) noexcept
 
ProcRetVal processIdleSceneEvent (SEE_Base *event) noexcept
 
ProcRetVal processPositioningSceneEvent (SEE_Base *event) noexcept
 
bool startPositioning (Schematic &schematic, const Point &pos, SI_NetPoint *fixedPoint=nullptr) noexcept
 
bool addNextNetPoint (Schematic &schematic, const Point &pos) noexcept
 
bool abortPositioning (bool showErrMsgBox) noexcept
 
SI_SymbolPinfindSymbolPin (Schematic &schematic, const Point &pos) const noexcept
 
SI_NetPointfindNetPoint (Schematic &schematic, const Point &pos, SI_NetPoint *except=nullptr) const noexcept
 
SI_NetLinefindNetLine (Schematic &schematic, const Point &pos, SI_NetLine *except=nullptr) const noexcept
 
void updateNetpointPositions (const Point &cursorPos) 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 mWireMode
 the current wire mode More...
 
SI_NetLineAnchormFixedStartAnchor
 the fixed anchor (start point of the line) More...
 
SI_NetLinemPositioningNetLine1
 line between fixed point and p1 More...
 
SI_NetPointmPositioningNetPoint1
 the first netpoint to place More...
 
SI_NetLinemPositioningNetLine2
 line between p1 and p2 More...
 
SI_NetPointmPositioningNetPoint2
 the second netpoint to place More...
 
QHash< WireMode, QAction * > mWireModeActions
 
QList< QAction * > mActionSeparators
 
QLabel * mWidthLabel
 
QComboBox * mWidthComboBox
 

Additional Inherited Members

- Public Types inherited from SES_Base
enum  ProcRetVal
 process() return values More...
 
- Protected Attributes inherited from SES_Base
workspace::WorkspacemWorkspace
 
ProjectmProject
 
CircuitmCircuit
 
SchematicEditormEditor
 
Ui::SchematicEditor & mEditorUi
 allows access to SchematicEditor UI More...
 
GraphicsViewmEditorGraphicsView
 
UndoStackmUndoStack
 

Detailed Description

The SES_DrawWire 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

SES_DrawWire ( SchematicEditor editor,
Ui::SchematicEditor &  editorUi,
GraphicsView editorGraphicsView,
UndoStack undoStack 
)
explicit

Member Function Documentation

SES_Base::ProcRetVal process ( SEE_Base event)
overridevirtualnoexcept

Implements SES_Base.

bool entry ( SEE_Base event)
overridevirtualnoexcept

Reimplemented from SES_Base.

bool exit ( SEE_Base event)
overridevirtualnoexcept

Reimplemented from SES_Base.

SES_Base::ProcRetVal processSubStateIdle ( SEE_Base event)
privatenoexcept
SES_Base::ProcRetVal processSubStatePositioning ( SEE_Base event)
privatenoexcept
SES_Base::ProcRetVal processIdleSceneEvent ( SEE_Base event)
privatenoexcept

+ Here is the call graph for this function:

SES_Base::ProcRetVal processPositioningSceneEvent ( SEE_Base event)
privatenoexcept

+ Here is the call graph for this function:

bool startPositioning ( Schematic schematic,
const Point pos,
SI_NetPoint fixedPoint = nullptr 
)
privatenoexcept

+ Here is the call graph for this function:

bool addNextNetPoint ( Schematic schematic,
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:

SI_SymbolPin * findSymbolPin ( Schematic schematic,
const Point pos 
) const
privatenoexcept
SI_NetPoint * findNetPoint ( Schematic schematic,
const Point pos,
SI_NetPoint except = nullptr 
) const
privatenoexcept
SI_NetLine * findNetLine ( Schematic schematic,
const Point pos,
SI_NetLine except = nullptr 
) const
privatenoexcept
void updateNetpointPositions ( const Point cursorPos)
privatenoexcept
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 mWireMode
private

the current wire mode

SI_NetLineAnchor* mFixedStartAnchor
private

the fixed anchor (start point of the line)

SI_NetLine* mPositioningNetLine1
private

line between fixed point and p1

SI_NetPoint* mPositioningNetPoint1
private

the first netpoint to place

SI_NetLine* mPositioningNetLine2
private

line between p1 and p2

SI_NetPoint* mPositioningNetPoint2
private

the second netpoint to place

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

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