Seamly2D
Code documentation
PatternPieceTool Class Reference

#include <pattern_piece_tool.h>

Inheritance diagram for PatternPieceTool:
Collaboration diagram for PatternPieceTool:

Public Types

enum  { Type = UserType + static_cast<int>(Tool::Piece) }
 

Public Slots

virtual void FullUpdateFromFile () Q_DECL_OVERRIDE
 
void EnableToolMove (bool move)
 
void pieceLockedChanged (quint32 id, bool lock)
 
virtual void AllowHover (bool enabled) Q_DECL_OVERRIDE
 
virtual void AllowSelecting (bool enabled) Q_DECL_OVERRIDE
 
virtual void ResetChildren (QGraphicsItem *pItem)
 
virtual void UpdateAll ()
 
virtual void retranslateUi ()
 
void Highlight (quint32 id)
 
void updatePieceDetails ()
 
void UpdatePieceLabel ()
 UpdateLabel updates the text label, making it just big enough for the text to fit it. More...
 
void UpdatePatternLabel ()
 UpdatePatternLabel updates the pattern info label. More...
 
void UpdateGrainline ()
 VToolDetail::UpdateGrainline updates the grain line item. More...
 
void editPieceProperties ()
 editPieceProperties - routine to edit pattern piece properties . More...
 
- Public Slots inherited from VInteractiveTool
void FullUpdateFromGuiOk (int result)
 FullUpdateFromGuiOk refresh tool data after change in options. More...
 
void FullUpdateFromGuiApply ()
 FullUpdateFromGuiApply refresh tool data after change in options but do not delete dialog. More...
 
- Public Slots inherited from VAbstractTool
virtual void FullUpdateFromFile ()=0
 FullUpdateFromFile update tool data form file. More...
 
virtual void AllowHover (bool enabled)=0
 
virtual void AllowSelecting (bool enabled)=0
 
virtual void ToolSelectionType (const SelectionType &type)
 

Public Member Functions

virtual ~PatternPieceTool () Q_DECL_EQ_DEFAULT
 
void Remove (bool ask)
 
void RefreshGeometry ()
 
virtual int type () const Q_DECL_OVERRIDE
 
virtual QString getTagName () const Q_DECL_OVERRIDE
 
virtual void ShowVisualization (bool show) Q_DECL_OVERRIDE
 
virtual void GroupVisibility (quint32 object, bool visible) Q_DECL_OVERRIDE
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE
 VToolDetail::paint draws a bounding box around piece, if one of its text or grainline items is not idle. More...
 
virtual QRectF boundingRect () const Q_DECL_OVERRIDE
 
virtual QPainterPath shape () const Q_DECL_OVERRIDE
 
- Public Member Functions inherited from VInteractiveTool
 VInteractiveTool (VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent=nullptr)
 
virtual ~VInteractiveTool () Q_DECL_EQ_DEFAULT
 
void DialogLinkDestroy ()
 
- Public Member Functions inherited from VAbstractTool
 VAbstractTool (VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent=nullptr)
 VAbstractTool container. More...
 
virtual ~VAbstractTool () Q_DECL_OVERRIDE
 
quint32 getId () const
 getId return object id. More...
 
const VContainergetData () const
 getData return pointer to data container. More...
 
QMap< QString, quint32 > PointsList () const
 
virtual void setPointNamePosition (quint32 id, const QPointF &pos)
 
virtual void setPointNameVisiblity (quint32 id, bool visible)
 
- Public Member Functions inherited from VDataTool
 VDataTool (VContainer *data, QObject *parent=nullptr)
 VDataTool constructor. More...
 
virtual ~VDataTool () Q_DECL_EQ_DEFAULT
 
VContainer getData () const
 getData return data container. More...
 
void setData (const VContainer *value)
 setData set data container. More...
 
virtual quint32 referens () const
 referens return count of referens. More...
 
virtual void incrementReferens ()
 incrementReferens increment referens. More...
 
virtual void decrementReferens ()
 decrementReferens decrement referens. More...
 

Static Public Member Functions

static PatternPieceToolCreate (QSharedPointer< DialogTool > dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
 
static PatternPieceToolCreate (quint32 id, VPiece newPiece, QString &width, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation, const QString &blockName=QString())
 
static void insertNodes (const QVector< VPieceNode > &nodes, quint32 pieceId, VMainGraphicsScene *scene, VContainer *data, VAbstractPattern *doc)
 
static void AddAttributes (VAbstractPattern *doc, QDomElement &domElement, quint32 id, const VPiece &piece)
 
static void AddCSARecord (VAbstractPattern *doc, QDomElement &domElement, const CustomSARecord &record)
 
static void AddCSARecords (VAbstractPattern *doc, QDomElement &domElement, const QVector< CustomSARecord > &records)
 
static void AddInternalPaths (VAbstractPattern *doc, QDomElement &domElement, const QVector< quint32 > &paths)
 
static void addAnchors (VAbstractPattern *doc, QDomElement &domElement, const QVector< quint32 > &anchors)
 
static void AddPatternPieceData (VAbstractPattern *doc, QDomElement &domElement, const VPiece &piece)
 
static void AddPatternInfo (VAbstractPattern *doc, QDomElement &domElement, const VPiece &piece)
 
static void AddGrainline (VAbstractPattern *doc, QDomElement &domElement, const VPiece &piece)
 
- Static Public Member Functions inherited from VAbstractTool
static qreal CheckFormula (const quint32 &toolId, QString &formula, VContainer *data)
 CheckFormula check formula. More...
 
static const QStringList Colors ()
 
static QMap< QString, QString > ColorsList ()
 
static QMap< QString, QString > supportColorsList ()
 
static QMap< QString, QString > backgroundColorsList ()
 
static QPixmap createColorIcon (const int w, const int h, const QString &color)
 
static const QStringList fills ()
 
static void AddRecord (const quint32 id, const Tool &toolType, VAbstractPattern *doc)
 AddRecord add record about tool in history. More...
 
static void AddNodes (VAbstractPattern *doc, QDomElement &domElement, const VPiecePath &path)
 
static void AddNodes (VAbstractPattern *doc, QDomElement &domElement, const VPiece &piece)
 
template<typename T >
static quint32 CreateNode (VContainer *data, quint32 id)
 CreateNode create new node for detail. More...
 

Static Public Attributes

static const quint8 pieceVersion = 2
 
static const QString TagCSA = QStringLiteral("csa")
 
static const QString TagRecord = QStringLiteral("record")
 
static const QString TagIPaths = QStringLiteral("iPaths")
 
static const QString TagAnchors = QStringLiteral("anchors")
 
static const QString AttrVersion = QStringLiteral("version")
 
static const QString AttrForbidFlipping = QStringLiteral("forbidFlipping")
 
static const QString AttrPieceColor = QStringLiteral("color")
 
static const QString AttrPieceFill = QStringLiteral("fill")
 
static const QString AttrPieceLock = QStringLiteral("locked")
 
static const QString AttrSeamAllowance = QStringLiteral("seamAllowance")
 
static const QString AttrHideSeamLine = QStringLiteral("hideMainPath")
 
static const QString AttrSeamAllowanceBuiltIn = QStringLiteral("seamAllowanceBuiltIn")
 
static const QString AttrHeight = QStringLiteral("height")
 
static const QString AttrUnited = QStringLiteral("united")
 
static const QString AttrFont = QStringLiteral("fontSize")
 
static const QString AttrTopLeftAnchor = QStringLiteral("topLeftAnchor")
 
static const QString AttrBottomRightAnchor = QStringLiteral("bottomRightAnchor")
 
static const QString AttrCenterAnchor = QStringLiteral("centerAnchor")
 
static const QString AttrTopAnchorPoint = QStringLiteral("topAnchor")
 
static const QString AttrBottomAnchorPoint = QStringLiteral("bottomAnchor")
 
- Static Public Attributes inherited from VAbstractTool
static bool m_suppressContextMenu = false
 
static const QString AttrInUse = QStringLiteral("inUse")
 

Protected Slots

void saveMovePiece (const QPointF &ptPos)
 saveMovePiece saves the move piece operation to the undo stack More...
 
void saveResizePiece (qreal dLabelW, int iFontSize)
 saveResizePiece saves the resize piece label operation to the undo stack More...
 
void savePieceRotation (qreal dRot)
 savePieceRotation saves the rotation piece label operation to the undo stack More...
 
void SaveMovePattern (const QPointF &ptPos)
 SaveMovePattern saves the pattern label position. More...
 
void SaveResizePattern (qreal dLabelW, int iFontSize)
 : SaveResizePattern saves the pattern label width and font size More...
 
void SaveRotationPattern (qreal dRot)
 
void SaveMoveGrainline (const QPointF &ptPos)
 
void SaveResizeGrainline (qreal dLength)
 
void SaveRotateGrainline (qreal dRot, const QPointF &ptPos)
 

Protected Member Functions

virtual void AddToFile () Q_DECL_OVERRIDE
 AddToFile add tag with Information about tool into file. More...
 
virtual void RefreshDataInFile () Q_DECL_OVERRIDE
 RefreshDataInFile refresh attributes in file. If attributes don't exist create them. More...
 
virtual QVariant itemChange (GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE
 
virtual void mousePressEvent (QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE
 
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE
 
virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE
 
virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE
 
virtual void contextMenuEvent (QGraphicsSceneContextMenuEvent *event) Q_DECL_OVERRIDE
 
virtual void keyReleaseEvent (QKeyEvent *event) Q_DECL_OVERRIDE
 
virtual void SetVisualization () Q_DECL_OVERRIDE
 
virtual void deleteTool (bool ask=true) Q_DECL_OVERRIDE
 deleteTool full delete object form scene and file. More...
 
virtual void ToolCreation (const Source &typeCreation) Q_DECL_OVERRIDE
 
virtual void SetDialog () Q_DECL_FINAL
 
virtual void SaveDialogChange () Q_DECL_FINAL
 
- Protected Member Functions inherited from VInteractiveTool
virtual void setDialog ()
 setDialog set dialog when user want change tool option. More...
 
- Protected Member Functions inherited from VAbstractTool
virtual void RemoveReferens ()
 RemoveReferens decrement value of reference. More...
 
template<typename T >
void AddVisualization ()
 

Private Member Functions

 PatternPieceTool (VAbstractPattern *doc, VContainer *data, const quint32 &id, const Source &typeCreation, VMainGraphicsScene *scene, const QString &blockName, QGraphicsItem *parent=nullptr)
 
void UpdateExcludeState ()
 
VPieceItem::MoveTypes FindLabelGeometry (const VPatternLabelData &labelData, qreal &rotationAngle, qreal &labelWidth, qreal &labelHeight, QPointF &pos)
 
VPieceItem::MoveTypes FindGrainlineGeometry (const VGrainlineData &geom, qreal &length, qreal &rotationAngle, QPointF &pos)
 
void initializeNodes (const VPiece &piece, VMainGraphicsScene *scene)
 
void InitCSAPaths (const VPiece &piece)
 
void InitInternalPaths (const VPiece &piece)
 
void initializeAnchorPoints (const VPiece &piece)
 
bool PrepareLabelData (const VPatternLabelData &labelData, VTextGraphicsItem *labelItem, QPointF &pos, qreal &labelAngle)
 
void UpdateLabelItem (VTextGraphicsItem *labelItem, QPointF pos, qreal labelAngle)
 
void toggleInLayout (bool checked)
 toggleInLayout - routine to toggle if pattern piece is included and visible in layout. More...
 
void togglePieceLock (bool checked)
 togglePieceLock - routine to toggle if pattern piece is locked and editiable. More...
 
void toggleFlipping (bool checked)
 toggleFlipping - routine to toggle forbidding flipping. More...
 
void toggleSeamLine (bool checked)
 toggleSeamLine - routine to toggle the visibility of the seam line. More...
 
void toggleSeamAllowance (bool checked)
 toggleSeamAllowance - routine to toggle the visibility of the seam allowance. More...
 
void toggleGrainline (bool checked)
 toggleGrainline - routine to toggle the visibility of the piece grainline. More...
 
void togglePatternLabel (bool checked)
 togglePatternLabel - routine to toggle the visibility of the pattern label. More...
 
void togglePieceLabel (bool checked)
 togglePieceLabel - routine to toggle the visibility of the piece label. More...
 
void renamePiece (VPiece piece)
 renamePiece - routine to rename pattern piece. More...
 
void showStatus (QString toolTip)
 
void raiseItemToTop (QGraphicsItem *item)
 
void lowerItemToBottom (QGraphicsItem *item)
 

Static Private Member Functions

static void initializeNode (const VPieceNode &node, VMainGraphicsScene *scene, VContainer *data, VAbstractPattern *doc, PatternPieceTool *parent)
 

Private Attributes

QPainterPath m_mainPath
 
QRectF m_pieceRect
 
QPainterPath m_cutPath
 
VMainGraphicsScenem_pieceScene
 
QString m_blockName
 pieceScene pointer to the scene. More...
 
NonScalingFillPathItemm_cutLine
 
NonScalingFillPathItemm_seamLine
 
VTextGraphicsItemm_dataLabel
 
VTextGraphicsItemm_patternInfo
 
VGrainlineItemm_grainLine
 
QGraphicsPathItem * m_notches
 

Additional Inherited Members

- Signals inherited from VAbstractTool
void toolHasChanges ()
 toolHasChanges emit if tool create change that need save. More...
 
void chosenTool (quint32 id, SceneObject type)
 chosenTool emit if object was clicked. More...
 
void LiteUpdateTree (const Document &parse)
 FullUpdateTree emit if need reparse pattern file. More...
 
void ToolTip (const QString &toolTip)
 
- Static Protected Member Functions inherited from VAbstractTool
static int ConfirmDeletion ()
 
static QDomElement AddSANode (VAbstractPattern *doc, const QString &tagName, const VPieceNode &node)
 
static void AddNode (VAbstractPattern *doc, QDomElement &domElement, const VPieceNode &node)
 
static QVector< VPieceNodePrepareNodes (const VPiecePath &path, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
 
static quint32 PrepareNode (const VPieceNode &node, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
 
- Protected Attributes inherited from VInteractiveTool
QSharedPointer< DialogToolm_dialog
 m_dialog tool's dialog options. More...
 
- Protected Attributes inherited from VAbstractTool
VAbstractPatterndoc
 doc dom document container More...
 
const quint32 m_id
 id object id. More...
 
QPointer< Visualizationvis
 
SelectionType selectionType
 
- Protected Attributes inherited from VDataTool
VContainer data
 data container with data More...
 
quint32 _referens
 _referens keep count tools what use this tool. If value more than 1 you can't delete tool. More...
 

Detailed Description

Definition at line 69 of file pattern_piece_tool.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Type 

Definition at line 120 of file pattern_piece_tool.h.

Constructor & Destructor Documentation

◆ ~PatternPieceTool()

virtual PatternPieceTool::~PatternPieceTool ( )
virtual

◆ PatternPieceTool()

Member Function Documentation

◆ addAnchors()

void PatternPieceTool::addAnchors ( VAbstractPattern doc,
QDomElement &  domElement,
const QVector< quint32 > &  anchors 
)
static

◆ AddAttributes()

◆ AddCSARecord()

◆ AddCSARecords()

void PatternPieceTool::AddCSARecords ( VAbstractPattern doc,
QDomElement &  domElement,
const QVector< CustomSARecord > &  records 
)
static

◆ AddGrainline()

◆ AddInternalPaths()

void PatternPieceTool::AddInternalPaths ( VAbstractPattern doc,
QDomElement &  domElement,
const QVector< quint32 > &  paths 
)
static

◆ AddPatternInfo()

◆ AddPatternPieceData()

◆ AddToFile()

◆ AllowHover

void PatternPieceTool::AllowHover ( bool  enabled)
virtualslot

Definition at line 555 of file pattern_piece_tool.cpp.

Referenced by Create().

◆ AllowSelecting

void PatternPieceTool::AllowSelecting ( bool  enabled)
virtualslot

Definition at line 561 of file pattern_piece_tool.cpp.

Referenced by Create().

◆ boundingRect()

QRectF PatternPieceTool::boundingRect ( ) const
virtual

Definition at line 941 of file pattern_piece_tool.cpp.

References m_pieceRect.

Referenced by itemChange().

◆ contextMenuEvent()

◆ Create() [1/2]

◆ Create() [2/2]

◆ deleteTool()

void PatternPieceTool::deleteTool ( bool  ask = true)
protectedvirtual

◆ editPieceProperties

◆ EnableToolMove

◆ FindGrainlineGeometry()

VPieceItem::MoveTypes PatternPieceTool::FindGrainlineGeometry ( const VGrainlineData geom,
qreal &  length,
qreal &  rotationAngle,
QPointF &  pos 
)
private

◆ FindLabelGeometry()

◆ FullUpdateFromFile

void PatternPieceTool::FullUpdateFromFile ( )
virtualslot

Definition at line 502 of file pattern_piece_tool.cpp.

References RefreshGeometry(), and UpdateExcludeState().

◆ getTagName()

QString PatternPieceTool::getTagName ( ) const
virtual

Implements VAbstractTool.

Definition at line 483 of file pattern_piece_tool.cpp.

References VAbstractPattern::TagPiece.

Referenced by AddToFile(), and RefreshDataInFile().

◆ GroupVisibility()

void PatternPieceTool::GroupVisibility ( quint32  object,
bool  visible 
)
virtual

Implements VDataTool.

Definition at line 495 of file pattern_piece_tool.cpp.

◆ Highlight

void PatternPieceTool::Highlight ( quint32  id)
slot

Definition at line 614 of file pattern_piece_tool.cpp.

References VAbstractTool::m_id, and RefreshGeometry().

Referenced by Create().

◆ hoverEnterEvent()

void PatternPieceTool::hoverEnterEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

Definition at line 1139 of file pattern_piece_tool.cpp.

References cursorArrowOpenHand, and SetItemOverrideCursor().

◆ hoverLeaveEvent()

void PatternPieceTool::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

Definition at line 1149 of file pattern_piece_tool.cpp.

◆ InitCSAPaths()

void PatternPieceTool::InitCSAPaths ( const VPiece piece)
private

◆ initializeAnchorPoints()

void PatternPieceTool::initializeAnchorPoints ( const VPiece piece)
private

◆ initializeNode()

◆ initializeNodes()

void PatternPieceTool::initializeNodes ( const VPiece piece,
VMainGraphicsScene scene 
)
private

◆ InitInternalPaths()

◆ insertNodes()

◆ itemChange()

◆ keyReleaseEvent()

◆ lowerItemToBottom()

void PatternPieceTool::lowerItemToBottom ( QGraphicsItem *  item)
private

Definition at line 2182 of file pattern_piece_tool.cpp.

References m_pieceScene.

Referenced by contextMenuEvent(), and keyReleaseEvent().

◆ mousePressEvent()

void PatternPieceTool::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

◆ mouseReleaseEvent()

void PatternPieceTool::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

Definition at line 1129 of file pattern_piece_tool.cpp.

References cursorArrowOpenHand, and SetItemOverrideCursor().

◆ paint()

void PatternPieceTool::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
)
virtual

◆ pieceLockedChanged

◆ PrepareLabelData()

bool PatternPieceTool::PrepareLabelData ( const VPatternLabelData labelData,
VTextGraphicsItem labelItem,
QPointF &  pos,
qreal &  labelAngle 
)
private

◆ raiseItemToTop()

void PatternPieceTool::raiseItemToTop ( QGraphicsItem *  item)
private

Definition at line 2173 of file pattern_piece_tool.cpp.

References m_pieceScene.

Referenced by contextMenuEvent(), and keyReleaseEvent().

◆ RefreshDataInFile()

◆ RefreshGeometry()

◆ Remove()

void PatternPieceTool::Remove ( bool  ask)

Definition at line 190 of file pattern_piece_tool.cpp.

References deleteTool().

Referenced by QT_WARNING_POP::createUnion().

◆ renamePiece()

void PatternPieceTool::renamePiece ( VPiece  piece)
private

◆ ResetChildren

◆ retranslateUi

void PatternPieceTool::retranslateUi ( )
virtualslot

Definition at line 607 of file pattern_piece_tool.cpp.

References UpdatePatternLabel(), and UpdatePieceLabel().

Referenced by PatternPieceTool().

◆ SaveDialogChange()

◆ SaveMoveGrainline

◆ SaveMovePattern

void PatternPieceTool::SaveMovePattern ( const QPointF &  ptPos)
protectedslot

◆ saveMovePiece

void PatternPieceTool::saveMovePiece ( const QPointF &  ptPos)
protectedslot

◆ savePieceRotation

◆ SaveResizeGrainline

◆ SaveResizePattern

◆ saveResizePiece

◆ SaveRotateGrainline

◆ SaveRotationPattern

◆ SetDialog()

void PatternPieceTool::SetDialog ( )
protectedvirtual

◆ SetVisualization()

virtual void PatternPieceTool::SetVisualization ( )
inlineprotectedvirtual

Implements VAbstractTool.

Definition at line 168 of file pattern_piece_tool.h.

◆ shape()

QPainterPath PatternPieceTool::shape ( ) const
virtual

Definition at line 954 of file pattern_piece_tool.cpp.

References ItemShapeFromPath(), m_cutPath, and m_mainPath.

◆ showStatus()

void PatternPieceTool::showStatus ( QString  toolTip)
private

◆ ShowVisualization()

void PatternPieceTool::ShowVisualization ( bool  show)
virtual

Implements VAbstractTool.

Definition at line 489 of file pattern_piece_tool.cpp.

◆ toggleFlipping()

void PatternPieceTool::toggleFlipping ( bool  checked)
private

toggleFlipping - routine to toggle forbidding flipping.

Parameters
checked- true if flipping is forbidden.

Definition at line 2024 of file pattern_piece_tool.cpp.

References VDataTool::data, VAbstractTool::doc, VContainer::GetPiece(), VAbstractPattern::LiteParseTree(), VAbstractTool::m_id, VUndoCommand::NeedLiteParsing(), qApp, SavePieceOptions, VAbstractPiece::SetForbidFlipping(), and showStatus().

Referenced by contextMenuEvent(), and keyReleaseEvent().

◆ toggleGrainline()

void PatternPieceTool::toggleGrainline ( bool  checked)
private

toggleGrainline - routine to toggle the visibility of the piece grainline.

Parameters
checked- true if grainline is visible.

Definition at line 2078 of file pattern_piece_tool.cpp.

References VDataTool::data, VAbstractTool::doc, VPiece::GetGrainlineGeometry(), VContainer::GetPiece(), VAbstractPattern::LiteParseTree(), VAbstractTool::m_id, VUndoCommand::NeedLiteParsing(), qApp, SavePieceOptions, VAbstractFloatItemData::SetVisible(), and showStatus().

Referenced by contextMenuEvent(), and keyReleaseEvent().

◆ toggleInLayout()

void PatternPieceTool::toggleInLayout ( bool  checked)
private

toggleInLayout - routine to toggle if pattern piece is included and visible in layout.

Parameters
checked- true if piece is included.

Definition at line 2000 of file pattern_piece_tool.cpp.

References VDataTool::data, VAbstractTool::doc, VAbstractTool::m_id, qApp, TogglePieceInLayout, TogglePieceInLayout::updateList(), and VAbstractPattern::updatePieceList().

Referenced by contextMenuEvent(), and keyReleaseEvent().

◆ togglePatternLabel()

void PatternPieceTool::togglePatternLabel ( bool  checked)
private

togglePatternLabel - routine to toggle the visibility of the pattern label.

Parameters
checked- true if pattern label is visible.

Definition at line 2096 of file pattern_piece_tool.cpp.

References VDataTool::data, VAbstractTool::doc, VPiece::GetPatternInfo(), VContainer::GetPiece(), VAbstractPattern::LiteParseTree(), VAbstractTool::m_id, VUndoCommand::NeedLiteParsing(), qApp, SavePieceOptions, VAbstractFloatItemData::SetVisible(), and showStatus().

Referenced by contextMenuEvent(), and keyReleaseEvent().

◆ togglePieceLabel()

void PatternPieceTool::togglePieceLabel ( bool  checked)
private

togglePieceLabel - routine to toggle the visibility of the piece label.

Parameters
checked- true if piece label is visible.

Definition at line 2114 of file pattern_piece_tool.cpp.

References VDataTool::data, VAbstractTool::doc, VPiece::GetPatternPieceData(), VContainer::GetPiece(), VAbstractPattern::LiteParseTree(), VAbstractTool::m_id, VUndoCommand::NeedLiteParsing(), qApp, SavePieceOptions, VAbstractFloatItemData::SetVisible(), and showStatus().

Referenced by contextMenuEvent(), and keyReleaseEvent().

◆ togglePieceLock()

void PatternPieceTool::togglePieceLock ( bool  checked)
private

togglePieceLock - routine to toggle if pattern piece is locked and editiable.

Parameters
checked- true if piece is locked.

Definition at line 2011 of file pattern_piece_tool.cpp.

References VDataTool::data, VAbstractTool::doc, EnableToolMove(), VAbstractTool::m_id, qApp, TogglePieceLock, TogglePieceLock::updateList(), and VAbstractPattern::updatePieceList().

Referenced by contextMenuEvent(), and keyReleaseEvent().

◆ toggleSeamAllowance()

void PatternPieceTool::toggleSeamAllowance ( bool  checked)
private

toggleSeamAllowance - routine to toggle the visibility of the seam allowance.

Parameters
checked- true if seam allowance is visible.

Definition at line 2060 of file pattern_piece_tool.cpp.

References VDataTool::data, VAbstractTool::doc, VContainer::GetPiece(), VAbstractPattern::LiteParseTree(), VAbstractTool::m_id, VUndoCommand::NeedLiteParsing(), qApp, SavePieceOptions, VAbstractPiece::SetSeamAllowance(), and showStatus().

Referenced by contextMenuEvent(), and keyReleaseEvent().

◆ toggleSeamLine()

void PatternPieceTool::toggleSeamLine ( bool  checked)
private

toggleSeamLine - routine to toggle the visibility of the seam line.

Parameters
checked- true if seam line is visible.

Definition at line 2042 of file pattern_piece_tool.cpp.

References VDataTool::data, VAbstractTool::doc, VContainer::GetPiece(), VAbstractPattern::LiteParseTree(), VAbstractTool::m_id, VUndoCommand::NeedLiteParsing(), qApp, SavePieceOptions, VAbstractPiece::setHideSeamLine(), and showStatus().

Referenced by contextMenuEvent(), and keyReleaseEvent().

◆ ToolCreation()

void PatternPieceTool::ToolCreation ( const Source typeCreation)
protectedvirtual

Reimplemented from VAbstractTool.

Definition at line 1903 of file pattern_piece_tool.cpp.

References AddToFile(), FromGui, FromTool, qApp, and RefreshDataInFile().

Referenced by PatternPieceTool().

◆ type()

virtual int PatternPieceTool::type ( ) const
inlinevirtual

Definition at line 119 of file pattern_piece_tool.h.

References Type.

Referenced by PrepareLabelData(), and UpdateGrainline().

◆ UpdateAll

void PatternPieceTool::UpdateAll ( )
virtualslot

Definition at line 600 of file pattern_piece_tool.cpp.

References m_pieceScene.

◆ UpdateExcludeState()

◆ UpdateGrainline

void PatternPieceTool::UpdateGrainline ( )
slot

◆ UpdateLabelItem()

void PatternPieceTool::UpdateLabelItem ( VTextGraphicsItem labelItem,
QPointF  pos,
qreal  labelAngle 
)
private

◆ UpdatePatternLabel

void PatternPieceTool::UpdatePatternLabel ( )
slot

◆ updatePieceDetails

void PatternPieceTool::updatePieceDetails ( )
slot

Definition at line 620 of file pattern_piece_tool.cpp.

References UpdateGrainline(), UpdatePatternLabel(), and UpdatePieceLabel().

Referenced by PatternPieceTool().

◆ UpdatePieceLabel

void PatternPieceTool::UpdatePieceLabel ( )
slot

Member Data Documentation

◆ AttrBottomAnchorPoint

const QString PatternPieceTool::AttrBottomAnchorPoint = QStringLiteral("bottomAnchor")
static

Definition at line 101 of file pattern_piece_tool.h.

Referenced by AddGrainline(), and VPattern::ParsePieceGrainline().

◆ AttrBottomRightAnchor

const QString PatternPieceTool::AttrBottomRightAnchor = QStringLiteral("bottomRightAnchor")
static

◆ AttrCenterAnchor

const QString PatternPieceTool::AttrCenterAnchor = QStringLiteral("centerAnchor")
static

◆ AttrFont

const QString PatternPieceTool::AttrFont = QStringLiteral("fontSize")
static

◆ AttrForbidFlipping

const QString PatternPieceTool::AttrForbidFlipping = QStringLiteral("forbidFlipping")
static

Definition at line 87 of file pattern_piece_tool.h.

Referenced by AddAttributes(), and VPattern::parsePieceElement().

◆ AttrHeight

const QString PatternPieceTool::AttrHeight = QStringLiteral("height")
static

◆ AttrHideSeamLine

const QString PatternPieceTool::AttrHideSeamLine = QStringLiteral("hideMainPath")
static

Definition at line 92 of file pattern_piece_tool.h.

Referenced by AddAttributes(), and VPattern::parsePieceElement().

◆ AttrPieceColor

const QString PatternPieceTool::AttrPieceColor = QStringLiteral("color")
static

Definition at line 88 of file pattern_piece_tool.h.

Referenced by AddAttributes(), and VPattern::parsePieceElement().

◆ AttrPieceFill

const QString PatternPieceTool::AttrPieceFill = QStringLiteral("fill")
static

Definition at line 89 of file pattern_piece_tool.h.

Referenced by AddAttributes(), and VPattern::parsePieceElement().

◆ AttrPieceLock

const QString PatternPieceTool::AttrPieceLock = QStringLiteral("locked")
static

Definition at line 90 of file pattern_piece_tool.h.

◆ AttrSeamAllowance

const QString PatternPieceTool::AttrSeamAllowance = QStringLiteral("seamAllowance")
static

Definition at line 91 of file pattern_piece_tool.h.

Referenced by AddAttributes(), and VPattern::parsePieceElement().

◆ AttrSeamAllowanceBuiltIn

const QString PatternPieceTool::AttrSeamAllowanceBuiltIn = QStringLiteral("seamAllowanceBuiltIn")
static

Definition at line 93 of file pattern_piece_tool.h.

Referenced by AddAttributes(), and VPattern::parsePieceElement().

◆ AttrTopAnchorPoint

const QString PatternPieceTool::AttrTopAnchorPoint = QStringLiteral("topAnchor")
static

Definition at line 100 of file pattern_piece_tool.h.

Referenced by AddGrainline(), and VPattern::ParsePieceGrainline().

◆ AttrTopLeftAnchor

const QString PatternPieceTool::AttrTopLeftAnchor = QStringLiteral("topLeftAnchor")
static

◆ AttrUnited

const QString PatternPieceTool::AttrUnited = QStringLiteral("united")
static

◆ AttrVersion

const QString PatternPieceTool::AttrVersion = QStringLiteral("version")
static

◆ m_blockName

QString PatternPieceTool::m_blockName
private

pieceScene pointer to the scene.

Definition at line 181 of file pattern_piece_tool.h.

Referenced by AddToFile().

◆ m_cutLine

NonScalingFillPathItem* PatternPieceTool::m_cutLine
private

Definition at line 182 of file pattern_piece_tool.h.

Referenced by paint(), and RefreshGeometry().

◆ m_cutPath

QPainterPath PatternPieceTool::m_cutPath
private

Definition at line 179 of file pattern_piece_tool.h.

Referenced by RefreshGeometry(), and shape().

◆ m_dataLabel

◆ m_grainLine

◆ m_mainPath

QPainterPath PatternPieceTool::m_mainPath
private

Definition at line 177 of file pattern_piece_tool.h.

Referenced by RefreshGeometry(), and shape().

◆ m_notches

QGraphicsPathItem* PatternPieceTool::m_notches
private

Definition at line 187 of file pattern_piece_tool.h.

Referenced by paint(), and RefreshGeometry().

◆ m_patternInfo

◆ m_pieceRect

QRectF PatternPieceTool::m_pieceRect
private

Definition at line 178 of file pattern_piece_tool.h.

Referenced by boundingRect(), and RefreshGeometry().

◆ m_pieceScene

VMainGraphicsScene* PatternPieceTool::m_pieceScene
private

◆ m_seamLine

NonScalingFillPathItem* PatternPieceTool::m_seamLine
private

Definition at line 183 of file pattern_piece_tool.h.

Referenced by paint(), and RefreshGeometry().

◆ pieceVersion

const quint8 PatternPieceTool::pieceVersion = 2
static

Definition at line 81 of file pattern_piece_tool.h.

Referenced by AddAttributes(), and RefreshDataInFile().

◆ TagAnchors

const QString PatternPieceTool::TagAnchors = QStringLiteral("anchors")
static

◆ TagCSA

◆ TagIPaths

◆ TagRecord

const QString PatternPieceTool::TagRecord = QStringLiteral("record")
static

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