#include <vpieceitem.h>
Public Types | |
enum | MoveType { NotMovable = 0x0 , IsRotatable = 0x1 , IsResizable = 0x2 , IsMovable = 0x4 , AllModifications = IsRotatable | IsResizable | IsMovable , Error = 0x8 } |
enum | { Type = UserType + static_cast<int>(Vis::PieceItem) } |
Signals | |
void | itemMoved (const QPointF &ptPos) |
Public Member Functions | |
VPieceItem (QGraphicsItem *pParent=nullptr) | |
virtual | ~VPieceItem () |
virtual QRectF | boundingRect () const Q_DECL_OVERRIDE |
boundingRect returns the item bounding box More... | |
virtual void | Update ()=0 |
void | Reset () |
Reset resets the item, putting the mode and z coordinate to normal and redraws it. More... | |
bool | IsIdle () const |
IsIdle returns the idle flag. More... | |
VPieceItem::MoveTypes | GetMoveType () const |
void | SetMoveType (const VPieceItem::MoveTypes &moveType) |
virtual int | type () const Q_DECL_OVERRIDE |
Protected Types | |
enum | Mode { mNormal , mMove , mResize , mRotate } |
Protected Member Functions | |
virtual double | GetAngle (const QPointF &pt) const |
GetAngle calculates the angle between the line, which goes from rotation center to pt and x axis. More... | |
Protected Attributes | |
QRectF | m_rectBoundingBox |
Mode | m_eMode |
bool | m_bReleased |
QPointF | m_ptRotCenter |
VPieceItem::MoveTypes | m_moveType |
qreal | m_inactiveZ |
Definition at line 60 of file vpieceitem.h.
anonymous enum |
Enumerator | |
---|---|
Type |
Definition at line 89 of file vpieceitem.h.
|
protected |
Enumerator | |
---|---|
mNormal | |
mMove | |
mResize | |
mRotate |
Definition at line 95 of file vpieceitem.h.
enum VPieceItem::MoveType |
Enumerator | |
---|---|
NotMovable | |
IsRotatable | |
IsResizable | |
IsMovable | |
AllModifications | |
Error |
Definition at line 64 of file vpieceitem.h.
|
explicit |
Definition at line 58 of file vpieceitem.cpp.
References m_rectBoundingBox.
|
virtual |
Definition at line 72 of file vpieceitem.cpp.
|
virtual |
boundingRect returns the item bounding box
Definition at line 81 of file vpieceitem.cpp.
References m_rectBoundingBox.
Referenced by VTextGraphicsItem::paint(), PatternPieceTool::SaveResizePattern(), PatternPieceTool::saveResizePiece(), VTextGraphicsItem::setSize(), and PatternPieceTool::UpdateLabelItem().
|
protectedvirtual |
GetAngle calculates the angle between the line, which goes from rotation center to pt and x axis.
pt | point of interest |
Reimplemented in VGrainlineItem.
Definition at line 118 of file vpieceitem.cpp.
References m_ptRotCenter.
Referenced by VGrainlineItem::GetAngle(), VTextGraphicsItem::mouseMoveEvent(), and VTextGraphicsItem::mousePressEvent().
VPieceItem::MoveTypes VPieceItem::GetMoveType | ( | ) | const |
Definition at line 134 of file vpieceitem.cpp.
References m_moveType.
bool VPieceItem::IsIdle | ( | ) | const |
IsIdle returns the idle flag.
Definition at line 107 of file vpieceitem.cpp.
References m_eMode, and mNormal.
Referenced by PatternPieceTool::paint().
|
signal |
void VPieceItem::Reset | ( | ) |
Reset resets the item, putting the mode and z coordinate to normal and redraws it.
Definition at line 90 of file vpieceitem.cpp.
References m_bReleased, m_eMode, m_inactiveZ, mNormal, and Update().
Referenced by PatternPieceTool::ResetChildren(), and VGrainlineItem::VGrainlineItem().
void VPieceItem::SetMoveType | ( | const VPieceItem::MoveTypes & | moveType | ) |
Definition at line 140 of file vpieceitem.cpp.
References m_moveType, and NotMovable.
Referenced by PatternPieceTool::PrepareLabelData(), and PatternPieceTool::UpdateGrainline().
|
inlinevirtual |
Reimplemented in VTextGraphicsItem, and VGrainlineItem.
Definition at line 88 of file vpieceitem.h.
References Type.
|
pure virtual |
Implemented in VTextGraphicsItem, and VGrainlineItem.
Referenced by Reset().
|
protected |
Definition at line 104 of file vpieceitem.h.
Referenced by VTextGraphicsItem::mouseReleaseEvent(), VGrainlineItem::mouseReleaseEvent(), and Reset().
|
protected |
Definition at line 103 of file vpieceitem.h.
Referenced by VGrainlineItem::allUserModifications(), VTextGraphicsItem::allUserModifications(), VTextGraphicsItem::hoverMoveEvent(), IsIdle(), VTextGraphicsItem::mouseMoveEvent(), VGrainlineItem::mouseMoveEvent(), VTextGraphicsItem::mousePressEvent(), VGrainlineItem::mousePressEvent(), VTextGraphicsItem::mouseReleaseEvent(), VGrainlineItem::mouseReleaseEvent(), VTextGraphicsItem::paint(), VGrainlineItem::paint(), Reset(), VGrainlineItem::shape(), VGrainlineItem::userMoveAndResize(), VTextGraphicsItem::userMoveAndResize(), VGrainlineItem::userRotateAndMove(), and VTextGraphicsItem::userRotateAndMove().
|
protected |
Definition at line 108 of file vpieceitem.h.
Referenced by Reset(), VGrainlineItem::VGrainlineItem(), and VTextGraphicsItem::VTextGraphicsItem().
|
protected |
Definition at line 106 of file vpieceitem.h.
Referenced by GetMoveType(), VTextGraphicsItem::hoverMoveEvent(), VTextGraphicsItem::mouseMoveEvent(), VGrainlineItem::mouseMoveEvent(), VTextGraphicsItem::mousePressEvent(), VGrainlineItem::mousePressEvent(), VTextGraphicsItem::mouseReleaseEvent(), VGrainlineItem::mouseReleaseEvent(), and SetMoveType().
|
protected |
Definition at line 105 of file vpieceitem.h.
Referenced by GetAngle(), VTextGraphicsItem::mouseMoveEvent(), VGrainlineItem::mouseMoveEvent(), VTextGraphicsItem::mousePressEvent(), and VGrainlineItem::mousePressEvent().
|
protected |
Definition at line 102 of file vpieceitem.h.
Referenced by boundingRect(), VTextGraphicsItem::correctLabel(), VTextGraphicsItem::mouseMoveEvent(), VTextGraphicsItem::mousePressEvent(), VTextGraphicsItem::mouseReleaseEvent(), VTextGraphicsItem::paint(), VTextGraphicsItem::setSize(), VGrainlineItem::Update(), VTextGraphicsItem::UpdateBox(), VGrainlineItem::UpdateRectangle(), and VPieceItem().