LibrePCB Developers Documentation
SymbolEditorState_DrawPolygonBase Class Reference

The SymbolEditorState_DrawPolygonBase class. More...

#include <symboleditorstate_drawpolygonbase.h>

+ Inheritance diagram for SymbolEditorState_DrawPolygonBase:
+ Collaboration diagram for SymbolEditorState_DrawPolygonBase:

Public Types

enum  Mode
 
- Public Types inherited from SymbolEditorState
using Context = SymbolEditorFsm::Context
 

Public Member Functions

 SymbolEditorState_DrawPolygonBase ()=delete
 
 SymbolEditorState_DrawPolygonBase (const SymbolEditorState_DrawPolygonBase &other)=delete
 
 SymbolEditorState_DrawPolygonBase (const Context &context, Mode mode) noexcept
 
virtual ~SymbolEditorState_DrawPolygonBase () noexcept
 
bool processKeyPressed (const QKeyEvent &e) noexcept override
 
bool processKeyReleased (const QKeyEvent &e) noexcept override
 
bool entry () noexcept override
 
bool exit () noexcept override
 
QSet< EditorWidgetBase::FeaturegetAvailableFeatures () const noexcept override
 
bool processGraphicsSceneMouseMoved (QGraphicsSceneMouseEvent &e) noexcept override
 
bool processGraphicsSceneLeftMouseButtonPressed (QGraphicsSceneMouseEvent &e) noexcept override
 
bool processGraphicsSceneLeftMouseButtonDoubleClicked (QGraphicsSceneMouseEvent &e) noexcept override
 
bool processAbortCommand () noexcept override
 
SymbolEditorState_DrawPolygonBaseoperator= (const SymbolEditorState_DrawPolygonBase &rhs)=delete
 
- Public Member Functions inherited from SymbolEditorState
 SymbolEditorState ()=delete
 
 SymbolEditorState (const SymbolEditorState &other)=delete
 
 SymbolEditorState (const Context &context) noexcept
 
virtual ~SymbolEditorState () noexcept
 
virtual bool processGraphicsSceneLeftMouseButtonReleased (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 (Qt::ArrowType direction)
 
virtual bool processRotate (const Angle &rotation) noexcept
 
virtual bool processMirror (Qt::Orientation orientation) noexcept
 
virtual bool processSnapToGrid () noexcept
 
virtual bool processRemove () noexcept
 
virtual bool processEditProperties () noexcept
 
virtual bool processImportDxf () noexcept
 
SymbolEditorStateoperator= (const SymbolEditorState &rhs)=delete
 

Private Member Functions

bool start () noexcept
 
bool abort (bool showErrMsgBox=true) noexcept
 
bool addNextSegment () noexcept
 
void updateCursorPosition (Qt::KeyboardModifiers modifiers) noexcept
 
void updatePolygonPath () noexcept
 
void updateOverlayText () noexcept
 
void updateStatusBarMessage () noexcept
 
void layerComboBoxValueChanged (const Layer &layer) noexcept
 
void lineWidthEditValueChanged (const UnsignedLength &value) noexcept
 
void angleEditValueChanged (const Angle &value) noexcept
 
void fillCheckBoxCheckedChanged (bool checked) noexcept
 
void grabAreaCheckBoxCheckedChanged (bool checked) noexcept
 

Private Attributes

Mode mMode
 
bool mIsUndoCmdActive
 
QScopedPointer< CmdPolygonEditmEditCmd
 
std::shared_ptr< PolygonmCurrentPolygon
 
std::shared_ptr< PolygonGraphicsItemmCurrentGraphicsItem
 
Point mLastScenePos
 
Point mCursorPos
 
Point mArcCenter
 
bool mArcInSecondState
 
const LayermLastLayer
 
UnsignedLength mLastLineWidth
 
Angle mLastAngle
 
bool mLastFill
 
bool mLastGrabArea
 

Additional Inherited Members

- Signals inherited from SymbolEditorState
void availableFeaturesChanged ()
 
void statusBarMessageChanged (const QString &message, int timeoutMs=-1)
 
- Protected Member Functions inherited from SymbolEditorState
const PositiveLengthgetGridInterval () const noexcept
 
const LengthUnitgetLengthUnit () const noexcept
 
- Static Protected Member Functions inherited from SymbolEditorState
static const QSet< const Layer * > & getAllowedTextLayers () noexcept
 
static const QSet< const Layer * > & getAllowedCircleAndPolygonLayers () noexcept
 
- Protected Attributes inherited from SymbolEditorState
Context mContext
 

Detailed Description

Member Enumeration Documentation

◆ Mode

enum Mode
strong
Enumerator
LINE 
ARC 
RECT 
POLYGON 

Constructor & Destructor Documentation

◆ SymbolEditorState_DrawPolygonBase() [1/3]

◆ SymbolEditorState_DrawPolygonBase() [2/3]

◆ SymbolEditorState_DrawPolygonBase() [3/3]

SymbolEditorState_DrawPolygonBase ( const Context context,
Mode  mode 
)
noexcept
+ Here is the call graph for this function:

◆ ~SymbolEditorState_DrawPolygonBase()

~SymbolEditorState_DrawPolygonBase ( )
virtualnoexcept
+ Here is the caller graph for this function:

Member Function Documentation

◆ processKeyPressed()

bool processKeyPressed ( const QKeyEvent &  e)
overridevirtualnoexcept

Reimplemented from SymbolEditorState.

+ Here is the call graph for this function:

◆ processKeyReleased()

bool processKeyReleased ( const QKeyEvent &  e)
overridevirtualnoexcept

Reimplemented from SymbolEditorState.

+ Here is the call graph for this function:

◆ entry()

bool entry ( )
overridevirtualnoexcept

Reimplemented from SymbolEditorState.

+ Here is the call graph for this function:

◆ exit()

bool exit ( )
overridevirtualnoexcept

Reimplemented from SymbolEditorState.

+ Here is the call graph for this function:

◆ getAvailableFeatures()

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

Implements SymbolEditorState.

◆ processGraphicsSceneMouseMoved()

bool processGraphicsSceneMouseMoved ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from SymbolEditorState.

+ Here is the call graph for this function:

◆ processGraphicsSceneLeftMouseButtonPressed()

bool processGraphicsSceneLeftMouseButtonPressed ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from SymbolEditorState.

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

◆ processGraphicsSceneLeftMouseButtonDoubleClicked()

bool processGraphicsSceneLeftMouseButtonDoubleClicked ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from SymbolEditorState.

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

◆ processAbortCommand()

bool processAbortCommand ( )
overridevirtualnoexcept

Reimplemented from SymbolEditorState.

+ Here is the call graph for this function:

◆ operator=()

◆ start()

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

◆ abort()

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

◆ addNextSegment()

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

◆ updateCursorPosition()

void updateCursorPosition ( Qt::KeyboardModifiers  modifiers)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updatePolygonPath()

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

◆ updateOverlayText()

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

◆ updateStatusBarMessage()

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

◆ layerComboBoxValueChanged()

void layerComboBoxValueChanged ( const Layer layer)
privatenoexcept
+ Here is the caller graph for this function:

◆ lineWidthEditValueChanged()

void lineWidthEditValueChanged ( const UnsignedLength value)
privatenoexcept
+ Here is the caller graph for this function:

◆ angleEditValueChanged()

void angleEditValueChanged ( const Angle value)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillCheckBoxCheckedChanged()

void fillCheckBoxCheckedChanged ( bool  checked)
privatenoexcept
+ Here is the caller graph for this function:

◆ grabAreaCheckBoxCheckedChanged()

void grabAreaCheckBoxCheckedChanged ( bool  checked)
privatenoexcept
+ Here is the caller graph for this function:

Member Data Documentation

◆ mMode

Mode mMode
private

◆ mIsUndoCmdActive

bool mIsUndoCmdActive
private

◆ mEditCmd

QScopedPointer<CmdPolygonEdit> mEditCmd
private

◆ mCurrentPolygon

std::shared_ptr<Polygon> mCurrentPolygon
private

◆ mCurrentGraphicsItem

std::shared_ptr<PolygonGraphicsItem> mCurrentGraphicsItem
private

◆ mLastScenePos

Point mLastScenePos
private

◆ mCursorPos

Point mCursorPos
private

◆ mArcCenter

Point mArcCenter
private

◆ mArcInSecondState

bool mArcInSecondState
private

◆ mLastLayer

const Layer* mLastLayer
private

◆ mLastLineWidth

UnsignedLength mLastLineWidth
private

◆ mLastAngle

Angle mLastAngle
private

◆ mLastFill

bool mLastFill
private

◆ mLastGrabArea

bool mLastGrabArea
private

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