LibrePCB Developers Documentation
Loading...
Searching...
No Matches
PackageEditorWidget Class Referencefinal

The PackageEditorWidget class. More...

#include <packageeditorwidget.h>

+ Inheritance diagram for PackageEditorWidget:
+ Collaboration diagram for PackageEditorWidget:

Public Slots

bool save () noexcept override
 
bool selectAll () noexcept override
 
bool cut () noexcept override
 
bool copy () noexcept override
 
bool paste () noexcept override
 
bool move (Qt::ArrowType direction) noexcept override
 
bool rotate (const librepcb::Angle &rotation) noexcept override
 
bool mirror (Qt::Orientation orientation) noexcept override
 
bool flip (Qt::Orientation orientation) noexcept override
 
bool moveAlign () noexcept override
 
bool snapToGrid () noexcept override
 
bool remove () noexcept override
 
bool editProperties () noexcept override
 
bool zoomIn () noexcept override
 
bool zoomOut () noexcept override
 
bool zoomAll () noexcept override
 
bool toggle3D () noexcept override
 
bool abortCommand () noexcept override
 
bool processGenerateOutline () noexcept override
 
bool processGenerateCourtyard () noexcept override
 
bool importDxf () noexcept override
 
bool editGridProperties () noexcept override
 
bool increaseGridInterval () noexcept override
 
bool decreaseGridInterval () noexcept override
 
bool toggleBackgroundImage () noexcept override
 
- Public Slots inherited from EditorWidgetBase
virtual bool save () noexcept
 
virtual bool selectAll () noexcept
 
virtual bool cut () noexcept
 
virtual bool copy () noexcept
 
virtual bool paste () noexcept
 
virtual bool move (Qt::ArrowType direction) noexcept
 
virtual bool rotate (const librepcb::Angle &rotation) noexcept
 
virtual bool mirror (Qt::Orientation orientation) noexcept
 
virtual bool flip (Qt::Orientation orientation) noexcept
 
virtual bool moveAlign () noexcept
 
virtual bool snapToGrid () noexcept
 
virtual bool remove () noexcept
 
virtual bool editProperties () noexcept
 
virtual bool zoomIn () noexcept
 
virtual bool zoomOut () noexcept
 
virtual bool zoomAll () noexcept
 
virtual bool toggle3D () noexcept
 
virtual bool abortCommand () noexcept
 
virtual bool processGenerateOutline () noexcept
 
virtual bool processGenerateCourtyard () noexcept
 
virtual bool importDxf () noexcept
 
virtual bool exportImage () noexcept
 
virtual bool exportPdf () noexcept
 
virtual bool print () noexcept
 
virtual bool editGridProperties () noexcept
 
virtual bool increaseGridInterval () noexcept
 
virtual bool decreaseGridInterval () noexcept
 
virtual bool toggleBackgroundImage () noexcept
 

Public Member Functions

 PackageEditorWidget ()=delete
 
 PackageEditorWidget (const PackageEditorWidget &other)=delete
 
 PackageEditorWidget (const Context &context, const FilePath &fp, QWidget *parent=nullptr)
 
 ~PackageEditorWidget () noexcept
 
bool isBackgroundImageSet () const noexcept override
 
QSet< FeaturegetAvailableFeatures () const noexcept override
 
void connectEditor (UndoStackActionGroup &undoStackActionGroup, ExclusiveActionGroup &toolsActionGroup, QToolBar &commandToolBar, StatusBar &statusBar) noexcept override
 
void disconnectEditor () noexcept override
 
PackageEditorWidgetoperator= (const PackageEditorWidget &rhs)=delete
 
template<>
void fixMsg (const MsgDeprecatedAssemblyType &msg)
 
template<>
void fixMsg (const MsgSuspiciousAssemblyType &msg)
 
template<>
void fixMsg (const MsgNameNotTitleCase &msg)
 
template<>
void fixMsg (const MsgMissingAuthor &msg)
 
template<>
void fixMsg (const MsgMissingCategories &msg)
 
template<>
void fixMsg (const MsgMissingPackageOutline &msg)
 
template<>
void fixMsg (const MsgMinimumWidthViolation &msg)
 
template<>
void fixMsg (const MsgMissingCourtyard &msg)
 
template<>
void fixMsg (const MsgMissingFootprint &msg)
 
template<>
void fixMsg (const MsgMissingFootprintModel &msg)
 
template<>
void fixMsg (const MsgMissingFootprintName &msg)
 
template<>
void fixMsg (const MsgMissingFootprintValue &msg)
 
template<>
void fixMsg (const MsgFootprintOriginNotInCenter &msg)
 
template<>
void fixMsg (const MsgWrongFootprintTextLayer &msg)
 
template<>
void fixMsg (const MsgUnusedCustomPadOutline &msg)
 
template<>
void fixMsg (const MsgInvalidCustomPadOutline &msg)
 
template<>
void fixMsg (const MsgPadStopMaskOff &msg)
 
template<>
void fixMsg (const MsgSmtPadWithSolderPaste &msg)
 
template<>
void fixMsg (const MsgThtPadWithSolderPaste &msg)
 
template<>
void fixMsg (const MsgPadWithCopperClearance &msg)
 
template<>
void fixMsg (const MsgFiducialClearanceLessThanStopMask &msg)
 
template<>
void fixMsg (const MsgHoleWithoutStopMask &msg)
 
template<>
void fixMsg (const MsgUnspecifiedPadFunction &msg)
 
template<>
void fixMsg (const MsgSuspiciousPadFunction &msg)
 
- Public Member Functions inherited from EditorWidgetBase
 EditorWidgetBase ()=delete
 
 EditorWidgetBase (const EditorWidgetBase &other)=delete
 
 EditorWidgetBase (const Context &context, const FilePath &fp, QWidget *parent=nullptr)
 
virtual ~EditorWidgetBase () noexcept
 
const FilePathgetFilePath () const noexcept
 
bool isDirty () const noexcept
 
EditorWidgetBaseoperator= (const EditorWidgetBase &rhs)=delete
 
- Public Member Functions inherited from IF_GraphicsViewEventHandler
 IF_GraphicsViewEventHandler () noexcept
 
virtual ~IF_GraphicsViewEventHandler () noexcept
 

Private Member Functions

void updateMetadata () noexcept
 
QString commitMetadata () noexcept
 
bool graphicsViewEventHandler (QEvent *event) noexcept override
 
bool toolChangeRequested (Tool newTool, const QVariant &mode) noexcept override
 
void currentFootprintChanged (int index) noexcept
 
void currentModelChanged (int index) noexcept
 
void scheduleOpenGlSceneUpdate () noexcept
 
void updateOpenGlScene () noexcept
 
void memorizePackageInterface () noexcept
 
bool isInterfaceBroken () const noexcept override
 
bool runChecks (RuleCheckMessageList &msgs) const override
 
template<typename MessageType >
void fixMsg (const MessageType &msg)
 
template<typename MessageType >
void fixPadFunction (const MessageType &msg)
 
template<typename MessageType >
bool fixMsgHelper (std::shared_ptr< const RuleCheckMessage > msg, bool applyFix)
 
bool processRuleCheckMessage (std::shared_ptr< const RuleCheckMessage > msg, bool applyFix) override
 
void ruleCheckApproveRequested (std::shared_ptr< const RuleCheckMessage > msg, bool approve) noexcept override
 
bool execGraphicsExportDialog (GraphicsExportDialog::Output output, const QString &settingsKey) noexcept override
 
void setGridProperties (const PositiveLength &interval, const LengthUnit &unit, Theme::GridStyle style) noexcept
 
void applyBackgroundImageSettings () noexcept
 
FilePath getBackgroundImageCacheDir () const noexcept
 
void toggle3DMode (bool enable) noexcept
 
bool is3DModeEnabled () const noexcept
 

Private Attributes

QScopedPointer< Ui::PackageEditorWidget > mUi
 
QScopedPointer< OpenGlViewmOpenGlView
 
QScopedPointer< CategoryListEditorWidgetmCategoriesEditorWidget
 
QScopedPointer< GraphicsScenemGraphicsScene
 
QScopedPointer< OpenGlSceneBuildermOpenGlSceneBuilder
 
bool mOpenGlSceneBuildScheduled
 
LengthUnit mLengthUnit
 
std::unique_ptr< PackagemPackage
 
std::shared_ptr< FootprintmCurrentFootprint
 
std::shared_ptr< PackageModelmCurrentModel
 
BackgroundImageSettings mBackgroundImageSettings
 
std::shared_ptr< QGraphicsPixmapItem > mBackgroundImageGraphicsItem
 
QSet< UuidmOriginalPadUuids
 
FootprintList mOriginalFootprints
 
QScopedPointer< PackageEditorFsmmFsm
 Editor state machine.
 

Additional Inherited Members

- Public Types inherited from EditorWidgetBase
enum  Tool
 
enum class  Feature
 
- Signals inherited from EditorWidgetBase
void dirtyChanged (bool dirty)
 
void elementEdited (const librepcb::FilePath &fp)
 
void interfaceBrokenChanged (bool broken)
 
void errorsAvailableChanged (bool hasErrors)
 
void availableFeaturesChanged (const QSet< librepcb::editor::EditorWidgetBase::Feature > &features)
 
- Protected Member Functions inherited from EditorWidgetBase
void setupInterfaceBrokenWarningWidget (QWidget &widget) noexcept
 
void setupErrorNotificationWidget (QWidget &widget) noexcept
 
void setMessageApproved (LibraryBaseElement &element, std::shared_ptr< const RuleCheckMessage > msg, bool approve) noexcept
 
void undoStackStateModified () noexcept
 
void setStatusBarMessage (const QString &message, int timeoutMs=-1) noexcept
 
const QStringList & getLibLocaleOrder () const noexcept
 
QString getWorkspaceSettingsUserName () noexcept
 
- Protected Member Functions inherited from IF_RuleCheckHandler
 IF_RuleCheckHandler () noexcept
 
 IF_RuleCheckHandler (const IF_RuleCheckHandler &) noexcept
 
virtual ~IF_RuleCheckHandler () noexcept
 
- Protected Attributes inherited from EditorWidgetBase
Context mContext
 
FilePath mFilePath
 
std::shared_ptr< TransactionalFileSystemmFileSystem
 
QScopedPointer< UndoStackmUndoStack
 
UndoStackActionGroupmUndoStackActionGroup
 
ExclusiveActionGroupmToolsActionGroup
 
StatusBarmStatusBar
 
QScopedPointer< ToolBarProxymCommandToolBarProxy
 
bool mManualModificationsMade
 Modifications bypassing the undo stack.
 
bool mIsInterfaceBroken
 
QString mStatusBarMessage
 
QSet< SExpressionmSupportedApprovals
 
QSet< SExpressionmDisappearedApprovals
 

Detailed Description

Constructor & Destructor Documentation

◆ PackageEditorWidget() [1/3]

PackageEditorWidget ( )
delete

◆ PackageEditorWidget() [2/3]

PackageEditorWidget ( const PackageEditorWidget other)
delete

◆ PackageEditorWidget() [3/3]

PackageEditorWidget ( const Context context,
const FilePath fp,
QWidget *  parent = nullptr 
)
+ Here is the call graph for this function:

◆ ~PackageEditorWidget()

~PackageEditorWidget ( )
noexcept

Member Function Documentation

◆ isBackgroundImageSet()

bool isBackgroundImageSet ( ) const
overridevirtualnoexcept

Reimplemented from EditorWidgetBase.

◆ getAvailableFeatures()

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

Implements EditorWidgetBase.

◆ connectEditor()

void connectEditor ( UndoStackActionGroup undoStackActionGroup,
ExclusiveActionGroup toolsActionGroup,
QToolBar &  commandToolBar,
StatusBar statusBar 
)
overridevirtualnoexcept

Reimplemented from EditorWidgetBase.

+ Here is the call graph for this function:

◆ disconnectEditor()

void disconnectEditor ( )
overridevirtualnoexcept

Reimplemented from EditorWidgetBase.

+ Here is the call graph for this function:

◆ operator=()

PackageEditorWidget & operator= ( const PackageEditorWidget rhs)
delete

◆ save

bool save ( )
overrideslotnoexcept
+ Here is the call graph for this function:

◆ selectAll

bool selectAll ( )
overrideslotnoexcept

◆ cut

bool cut ( )
overrideslotnoexcept

◆ copy

bool copy ( )
overrideslotnoexcept

◆ paste

bool paste ( )
overrideslotnoexcept

◆ move

bool move ( Qt::ArrowType  direction)
overrideslotnoexcept
+ Here is the call graph for this function:

◆ rotate

bool rotate ( const librepcb::Angle rotation)
overrideslotnoexcept

◆ mirror

bool mirror ( Qt::Orientation  orientation)
overrideslotnoexcept

◆ flip

bool flip ( Qt::Orientation  orientation)
overrideslotnoexcept

◆ moveAlign

bool moveAlign ( )
overrideslotnoexcept

◆ snapToGrid

bool snapToGrid ( )
overrideslotnoexcept

◆ remove

bool remove ( )
overrideslotnoexcept

◆ editProperties

bool editProperties ( )
overrideslotnoexcept

◆ zoomIn

bool zoomIn ( )
overrideslotnoexcept
+ Here is the call graph for this function:

◆ zoomOut

bool zoomOut ( )
overrideslotnoexcept
+ Here is the call graph for this function:

◆ zoomAll

bool zoomAll ( )
overrideslotnoexcept
+ Here is the call graph for this function:

◆ toggle3D

bool toggle3D ( )
overrideslotnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ abortCommand

bool abortCommand ( )
overrideslotnoexcept

◆ processGenerateOutline

bool processGenerateOutline ( )
overrideslotnoexcept

◆ processGenerateCourtyard

bool processGenerateCourtyard ( )
overrideslotnoexcept

◆ importDxf

bool importDxf ( )
overrideslotnoexcept

◆ editGridProperties

bool editGridProperties ( )
overrideslotnoexcept
+ Here is the call graph for this function:

◆ increaseGridInterval

bool increaseGridInterval ( )
overrideslotnoexcept
+ Here is the call graph for this function:

◆ decreaseGridInterval

bool decreaseGridInterval ( )
overrideslotnoexcept
+ Here is the call graph for this function:

◆ toggleBackgroundImage

bool toggleBackgroundImage ( )
overrideslotnoexcept
+ Here is the call graph for this function:

◆ updateMetadata()

void updateMetadata ( )
privatenoexcept
+ Here is the caller graph for this function:

◆ commitMetadata()

QString commitMetadata ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ graphicsViewEventHandler()

bool graphicsViewEventHandler ( QEvent *  event)
overrideprivatevirtualnoexcept

◆ toolChangeRequested()

bool toolChangeRequested ( Tool  newTool,
const QVariant &  mode 
)
overrideprivatevirtualnoexcept

Reimplemented from EditorWidgetBase.

◆ currentFootprintChanged()

void currentFootprintChanged ( int  index)
privatenoexcept
+ Here is the caller graph for this function:

◆ currentModelChanged()

void currentModelChanged ( int  index)
privatenoexcept
+ Here is the caller graph for this function:

◆ scheduleOpenGlSceneUpdate()

void scheduleOpenGlSceneUpdate ( )
privatenoexcept
+ Here is the caller graph for this function:

◆ updateOpenGlScene()

void updateOpenGlScene ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memorizePackageInterface()

void memorizePackageInterface ( )
privatenoexcept
+ Here is the caller graph for this function:

◆ isInterfaceBroken()

bool isInterfaceBroken ( ) const
overrideprivatevirtualnoexcept

Implements EditorWidgetBase.

+ Here is the call graph for this function:

◆ runChecks()

bool runChecks ( RuleCheckMessageList msgs) const
overrideprivatevirtual

Implements EditorWidgetBase.

◆ fixMsg() [1/25]

template<typename MessageType >
void fixMsg ( const MessageType &  msg)
private
+ Here is the caller graph for this function:

◆ fixPadFunction()

template<typename MessageType >
void fixPadFunction ( const MessageType &  msg)
private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fixMsgHelper()

template<typename MessageType >
bool fixMsgHelper ( std::shared_ptr< const RuleCheckMessage msg,
bool  applyFix 
)
private
+ Here is the call graph for this function:

◆ processRuleCheckMessage()

bool processRuleCheckMessage ( std::shared_ptr< const RuleCheckMessage msg,
bool  applyFix 
)
overrideprivatevirtual

Implements EditorWidgetBase.

◆ ruleCheckApproveRequested()

void ruleCheckApproveRequested ( std::shared_ptr< const RuleCheckMessage msg,
bool  approve 
)
overrideprivatevirtualnoexcept

Implements IF_RuleCheckHandler.

◆ execGraphicsExportDialog()

bool execGraphicsExportDialog ( GraphicsExportDialog::Output  output,
const QString &  settingsKey 
)
overrideprivatevirtualnoexcept

Reimplemented from EditorWidgetBase.

+ Here is the call graph for this function:

◆ setGridProperties()

void setGridProperties ( const PositiveLength interval,
const LengthUnit unit,
Theme::GridStyle  style 
)
privatenoexcept
+ Here is the caller graph for this function:

◆ applyBackgroundImageSettings()

void applyBackgroundImageSettings ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBackgroundImageCacheDir()

FilePath getBackgroundImageCacheDir ( ) const
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toggle3DMode()

void toggle3DMode ( bool  enable)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is3DModeEnabled()

bool is3DModeEnabled ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ fixMsg() [2/25]

template<>
void fixMsg ( const MsgDeprecatedAssemblyType msg)

◆ fixMsg() [3/25]

template<>
void fixMsg ( const MsgSuspiciousAssemblyType msg)

◆ fixMsg() [4/25]

template<>
void fixMsg ( const MsgNameNotTitleCase msg)
+ Here is the call graph for this function:

◆ fixMsg() [5/25]

template<>
void fixMsg ( const MsgMissingAuthor msg)
+ Here is the call graph for this function:

◆ fixMsg() [6/25]

template<>
void fixMsg ( const MsgMissingCategories msg)

◆ fixMsg() [7/25]

template<>
void fixMsg ( const MsgMissingPackageOutline msg)
+ Here is the call graph for this function:

◆ fixMsg() [8/25]

template<>
void fixMsg ( const MsgMinimumWidthViolation msg)
+ Here is the call graph for this function:

◆ fixMsg() [9/25]

template<>
void fixMsg ( const MsgMissingCourtyard msg)
+ Here is the call graph for this function:

◆ fixMsg() [10/25]

template<>
void fixMsg ( const MsgMissingFootprint msg)
+ Here is the call graph for this function:

◆ fixMsg() [11/25]

template<>
void fixMsg ( const MsgMissingFootprintModel msg)
+ Here is the call graph for this function:

◆ fixMsg() [12/25]

template<>
void fixMsg ( const MsgMissingFootprintName msg)
+ Here is the call graph for this function:

◆ fixMsg() [13/25]

template<>
void fixMsg ( const MsgMissingFootprintValue msg)
+ Here is the call graph for this function:

◆ fixMsg() [14/25]

template<>
void fixMsg ( const MsgFootprintOriginNotInCenter msg)
+ Here is the call graph for this function:

◆ fixMsg() [15/25]

template<>
void fixMsg ( const MsgWrongFootprintTextLayer msg)
+ Here is the call graph for this function:

◆ fixMsg() [16/25]

template<>
void fixMsg ( const MsgUnusedCustomPadOutline msg)
+ Here is the call graph for this function:

◆ fixMsg() [17/25]

template<>
void fixMsg ( const MsgInvalidCustomPadOutline msg)
+ Here is the call graph for this function:

◆ fixMsg() [18/25]

template<>
void fixMsg ( const MsgPadStopMaskOff msg)
+ Here is the call graph for this function:

◆ fixMsg() [19/25]

template<>
void fixMsg ( const MsgSmtPadWithSolderPaste msg)
+ Here is the call graph for this function:

◆ fixMsg() [20/25]

template<>
void fixMsg ( const MsgThtPadWithSolderPaste msg)
+ Here is the call graph for this function:

◆ fixMsg() [21/25]

template<>
void fixMsg ( const MsgPadWithCopperClearance msg)
+ Here is the call graph for this function:

◆ fixMsg() [22/25]

template<>
void fixMsg ( const MsgFiducialClearanceLessThanStopMask msg)
+ Here is the call graph for this function:

◆ fixMsg() [23/25]

template<>
void fixMsg ( const MsgHoleWithoutStopMask msg)
+ Here is the call graph for this function:

◆ fixMsg() [24/25]

template<>
void fixMsg ( const MsgUnspecifiedPadFunction msg)
+ Here is the call graph for this function:

◆ fixMsg() [25/25]

template<>
void fixMsg ( const MsgSuspiciousPadFunction msg)
+ Here is the call graph for this function:

Member Data Documentation

◆ mUi

QScopedPointer<Ui::PackageEditorWidget> mUi
private

◆ mOpenGlView

QScopedPointer<OpenGlView> mOpenGlView
private

◆ mCategoriesEditorWidget

QScopedPointer<CategoryListEditorWidget> mCategoriesEditorWidget
private

◆ mGraphicsScene

QScopedPointer<GraphicsScene> mGraphicsScene
private

◆ mOpenGlSceneBuilder

QScopedPointer<OpenGlSceneBuilder> mOpenGlSceneBuilder
private

◆ mOpenGlSceneBuildScheduled

bool mOpenGlSceneBuildScheduled
private

◆ mLengthUnit

LengthUnit mLengthUnit
private

◆ mPackage

std::unique_ptr<Package> mPackage
private

◆ mCurrentFootprint

std::shared_ptr<Footprint> mCurrentFootprint
private

◆ mCurrentModel

std::shared_ptr<PackageModel> mCurrentModel
private

◆ mBackgroundImageSettings

BackgroundImageSettings mBackgroundImageSettings
private

◆ mBackgroundImageGraphicsItem

std::shared_ptr<QGraphicsPixmapItem> mBackgroundImageGraphicsItem
private

◆ mOriginalPadUuids

QSet<Uuid> mOriginalPadUuids
private

◆ mOriginalFootprints

FootprintList mOriginalFootprints
private

◆ mFsm

QScopedPointer<PackageEditorFsm> mFsm
private

Editor state machine.


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