LibrePCB Developers Documentation
BoardEditorState_Select Class Referencefinal

The "select" state/tool of the board editor (default state) More...

#include <boardeditorstate_select.h>

+ Inheritance diagram for BoardEditorState_Select:
+ Collaboration diagram for BoardEditorState_Select:

Classes

struct  DeviceMenuItem
 

Public Member Functions

 BoardEditorState_Select ()=delete
 
 BoardEditorState_Select (const BoardEditorState_Select &other)=delete
 
 BoardEditorState_Select (const Context &context) noexcept
 
virtual ~BoardEditorState_Select () noexcept
 
virtual bool entry () noexcept override
 
virtual bool exit () noexcept override
 
virtual bool processImportDxf () noexcept override
 
virtual bool processSelectAll () noexcept override
 
virtual bool processCut () noexcept override
 
virtual bool processCopy () noexcept override
 
virtual bool processPaste () noexcept override
 
virtual bool processMove (const Point &delta) noexcept override
 
virtual bool processRotate (const Angle &rotation) noexcept override
 
virtual bool processFlip (Qt::Orientation orientation) noexcept override
 
virtual bool processSnapToGrid () noexcept override
 
virtual bool processSetLocked (bool locked) noexcept override
 
virtual bool processChangeLineWidth (int step) noexcept override
 
virtual bool processResetAllTexts () noexcept override
 
virtual bool processRemove () noexcept override
 
virtual bool processEditProperties () noexcept override
 
virtual bool processAbortCommand () noexcept override
 
virtual bool processGraphicsSceneMouseMoved (QGraphicsSceneMouseEvent &e) noexcept override
 
virtual bool processGraphicsSceneLeftMouseButtonPressed (QGraphicsSceneMouseEvent &e) noexcept override
 
virtual bool processGraphicsSceneLeftMouseButtonReleased (QGraphicsSceneMouseEvent &e) noexcept override
 
virtual bool processGraphicsSceneLeftMouseButtonDoubleClicked (QGraphicsSceneMouseEvent &e) noexcept override
 
virtual bool processGraphicsSceneRightMouseButtonReleased (QGraphicsSceneMouseEvent &e) noexcept override
 
virtual bool processSwitchToBoard (int index) noexcept override
 
BoardEditorState_Selectoperator= (const BoardEditorState_Select &rhs)=delete
 
- Public Member Functions inherited from BoardEditorState
 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
 

Private Member Functions

bool startMovingSelectedItems (BoardGraphicsScene &scene, const Point &startPos) noexcept
 
bool moveSelectedItems (const Point &delta) noexcept
 
bool rotateSelectedItems (const Angle &angle) noexcept
 
bool flipSelectedItems (Qt::Orientation orientation) noexcept
 
bool snapSelectedItemsToGrid () noexcept
 
bool lockSelectedItems (bool locked) noexcept
 
bool changeWidthOfSelectedItems (int step) noexcept
 
bool resetAllTextsOfSelectedItems () noexcept
 
bool removeSelectedItems () noexcept
 
void removePolygonVertices (BI_Polygon &polygon, const QVector< int > vertices) noexcept
 
void removePlaneVertices (BI_Plane &plane, const QVector< int > vertices) noexcept
 
void removeZoneVertices (BI_Zone &zone, const QVector< int > vertices) noexcept
 
void startAddingPolygonVertex (BI_Polygon &polygon, int vertex, const Point &pos) noexcept
 
void startAddingPlaneVertex (BI_Plane &plane, int vertex, const Point &pos) noexcept
 
void startAddingZoneVertex (BI_Zone &zone, int vertex, const Point &pos) noexcept
 
bool copySelectedItemsToClipboard () noexcept
 
bool startPaste (BoardGraphicsScene &scene, std::unique_ptr< BoardClipboardData > data, const tl::optional< Point > &fixedPosition)
 
bool abortCommand (bool showErrMsgBox) noexcept
 
bool findPolygonVerticesAtPosition (const Point &pos) noexcept
 
bool findPlaneVerticesAtPosition (const Point &pos) noexcept
 
bool findZoneVerticesAtPosition (const Point &pos) noexcept
 
bool measureSelectedItems (const BI_NetLine &netline) noexcept
 Measure the length of the selected items. More...
 
void measureLengthInDirection (BoardGraphicsScene &scene, bool directionBackwards, const BI_NetLine &netline, QSet< Uuid > &visitedNetLines, UnsignedLength &totalLength)
 Internal helper method used by measureSelectedItems. More...
 
bool openPropertiesDialog (std::shared_ptr< QGraphicsItem > item)
 
void openDevicePropertiesDialog (BI_Device &device) noexcept
 
void openViaPropertiesDialog (BI_Via &via) noexcept
 
void openPlanePropertiesDialog (BI_Plane &plane) noexcept
 
void openZonePropertiesDialog (BI_Zone &zone) noexcept
 
void openPolygonPropertiesDialog (BI_Polygon &polygon) noexcept
 
void openStrokeTextPropertiesDialog (BI_StrokeText &text) noexcept
 
void openHolePropertiesDialog (BI_Hole &hole) noexcept
 
QList< DeviceMenuItemgetDeviceMenuItems (const ComponentInstance &cmpInst) const noexcept
 

Private Attributes

bool mIsUndoCmdActive
 An undo command will be active while dragging pasted items. More...
 
QScopedPointer< CmdDragSelectedBoardItemsmSelectedItemsDragCommand
 When dragging items, this undo command will be active. More...
 
BI_PolygonmSelectedPolygon
 The current polygon selected for editing (nullptr if none) More...
 
QVector< int > mSelectedPolygonVertices
 The polygon vertex indices selected for editing (empty if none) More...
 
QScopedPointer< CmdBoardPolygonEditmCmdPolygonEdit
 The polygon edit command (nullptr if not editing) More...
 
BI_PlanemSelectedPlane
 The current plane selected for editing (nullptr if none) More...
 
QVector< int > mSelectedPlaneVertices
 The plane vertex indices selected for editing (empty if none) More...
 
QScopedPointer< CmdBoardPlaneEditmCmdPlaneEdit
 The plane edit command (nullptr if not editing) More...
 
BI_ZonemSelectedZone
 The current zone selected for editing (nullptr if none) More...
 
QVector< int > mSelectedZoneVertices
 The zone vertex indices selected for editing (empty if none) More...
 
QScopedPointer< CmdBoardZoneEditmCmdZoneEdit
 The zone edit command (nullptr if not editing) More...
 

Additional Inherited Members

- Public Types inherited from BoardEditorState
enum class  FindFlag
 
using Context = BoardEditorFsm::Context
 
- Signals inherited from BoardEditorState
void requestLeavingState ()
 Signal to indicate that the current tool should be exited. More...
 
void statusBarMessageChanged (const QString &message, int timeoutMs=-1)
 
- Protected Member Functions inherited from BoardEditorState
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 inherited from BoardEditorState
Context mContext
 

Detailed Description

The "select" state/tool of the board editor (default state)

Constructor & Destructor Documentation

◆ BoardEditorState_Select() [1/3]

◆ BoardEditorState_Select() [2/3]

◆ BoardEditorState_Select() [3/3]

BoardEditorState_Select ( const Context context)
explicitnoexcept

◆ ~BoardEditorState_Select()

~BoardEditorState_Select ( )
virtualnoexcept

Member Function Documentation

◆ entry()

bool entry ( )
overridevirtualnoexcept

Reimplemented from BoardEditorState.

◆ exit()

bool exit ( )
overridevirtualnoexcept

Reimplemented from BoardEditorState.

+ Here is the call graph for this function:

◆ processImportDxf()

bool processImportDxf ( )
overridevirtualnoexcept

Reimplemented from BoardEditorState.

+ Here is the call graph for this function:

◆ processSelectAll()

bool processSelectAll ( )
overridevirtualnoexcept

Reimplemented from BoardEditorState.

+ Here is the call graph for this function:

◆ processCut()

bool processCut ( )
overridevirtualnoexcept

Reimplemented from BoardEditorState.

+ Here is the call graph for this function:

◆ processCopy()

bool processCopy ( )
overridevirtualnoexcept

Reimplemented from BoardEditorState.

+ Here is the call graph for this function:

◆ processPaste()

bool processPaste ( )
overridevirtualnoexcept

Reimplemented from BoardEditorState.

+ Here is the call graph for this function:

◆ processMove()

bool processMove ( const Point delta)
overridevirtualnoexcept

Reimplemented from BoardEditorState.

◆ processRotate()

bool processRotate ( const Angle rotation)
overridevirtualnoexcept

Reimplemented from BoardEditorState.

◆ processFlip()

bool processFlip ( Qt::Orientation  orientation)
overridevirtualnoexcept

Reimplemented from BoardEditorState.

◆ processSnapToGrid()

bool processSnapToGrid ( )
overridevirtualnoexcept

Reimplemented from BoardEditorState.

+ Here is the call graph for this function:

◆ processSetLocked()

bool processSetLocked ( bool  locked)
overridevirtualnoexcept

Reimplemented from BoardEditorState.

◆ processChangeLineWidth()

bool processChangeLineWidth ( int  step)
overridevirtualnoexcept

Reimplemented from BoardEditorState.

◆ processResetAllTexts()

bool processResetAllTexts ( )
overridevirtualnoexcept

Reimplemented from BoardEditorState.

+ Here is the call graph for this function:

◆ processRemove()

bool processRemove ( )
overridevirtualnoexcept

Reimplemented from BoardEditorState.

+ Here is the call graph for this function:

◆ processEditProperties()

bool processEditProperties ( )
overridevirtualnoexcept

Reimplemented from BoardEditorState.

+ Here is the call graph for this function:

◆ processAbortCommand()

bool processAbortCommand ( )
overridevirtualnoexcept

Reimplemented from BoardEditorState.

+ Here is the call graph for this function:

◆ processGraphicsSceneMouseMoved()

bool processGraphicsSceneMouseMoved ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from BoardEditorState.

+ Here is the call graph for this function:

◆ processGraphicsSceneLeftMouseButtonPressed()

bool processGraphicsSceneLeftMouseButtonPressed ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from BoardEditorState.

+ Here is the call graph for this function:

◆ processGraphicsSceneLeftMouseButtonReleased()

bool processGraphicsSceneLeftMouseButtonReleased ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from BoardEditorState.

+ Here is the call graph for this function:

◆ processGraphicsSceneLeftMouseButtonDoubleClicked()

bool processGraphicsSceneLeftMouseButtonDoubleClicked ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from BoardEditorState.

+ Here is the call graph for this function:

◆ processGraphicsSceneRightMouseButtonReleased()

bool processGraphicsSceneRightMouseButtonReleased ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from BoardEditorState.

+ Here is the call graph for this function:

◆ processSwitchToBoard()

bool processSwitchToBoard ( int  index)
overridevirtualnoexcept

Reimplemented from BoardEditorState.

◆ operator=()

BoardEditorState_Select & operator= ( const BoardEditorState_Select rhs)
delete

◆ startMovingSelectedItems()

bool startMovingSelectedItems ( BoardGraphicsScene scene,
const Point startPos 
)
privatenoexcept

◆ moveSelectedItems()

bool moveSelectedItems ( const Point delta)
privatenoexcept
+ Here is the call graph for this function:

◆ rotateSelectedItems()

bool rotateSelectedItems ( const Angle angle)
privatenoexcept
+ Here is the call graph for this function:

◆ flipSelectedItems()

bool flipSelectedItems ( Qt::Orientation  orientation)
privatenoexcept
+ Here is the call graph for this function:

◆ snapSelectedItemsToGrid()

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

◆ lockSelectedItems()

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

◆ changeWidthOfSelectedItems()

bool changeWidthOfSelectedItems ( int  step)
privatenoexcept
+ Here is the call graph for this function:

◆ resetAllTextsOfSelectedItems()

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

◆ removeSelectedItems()

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

◆ removePolygonVertices()

void removePolygonVertices ( BI_Polygon polygon,
const QVector< int >  vertices 
)
privatenoexcept
+ Here is the call graph for this function:

◆ removePlaneVertices()

void removePlaneVertices ( BI_Plane plane,
const QVector< int >  vertices 
)
privatenoexcept
+ Here is the call graph for this function:

◆ removeZoneVertices()

void removeZoneVertices ( BI_Zone zone,
const QVector< int >  vertices 
)
privatenoexcept
+ Here is the call graph for this function:

◆ startAddingPolygonVertex()

void startAddingPolygonVertex ( BI_Polygon polygon,
int  vertex,
const Point pos 
)
privatenoexcept
+ Here is the call graph for this function:

◆ startAddingPlaneVertex()

void startAddingPlaneVertex ( BI_Plane plane,
int  vertex,
const Point pos 
)
privatenoexcept
+ Here is the call graph for this function:

◆ startAddingZoneVertex()

void startAddingZoneVertex ( BI_Zone zone,
int  vertex,
const Point pos 
)
privatenoexcept
+ Here is the call graph for this function:

◆ copySelectedItemsToClipboard()

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

◆ startPaste()

bool startPaste ( BoardGraphicsScene scene,
std::unique_ptr< BoardClipboardData data,
const tl::optional< Point > &  fixedPosition 
)
private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ abortCommand()

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

◆ findPolygonVerticesAtPosition()

bool findPolygonVerticesAtPosition ( const Point pos)
privatenoexcept

◆ findPlaneVerticesAtPosition()

bool findPlaneVerticesAtPosition ( const Point pos)
privatenoexcept

◆ findZoneVerticesAtPosition()

bool findZoneVerticesAtPosition ( const Point pos)
privatenoexcept

◆ measureSelectedItems()

bool measureSelectedItems ( const BI_NetLine netline)
privatenoexcept

Measure the length of the selected items.

Note: Currently only non-branching non-intersecting segments can be measured!

Parameters
netlineA selected netline
+ Here is the call graph for this function:

◆ measureLengthInDirection()

void measureLengthInDirection ( BoardGraphicsScene scene,
bool  directionBackwards,
const BI_NetLine netline,
QSet< Uuid > &  visitedNetLines,
UnsignedLength totalLength 
)
private

Internal helper method used by measureSelectedItems.

Parameters
sceneScene of the board containing the traces.
directionBackwardsIf set to true, the segments are traversed "backwards" starting at the start anchor. Otherwise, the segments are traversed starting at the end anchor.
netlineThe netline that is used as starting point. The length of this netline will not be considered.
visitedNetLinesA set containing UUIDs of all visited netlines.
totalLengthA reference to the total length. The length of the found segments will be appended to this total length.
Exceptions
LogicErrorif there are branches or loops.
+ Here is the call graph for this function:

◆ openPropertiesDialog()

bool openPropertiesDialog ( std::shared_ptr< QGraphicsItem >  item)
private

◆ openDevicePropertiesDialog()

void openDevicePropertiesDialog ( BI_Device device)
privatenoexcept
+ Here is the caller graph for this function:

◆ openViaPropertiesDialog()

void openViaPropertiesDialog ( BI_Via via)
privatenoexcept
+ Here is the caller graph for this function:

◆ openPlanePropertiesDialog()

void openPlanePropertiesDialog ( BI_Plane plane)
privatenoexcept
+ Here is the caller graph for this function:

◆ openZonePropertiesDialog()

void openZonePropertiesDialog ( BI_Zone zone)
privatenoexcept
+ Here is the caller graph for this function:

◆ openPolygonPropertiesDialog()

void openPolygonPropertiesDialog ( BI_Polygon polygon)
privatenoexcept
+ Here is the caller graph for this function:

◆ openStrokeTextPropertiesDialog()

void openStrokeTextPropertiesDialog ( BI_StrokeText text)
privatenoexcept
+ Here is the caller graph for this function:

◆ openHolePropertiesDialog()

void openHolePropertiesDialog ( BI_Hole hole)
privatenoexcept
+ Here is the caller graph for this function:

◆ getDeviceMenuItems()

QList< BoardEditorState_Select::DeviceMenuItem > getDeviceMenuItems ( const ComponentInstance cmpInst) const
privatenoexcept
+ Here is the call graph for this function:

Member Data Documentation

◆ mIsUndoCmdActive

bool mIsUndoCmdActive
private

An undo command will be active while dragging pasted items.

◆ mSelectedItemsDragCommand

QScopedPointer<CmdDragSelectedBoardItems> mSelectedItemsDragCommand
private

When dragging items, this undo command will be active.

◆ mSelectedPolygon

BI_Polygon* mSelectedPolygon
private

The current polygon selected for editing (nullptr if none)

◆ mSelectedPolygonVertices

QVector<int> mSelectedPolygonVertices
private

The polygon vertex indices selected for editing (empty if none)

◆ mCmdPolygonEdit

QScopedPointer<CmdBoardPolygonEdit> mCmdPolygonEdit
private

The polygon edit command (nullptr if not editing)

◆ mSelectedPlane

BI_Plane* mSelectedPlane
private

The current plane selected for editing (nullptr if none)

◆ mSelectedPlaneVertices

QVector<int> mSelectedPlaneVertices
private

The plane vertex indices selected for editing (empty if none)

◆ mCmdPlaneEdit

QScopedPointer<CmdBoardPlaneEdit> mCmdPlaneEdit
private

The plane edit command (nullptr if not editing)

◆ mSelectedZone

BI_Zone* mSelectedZone
private

The current zone selected for editing (nullptr if none)

◆ mSelectedZoneVertices

QVector<int> mSelectedZoneVertices
private

The zone vertex indices selected for editing (empty if none)

◆ mCmdZoneEdit

QScopedPointer<CmdBoardZoneEdit> mCmdZoneEdit
private

The zone edit command (nullptr if not editing)


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