LibrePCB Developers Documentation
SchematicEditorState_DrawWire Class Referencefinal

The SchematicEditorState_DrawWire class. More...

#include <schematiceditorstate_drawwire.h>

+ Inheritance diagram for SchematicEditorState_DrawWire:
+ Collaboration diagram for SchematicEditorState_DrawWire:

Public Member Functions

 SchematicEditorState_DrawWire ()=delete
 
 SchematicEditorState_DrawWire (const SchematicEditorState_DrawWire &other)=delete
 
 SchematicEditorState_DrawWire (const Context &context) noexcept
 
virtual ~SchematicEditorState_DrawWire () noexcept
 
virtual bool entry () noexcept override
 
virtual bool exit () noexcept override
 
virtual bool processAbortCommand () noexcept override
 
virtual bool processKeyPressed (const QKeyEvent &e) noexcept override
 
virtual bool processKeyReleased (const QKeyEvent &e) noexcept override
 
virtual bool processGraphicsSceneMouseMoved (QGraphicsSceneMouseEvent &e) noexcept override
 
virtual bool processGraphicsSceneLeftMouseButtonPressed (QGraphicsSceneMouseEvent &e) noexcept override
 
virtual bool processGraphicsSceneLeftMouseButtonDoubleClicked (QGraphicsSceneMouseEvent &e) noexcept override
 
virtual bool processGraphicsSceneRightMouseButtonReleased (QGraphicsSceneMouseEvent &e) noexcept override
 
virtual bool processSwitchToSchematicPage (int index) noexcept override
 
SchematicEditorState_DrawWireoperator= (const SchematicEditorState_DrawWire &rhs)=delete
 
- Public Member Functions inherited from SchematicEditorState
 SchematicEditorState ()=delete
 
 SchematicEditorState (const SchematicEditorState &other)=delete
 
 SchematicEditorState (const Context &context, QObject *parent=nullptr) noexcept
 
virtual ~SchematicEditorState () noexcept
 
virtual bool entry () noexcept
 
virtual bool exit () noexcept
 
virtual bool processAddComponent (const QString &searchTerm=QString()) noexcept
 
virtual bool processAddComponent (const Uuid &cmp, const Uuid &symbVar) 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 processMirror (Qt::Orientation orientation) 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 processSwitchToSchematicPage (int index) noexcept
 
SchematicEditorStateoperator= (const SchematicEditorState &rhs)=delete
 

Private Types

enum class  SubState
 Internal FSM States (substates) More...
 
enum class  WireMode
 All available wire modes. More...
 

Private Member Functions

bool startPositioning (SchematicGraphicsScene &scene, bool snap, SI_NetPoint *fixedPoint=nullptr) noexcept
 
bool addNextNetPoint (SchematicGraphicsScene &scene, bool snap) noexcept
 
bool abortPositioning (bool showErrMsgBox) noexcept
 
std::shared_ptr< QGraphicsItem > findItem (const Point &pos, const QVector< std::shared_ptr< QGraphicsItem > > &except={}) noexcept
 
Point updateNetpointPositions (bool snap) noexcept
 
void wireModeChanged (WireMode mode) noexcept
 
Point calcMiddlePointPos (const Point &p1, const Point p2, WireMode mode) const noexcept
 

Private Attributes

CircuitmCircuit
 
SubState mSubState
 the current substate More...
 
WireMode mCurrentWireMode
 the current wire mode More...
 
Point mCursorPos
 the current cursor position 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...
 
QPointer< QActionGroup > mWireModeActionGroup
 

Additional Inherited Members

- Public Types inherited from SchematicEditorState
enum class  FindFlag
 
using Context = SchematicEditorFsm::Context
 
- Signals inherited from SchematicEditorState
void statusBarMessageChanged (const QString &message, int timeoutMs=-1)
 
- Protected Member Functions inherited from SchematicEditorState
SchematicgetActiveSchematic () noexcept
 
SchematicGraphicsScenegetActiveSchematicScene () noexcept
 
PositiveLength getGridInterval () const noexcept
 
const LengthUnitgetLengthUnit () const noexcept
 
void abortBlockingToolsInOtherEditors () noexcept
 
bool execCmd (UndoCommand *cmd)
 
QWidget * parentWidget () noexcept
 
QList< std::shared_ptr< QGraphicsItem > > findItemsAtPos (const Point &pos, FindFlags flags, const QVector< std::shared_ptr< QGraphicsItem > > &except={}) noexcept
 
template<typename T = QGraphicsItem>
std::shared_ptr< T > findItemAtPos (const Point &pos, FindFlags flags, const QVector< std::shared_ptr< QGraphicsItem > > &except={}) noexcept
 
- Static Protected Member Functions inherited from SchematicEditorState
static const QSet< const Layer * > & getAllowedGeometryLayers () noexcept
 
- Protected Attributes inherited from SchematicEditorState
Context mContext
 

Detailed Description

Member Enumeration Documentation

◆ SubState

enum class SubState
strongprivate

Internal FSM States (substates)

Enumerator
IDLE 

idle state [initial state]

POSITIONING_NETPOINT 

in this state, an undo command is active!

◆ WireMode

enum class WireMode
strongprivate

All available wire modes.

Enumerator
HV 

horizontal - vertical [default]

VH 

vertical - horizontal

Deg9045 

90° - 45°

Deg4590 

45° - 90°

Straight 

straight

Constructor & Destructor Documentation

◆ SchematicEditorState_DrawWire() [1/3]

◆ SchematicEditorState_DrawWire() [2/3]

◆ SchematicEditorState_DrawWire() [3/3]

SchematicEditorState_DrawWire ( const Context context)
explicitnoexcept

◆ ~SchematicEditorState_DrawWire()

~SchematicEditorState_DrawWire ( )
virtualnoexcept

Member Function Documentation

◆ entry()

bool entry ( )
overridevirtualnoexcept

Reimplemented from SchematicEditorState.

+ Here is the call graph for this function:

◆ exit()

bool exit ( )
overridevirtualnoexcept

Reimplemented from SchematicEditorState.

+ Here is the call graph for this function:

◆ processAbortCommand()

bool processAbortCommand ( )
overridevirtualnoexcept

Reimplemented from SchematicEditorState.

+ Here is the call graph for this function:

◆ processKeyPressed()

bool processKeyPressed ( const QKeyEvent &  e)
overridevirtualnoexcept

Reimplemented from SchematicEditorState.

◆ processKeyReleased()

bool processKeyReleased ( const QKeyEvent &  e)
overridevirtualnoexcept

Reimplemented from SchematicEditorState.

◆ processGraphicsSceneMouseMoved()

bool processGraphicsSceneMouseMoved ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from SchematicEditorState.

+ Here is the call graph for this function:

◆ processGraphicsSceneLeftMouseButtonPressed()

bool processGraphicsSceneLeftMouseButtonPressed ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from SchematicEditorState.

+ Here is the call graph for this function:

◆ processGraphicsSceneLeftMouseButtonDoubleClicked()

bool processGraphicsSceneLeftMouseButtonDoubleClicked ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from SchematicEditorState.

+ Here is the call graph for this function:

◆ processGraphicsSceneRightMouseButtonReleased()

bool processGraphicsSceneRightMouseButtonReleased ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from SchematicEditorState.

+ Here is the call graph for this function:

◆ processSwitchToSchematicPage()

bool processSwitchToSchematicPage ( int  index)
overridevirtualnoexcept

Reimplemented from SchematicEditorState.

◆ operator=()

SchematicEditorState_DrawWire & operator= ( const SchematicEditorState_DrawWire rhs)
delete

◆ startPositioning()

bool startPositioning ( SchematicGraphicsScene scene,
bool  snap,
SI_NetPoint fixedPoint = nullptr 
)
privatenoexcept
+ Here is the call graph for this function:

◆ addNextNetPoint()

bool addNextNetPoint ( SchematicGraphicsScene scene,
bool  snap 
)
privatenoexcept
+ Here is the call graph for this function:

◆ abortPositioning()

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

◆ findItem()

std::shared_ptr< QGraphicsItem > findItem ( const Point pos,
const QVector< std::shared_ptr< QGraphicsItem > > &  except = {} 
)
privatenoexcept

◆ updateNetpointPositions()

Point updateNetpointPositions ( bool  snap)
privatenoexcept
+ Here is the call graph for this function:

◆ wireModeChanged()

void wireModeChanged ( WireMode  mode)
privatenoexcept
+ Here is the caller graph for this function:

◆ calcMiddlePointPos()

Point calcMiddlePointPos ( const Point p1,
const Point  p2,
WireMode  mode 
) const
privatenoexcept
+ Here is the call graph for this function:

Member Data Documentation

◆ mCircuit

Circuit& mCircuit
private

◆ mSubState

SubState mSubState
private

the current substate

◆ mCurrentWireMode

WireMode mCurrentWireMode
private

the current wire mode

◆ mCursorPos

Point mCursorPos
private

the current cursor position

◆ mFixedStartAnchor

SI_NetLineAnchor* mFixedStartAnchor
private

the fixed anchor (start point of the line)

◆ mPositioningNetLine1

SI_NetLine* mPositioningNetLine1
private

line between fixed point and p1

◆ mPositioningNetPoint1

SI_NetPoint* mPositioningNetPoint1
private

the first netpoint to place

◆ mPositioningNetLine2

SI_NetLine* mPositioningNetLine2
private

line between p1 and p2

◆ mPositioningNetPoint2

SI_NetPoint* mPositioningNetPoint2
private

the second netpoint to place

◆ mWireModeActionGroup

QPointer<QActionGroup> mWireModeActionGroup
private

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