LibrePCB Developers Documentation
PackageEditorState_Select Class Referencefinal

The PackageEditorState_Select class. More...

#include <packageeditorstate_select.h>

+ Inheritance diagram for PackageEditorState_Select:
+ Collaboration diagram for PackageEditorState_Select:

Public Member Functions

 PackageEditorState_Select ()=delete
 
 PackageEditorState_Select (const PackageEditorState_Select &other)=delete
 
 PackageEditorState_Select (Context &context) noexcept
 
 ~PackageEditorState_Select () noexcept
 
bool exit () noexcept override
 
QSet< EditorWidgetBase::FeaturegetAvailableFeatures () const noexcept override
 
bool processGraphicsSceneMouseMoved (QGraphicsSceneMouseEvent &e) noexcept override
 
bool processGraphicsSceneLeftMouseButtonPressed (QGraphicsSceneMouseEvent &e) noexcept override
 
bool processGraphicsSceneLeftMouseButtonReleased (QGraphicsSceneMouseEvent &e) noexcept override
 
bool processGraphicsSceneLeftMouseButtonDoubleClicked (QGraphicsSceneMouseEvent &e) noexcept override
 
bool processGraphicsSceneRightMouseButtonReleased (QGraphicsSceneMouseEvent &e) noexcept override
 
bool processSelectAll () noexcept override
 
bool processCut () noexcept override
 
bool processCopy () noexcept override
 
bool processPaste () noexcept override
 
bool processMove (const Point &delta) noexcept override
 
bool processRotate (const Angle &rotation) noexcept override
 
bool processMirror (Qt::Orientation orientation) noexcept override
 
bool processFlip (Qt::Orientation orientation) noexcept override
 
bool processMoveAlign () noexcept override
 
bool processSnapToGrid () noexcept override
 
bool processRemove () noexcept override
 
bool processEditProperties () noexcept override
 
bool processGenerateOutline () noexcept override
 
bool processGenerateCourtyard () noexcept override
 
bool processImportDxf () noexcept override
 
bool processAbortCommand () noexcept override
 
PackageEditorState_Selectoperator= (const PackageEditorState_Select &rhs)=delete
 
- Public Member Functions inherited from PackageEditorState
 PackageEditorState ()=delete
 
 PackageEditorState (const PackageEditorState &other)=delete
 
 PackageEditorState (Context &context) noexcept
 
virtual ~PackageEditorState () noexcept
 
virtual bool entry () noexcept
 
virtual bool exit () noexcept
 
virtual QSet< EditorWidgetBase::FeaturegetAvailableFeatures () const noexcept=0
 
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 processSelectAll () noexcept
 
virtual bool processCut () noexcept
 
virtual bool processCopy () noexcept
 
virtual bool processPaste () noexcept
 
virtual bool processMove (const Point &delta)
 
virtual bool processRotate (const Angle &rotation) noexcept
 
virtual bool processMirror (Qt::Orientation orientation) noexcept
 
virtual bool processMoveAlign () noexcept
 
virtual bool processSnapToGrid () noexcept
 
virtual bool processFlip (Qt::Orientation orientation) noexcept
 
virtual bool processRemove () noexcept
 
virtual bool processEditProperties () noexcept
 
virtual bool processGenerateOutline () noexcept
 
virtual bool processGenerateCourtyard () noexcept
 
virtual bool processImportDxf () noexcept
 
virtual bool processAbortCommand () noexcept
 
PackageEditorStateoperator= (const PackageEditorState &rhs)=delete
 

Private Types

enum class  SubState
 

Private Member Functions

bool openContextMenuAtPos (const Point &pos) noexcept
 
bool openPropertiesDialogOfItem (std::shared_ptr< QGraphicsItem > item) noexcept
 
bool openPropertiesDialogOfItemAtPos (const Point &pos) noexcept
 
bool copySelectedItemsToClipboard () noexcept
 
bool canPasteGeometry (const std::unique_ptr< FootprintClipboardData > &data) const noexcept
 
bool pasteGeometryFromClipboard (std::unique_ptr< FootprintClipboardData > data) noexcept
 
bool startPaste (std::unique_ptr< FootprintClipboardData > data, const tl::optional< Point > &fixedPosition)
 
bool rotateSelectedItems (const Angle &angle) noexcept
 
bool mirrorSelectedItems (Qt::Orientation orientation, bool flipLayers) noexcept
 
bool moveAlignSelectedItems () noexcept
 
bool snapSelectedItemsToGrid () noexcept
 
bool removeSelectedItems () noexcept
 
bool generateOutline () noexcept
 
bool generateCourtyard () noexcept
 
void removePolygonVertices (std::shared_ptr< Polygon > polygon, const QVector< int > vertices) noexcept
 
void startAddingPolygonVertex (std::shared_ptr< Polygon > polygon, int vertex, const Point &pos) noexcept
 
void removeZoneVertices (std::shared_ptr< Zone > zone, const QVector< int > vertices) noexcept
 
void startAddingZoneVertex (std::shared_ptr< Zone > zone, int vertex, const Point &pos) noexcept
 
void setSelectionRect (const Point &p1, const Point &p2) noexcept
 
void clearSelectionRect (bool updateItemsSelectionState) noexcept
 
QList< std::shared_ptr< QGraphicsItem > > findItemsAtPosition (const Point &pos) noexcept
 
bool findPolygonVerticesAtPosition (const Point &pos) noexcept
 
bool findZoneVerticesAtPosition (const Point &pos) noexcept
 
void setState (SubState state) noexcept
 

Private Attributes

SubState mState
 
Point mStartPos
 
QScopedPointer< CmdDragSelectedFootprintItemsmCmdDragSelectedItems
 
std::shared_ptr< 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< CmdPolygonEditmCmdPolygonEdit
 The polygon edit command (nullptr if not editing) More...
 
std::shared_ptr< 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< CmdZoneEditmCmdZoneEdit
 The zone edit command (nullptr if not editing) More...
 

Additional Inherited Members

- Public Types inherited from PackageEditorState
using Context = PackageEditorFsm::Context
 
- Signals inherited from PackageEditorState
void abortRequested ()
 
void availableFeaturesChanged ()
 
void statusBarMessageChanged (const QString &message, int timeoutMs=-1)
 
- Protected Member Functions inherited from PackageEditorState
const PositiveLengthgetGridInterval () const noexcept
 
const LengthUnitgetLengthUnit () const noexcept
 
- Static Protected Member Functions inherited from PackageEditorState
static const QSet< const Layer * > & getAllowedTextLayers () noexcept
 
static const QSet< const Layer * > & getAllowedCircleAndPolygonLayers () noexcept
 
- Protected Attributes inherited from PackageEditorState
ContextmContext
 

Detailed Description

Member Enumeration Documentation

◆ SubState

enum class SubState
strongprivate
Enumerator
IDLE 
SELECTING 
MOVING 
PASTING 
MOVING_POLYGON_VERTEX 
MOVING_ZONE_VERTEX 

Constructor & Destructor Documentation

◆ PackageEditorState_Select() [1/3]

◆ PackageEditorState_Select() [2/3]

◆ PackageEditorState_Select() [3/3]

PackageEditorState_Select ( Context context)
explicitnoexcept

◆ ~PackageEditorState_Select()

Member Function Documentation

◆ exit()

bool exit ( )
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ getAvailableFeatures()

QSet< EditorWidgetBase::Feature > getAvailableFeatures ( ) const
overridevirtualnoexcept

Implements PackageEditorState.

+ Here is the call graph for this function:

◆ processGraphicsSceneMouseMoved()

bool processGraphicsSceneMouseMoved ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processGraphicsSceneLeftMouseButtonPressed()

bool processGraphicsSceneLeftMouseButtonPressed ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processGraphicsSceneLeftMouseButtonReleased()

bool processGraphicsSceneLeftMouseButtonReleased ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processGraphicsSceneLeftMouseButtonDoubleClicked()

bool processGraphicsSceneLeftMouseButtonDoubleClicked ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processGraphicsSceneRightMouseButtonReleased()

bool processGraphicsSceneRightMouseButtonReleased ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processSelectAll()

bool processSelectAll ( )
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processCut()

bool processCut ( )
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processCopy()

bool processCopy ( )
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processPaste()

bool processPaste ( )
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processMove()

bool processMove ( const Point delta)
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processRotate()

bool processRotate ( const Angle rotation)
overridevirtualnoexcept

Reimplemented from PackageEditorState.

◆ processMirror()

bool processMirror ( Qt::Orientation  orientation)
overridevirtualnoexcept

Reimplemented from PackageEditorState.

◆ processFlip()

bool processFlip ( Qt::Orientation  orientation)
overridevirtualnoexcept

Reimplemented from PackageEditorState.

◆ processMoveAlign()

bool processMoveAlign ( )
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processSnapToGrid()

bool processSnapToGrid ( )
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processRemove()

bool processRemove ( )
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processEditProperties()

bool processEditProperties ( )
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processGenerateOutline()

bool processGenerateOutline ( )
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processGenerateCourtyard()

bool processGenerateCourtyard ( )
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processImportDxf()

bool processImportDxf ( )
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processAbortCommand()

bool processAbortCommand ( )
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

PackageEditorState_Select & operator= ( const PackageEditorState_Select rhs)
delete

◆ openContextMenuAtPos()

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

◆ openPropertiesDialogOfItem()

bool openPropertiesDialogOfItem ( std::shared_ptr< QGraphicsItem >  item)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ openPropertiesDialogOfItemAtPos()

bool openPropertiesDialogOfItemAtPos ( const Point pos)
privatenoexcept

◆ copySelectedItemsToClipboard()

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

◆ canPasteGeometry()

bool canPasteGeometry ( const std::unique_ptr< FootprintClipboardData > &  data) const
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pasteGeometryFromClipboard()

bool pasteGeometryFromClipboard ( std::unique_ptr< FootprintClipboardData data)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ startPaste()

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

◆ rotateSelectedItems()

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

◆ mirrorSelectedItems()

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

◆ moveAlignSelectedItems()

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

◆ snapSelectedItemsToGrid()

bool snapSelectedItemsToGrid ( )
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:

◆ generateOutline()

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

◆ generateCourtyard()

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

◆ removePolygonVertices()

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

◆ startAddingPolygonVertex()

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

◆ removeZoneVertices()

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

◆ startAddingZoneVertex()

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

◆ setSelectionRect()

void setSelectionRect ( const Point p1,
const Point p2 
)
privatenoexcept

◆ clearSelectionRect()

void clearSelectionRect ( bool  updateItemsSelectionState)
privatenoexcept
+ Here is the caller graph for this function:

◆ findItemsAtPosition()

QList< std::shared_ptr< QGraphicsItem > > findItemsAtPosition ( const Point pos)
privatenoexcept

◆ findPolygonVerticesAtPosition()

bool findPolygonVerticesAtPosition ( const Point pos)
privatenoexcept

◆ findZoneVerticesAtPosition()

bool findZoneVerticesAtPosition ( const Point pos)
privatenoexcept

◆ setState()

void setState ( SubState  state)
privatenoexcept
+ Here is the caller graph for this function:

Member Data Documentation

◆ mState

SubState mState
private

◆ mStartPos

Point mStartPos
private

◆ mCmdDragSelectedItems

QScopedPointer<CmdDragSelectedFootprintItems> mCmdDragSelectedItems
private

◆ mSelectedPolygon

std::shared_ptr<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<CmdPolygonEdit> mCmdPolygonEdit
private

The polygon edit command (nullptr if not editing)

◆ mSelectedZone

std::shared_ptr<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<CmdZoneEdit> mCmdZoneEdit
private

The zone edit command (nullptr if not editing)


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