#include <vlayoutpiece.h>
Public Member Functions | |
VLayoutPiece () | |
VLayoutPiece (const VLayoutPiece &detail) | |
virtual | ~VLayoutPiece () Q_DECL_OVERRIDE |
VLayoutPiece & | operator= (const VLayoutPiece &detail) |
void | Swap (VLayoutPiece &detail) Q_DECL_NOTHROW |
QVector< QPointF > | getContourPoints () const |
void | SetCountourPoints (const QVector< QPointF > &points, bool hideMainPath=false) |
QVector< QPointF > | GetSeamAllowancePoints () const |
void | setSeamAllowancePoints (const QVector< QPointF > &points, bool seamAllowance=true, bool seamAllowanceBuiltIn=false) |
QVector< QPointF > | getLayoutAllowancePoints () const |
void | SetLayoutAllowancePoints () |
QVector< QLineF > | getNotches () const |
void | setNotches (const QVector< QLineF > ¬ches) |
QVector< QVector< QPointF > > | InternalPathsForCut (bool cut) const |
QVector< VLayoutPiecePath > | getInternalPaths () const |
void | setInternalPaths (const QVector< VLayoutPiecePath > &internalPaths) |
QVector< VLayoutPiecePath > | getCutoutPaths () const |
void | setCutoutPaths (const QVector< VLayoutPiecePath > &cutoutPaths) |
QPointF | GetPieceTextPosition () const |
QStringList | GetPieceText () const |
void | SetPieceText (const QString &qsName, const VPieceLabelData &data, const QFont &font, const VContainer *pattern) |
QPointF | GetPatternTextPosition () const |
QStringList | GetPatternText () const |
void | SetPatternInfo (VAbstractPattern *pDoc, const VPatternLabelData &geom, const QFont &font, const VContainer *pattern) |
void | setGrainline (const VGrainlineData &geom, const VContainer *pattern) |
QVector< QPointF > | getGrainline () const |
QTransform | getTransform () const |
void | setTransform (const QTransform &transform) |
qreal | GetLayoutWidth () const |
void | SetLayoutWidth (const qreal &value) |
bool | isMirror () const |
void | SetMirror (bool value) |
void | Translate (qreal dx, qreal dy) |
void | Rotate (const QPointF &originPoint, qreal degrees) |
void | Mirror (const QLineF &edge) |
int | pieceEdgesCount () const |
int | LayoutEdgesCount () const |
QLineF | pieceEdge (int i) const |
QLineF | LayoutEdge (int i) const |
int | pieceEdgeByPoint (const QPointF &p1) const |
int | LayoutEdgeByPoint (const QPointF &p1) const |
QRectF | pieceBoundingRect () const |
QRectF | LayoutBoundingRect () const |
qreal | Diagonal () const |
bool | isNull () const |
qint64 | Square () const |
QPainterPath | createMainPath () const |
QPainterPath | createAllowancePath () const |
QPainterPath | createNotchesPath () const |
QPainterPath | LayoutAllowancePath () const |
Q_REQUIRED_RESULT QGraphicsItem * | GetItem (bool textAsPaths) const |
Public Member Functions inherited from VAbstractPiece | |
VAbstractPiece () | |
VAbstractPiece (const VAbstractPiece &piece) | |
virtual | ~VAbstractPiece () |
VAbstractPiece & | operator= (const VAbstractPiece &piece) |
void | Swap (VAbstractPiece &piece) Q_DECL_NOTHROW |
QString | GetName () const |
void | SetName (const QString &value) |
QString | getColor () const |
void | setColor (const QString &value) |
QString | getFill () const |
void | setFill (const QString &value) |
bool | getLock () const |
void | setLock (bool value) |
bool | IsForbidFlipping () const |
void | SetForbidFlipping (bool value) |
bool | IsSeamAllowance () const |
void | SetSeamAllowance (bool value) |
bool | IsSeamAllowanceBuiltIn () const |
void | SetSeamAllowanceBuiltIn (bool value) |
bool | isHideSeamLine () const |
void | setHideSeamLine (bool value) |
qreal | GetSAWidth () const |
void | SetSAWidth (qreal value) |
qreal | GetMx () const |
void | SetMx (qreal value) |
qreal | GetMy () const |
void | SetMy (qreal value) |
Static Public Member Functions | |
static VLayoutPiece | Create (const VPiece &piece, const VContainer *pattern) |
Static Public Member Functions inherited from VAbstractPiece | |
static QVector< QPointF > | Equidistant (const QVector< VSAPoint > &points, qreal width) |
static qreal | sumTrapezoids (const QVector< QPointF > &points) |
static bool | isClockwise (const QVector< QPointF > &points) |
static QVector< QPointF > | CheckLoops (const QVector< QPointF > &points) |
CheckLoops seek and delete loops in equidistant. More... | |
static QVector< QPointF > | EkvPoint (const VSAPoint &p1Line1, const VSAPoint &p2Line1, const VSAPoint &p1Line2, const VSAPoint &p2Line2, qreal width) |
EkvPoint return seam allowance points in place of intersection of two edges. Last points of two edges should be equal. More... | |
static QLineF | createParallelLine (const VSAPoint &p1, const VSAPoint &p2, qreal width) |
static QLineF | createParallelLine (const QPointF &p1, const QPointF &p2, qreal width) |
template<class T > | |
static QVector< T > | CorrectEquidistantPoints (const QVector< T > &points, bool removeFirstAndLast=true) |
CorrectEquidistantPoints clear equivalent points and remove point on line from equdistant. More... | |
Private Member Functions | |
QVector< QPointF > | piecePath () const |
Q_REQUIRED_RESULT QGraphicsPathItem * | createMainItem () const |
void | createAllowanceItem (QGraphicsItem *parent) const |
void | createNotchesItem (QGraphicsItem *parent) const |
Q_REQUIRED_RESULT QGraphicsPathItem * | getMainPathItem () const |
void | createInternalPathItem (int i, QGraphicsItem *parent) const |
void | createCutoutPathItem (int i, QGraphicsItem *parent) const |
void | createLabelItem (QGraphicsItem *parent, const QVector< QPointF > &labelShape, const VTextManager &tm, bool textAsPaths) const |
void | createGrainlineItem (QGraphicsItem *parent, bool textAsPaths) const |
template<class T > | |
QVector< T > | Map (const QVector< T > &points) const |
QLineF | Edge (const QVector< QPointF > &path, int i) const |
int | EdgeByPoint (const QVector< QPointF > &path, const QPointF &p1) const |
Private Attributes | |
QSharedDataPointer< VLayoutPieceData > | d |
Additional Inherited Members | |
Static Protected Member Functions inherited from VAbstractPiece | |
template<class T > | |
static QVector< T > | RemoveDublicates (const QVector< T > &points, bool removeFirstAndLast=true) |
static qreal | MaxLocalSA (const VSAPoint &p, qreal width) |
static bool | IsEkvPointOnLine (const QPointF &iPoint, const QPointF &prevPoint, const QPointF &nextPoint) |
static bool | IsEkvPointOnLine (const VSAPoint &iPoint, const VSAPoint &prevPoint, const VSAPoint &nextPoint) |
Definition at line 79 of file vlayoutpiece.h.
VLayoutPiece::VLayoutPiece | ( | ) |
Definition at line 389 of file vlayoutpiece.cpp.
VLayoutPiece::VLayoutPiece | ( | const VLayoutPiece & | detail | ) |
Definition at line 395 of file vlayoutpiece.cpp.
|
virtual |
Definition at line 413 of file vlayoutpiece.cpp.
|
static |
Definition at line 417 of file vlayoutpiece.cpp.
References anonymous_namespace{vlayoutpiece.cpp}::ConvertInternalPaths(), createAllowancePath(), createMainPath(), VPiece::createNotchLines(), VPiece::GetGrainlineGeometry(), VAbstractPiece::GetMx(), VAbstractPiece::GetMy(), VAbstractPiece::GetName(), VPiece::GetPatternInfo(), VPiece::GetPatternPieceData(), VAbstractPiece::GetSAWidth(), VAbstractPiece::IsForbidFlipping(), VAbstractPiece::isHideSeamLine(), VAbstractPiece::IsSeamAllowance(), VAbstractPiece::IsSeamAllowanceBuiltIn(), VAbstractFloatItemData::IsVisible(), VPiece::MainPathPoints(), qApp, VPiece::SeamAllowancePoints(), SetCountourPoints(), setCutoutPaths(), VAbstractPiece::SetForbidFlipping(), setGrainline(), setInternalPaths(), VAbstractPiece::SetMx(), VAbstractPiece::SetMy(), VAbstractPiece::SetName(), setNotches(), SetPatternInfo(), SetPieceText(), VAbstractPiece::SetSAWidth(), and setSeamAllowancePoints().
Referenced by MainWindowsNoGUI::preparePiecesForLayout().
|
private |
Definition at line 1270 of file vlayoutpiece.cpp.
References createAllowancePath(), lineTypeToPenStyle(), Mm, qApp, and ToPixel().
Referenced by GetItem().
QPainterPath VLayoutPiece::createAllowancePath | ( | ) | const |
Definition at line 993 of file vlayoutpiece.cpp.
References GetSeamAllowancePoints(), VAbstractPiece::IsSeamAllowance(), and VAbstractPiece::IsSeamAllowanceBuiltIn().
Referenced by Create(), and createAllowanceItem().
|
private |
|
private |
Definition at line 1211 of file vlayoutpiece.cpp.
References d, getGrainline(), qApp, and SCASSERT.
Referenced by GetItem().
|
private |
|
private |
Definition at line 1112 of file vlayoutpiece.cpp.
References TextLine::bold, d, VTextManager::GetFont(), VTextManager::GetSourceLine(), VTextManager::GetSourceLinesCount(), VTextManager::GetSpacing(), TextLine::italic, TextLine::m_eAlign, TextLine::m_iFontSize, TextLine::m_text, qApp, SCASSERT, and widthHairLine.
Referenced by GetItem().
|
private |
Definition at line 1246 of file vlayoutpiece.cpp.
References createMainPath(), VAbstractPiece::IsSeamAllowance(), VAbstractPiece::IsSeamAllowanceBuiltIn(), lineTypeToPenStyle(), Mm, qApp, and ToPixel().
Referenced by GetItem().
QPainterPath VLayoutPiece::createMainPath | ( | ) | const |
Definition at line 973 of file vlayoutpiece.cpp.
References getContourPoints(), VAbstractPiece::isHideSeamLine(), VAbstractPiece::IsSeamAllowance(), and VAbstractPiece::IsSeamAllowanceBuiltIn().
Referenced by Create(), createMainItem(), and VPosition::Crossing().
|
private |
Definition at line 1282 of file vlayoutpiece.cpp.
References createNotchesPath(), and qApp.
Referenced by GetItem().
QPainterPath VLayoutPiece::createNotchesPath | ( | ) | const |
Definition at line 1025 of file vlayoutpiece.cpp.
References getNotches().
Referenced by createNotchesItem().
qreal VLayoutPiece::Diagonal | ( | ) | const |
Definition at line 827 of file vlayoutpiece.cpp.
References LayoutBoundingRect().
|
private |
Definition at line 1325 of file vlayoutpiece.cpp.
References d.
Referenced by LayoutEdge(), and pieceEdge().
|
private |
Definition at line 1359 of file vlayoutpiece.cpp.
References Map().
Referenced by LayoutEdgeByPoint(), and pieceEdgeByPoint().
QVector< QPointF > VLayoutPiece::getContourPoints | ( | ) | const |
Definition at line 466 of file vlayoutpiece.cpp.
Referenced by createMainPath(), VDxfEngine::ExportAAMADraw(), VDxfEngine::ExportAAMAOutline(), getMainPathItem(), pieceBoundingRect(), and SetLayoutAllowancePoints().
QVector< VLayoutPiecePath > VLayoutPiece::getCutoutPaths | ( | ) | const |
Definition at line 939 of file vlayoutpiece.cpp.
References d.
QVector< QPointF > VLayoutPiece::getGrainline | ( | ) | const |
Definition at line 685 of file vlayoutpiece.cpp.
Referenced by createGrainlineItem(), and VDxfEngine::ExportAAMAGrainline().
QVector< VLayoutPiecePath > VLayoutPiece::getInternalPaths | ( | ) | const |
Definition at line 927 of file vlayoutpiece.cpp.
References d.
QGraphicsItem * VLayoutPiece::GetItem | ( | bool | textAsPaths | ) | const |
Definition at line 1088 of file vlayoutpiece.cpp.
References createAllowanceItem(), createCutoutPathItem(), createGrainlineItem(), createInternalPathItem(), createLabelItem(), createMainItem(), createNotchesItem(), and d.
QVector< QPointF > VLayoutPiece::getLayoutAllowancePoints | ( | ) | const |
Definition at line 506 of file vlayoutpiece.cpp.
Referenced by VPosition::DrawDebug(), LayoutAllowancePath(), and LayoutBoundingRect().
qreal VLayoutPiece::GetLayoutWidth | ( | ) | const |
Definition at line 703 of file vlayoutpiece.cpp.
References d.
|
private |
Definition at line 1292 of file vlayoutpiece.cpp.
References getContourPoints().
Referenced by setGrainline(), SetPatternInfo(), and SetPieceText().
QVector< QLineF > VLayoutPiece::getNotches | ( | ) | const |
Definition at line 896 of file vlayoutpiece.cpp.
Referenced by createNotchesPath(), and VDxfEngine::ExportAAMANotch().
QStringList VLayoutPiece::GetPatternText | ( | ) | const |
Definition at line 586 of file vlayoutpiece.cpp.
References d, and anonymous_namespace{vlayoutpiece.cpp}::PieceLabelText().
QPointF VLayoutPiece::GetPatternTextPosition | ( | ) | const |
Definition at line 573 of file vlayoutpiece.cpp.
References d.
QStringList VLayoutPiece::GetPieceText | ( | ) | const |
Definition at line 525 of file vlayoutpiece.cpp.
References d, and anonymous_namespace{vlayoutpiece.cpp}::PieceLabelText().
Referenced by VDxfEngine::ExportAAMAText().
QPointF VLayoutPiece::GetPieceTextPosition | ( | ) | const |
Definition at line 512 of file vlayoutpiece.cpp.
References d.
Referenced by VDxfEngine::ExportAAMAText().
QVector< QPointF > VLayoutPiece::GetSeamAllowancePoints | ( | ) | const |
Definition at line 480 of file vlayoutpiece.cpp.
Referenced by createAllowancePath(), VDxfEngine::ExportAAMAOutline(), pieceBoundingRect(), and SetLayoutAllowancePoints().
QTransform VLayoutPiece::getTransform | ( | ) | const |
Definition at line 691 of file vlayoutpiece.cpp.
References d.
Referenced by VPosition::SaveCandidate().
Definition at line 911 of file vlayoutpiece.cpp.
Referenced by VDxfEngine::ExportAAMAIntcut().
bool VLayoutPiece::isMirror | ( | ) | const |
Definition at line 1313 of file vlayoutpiece.cpp.
References d.
Referenced by VPosition::SaveCandidate().
bool VLayoutPiece::isNull | ( | ) | const |
Definition at line 834 of file vlayoutpiece.cpp.
References d, VAbstractPiece::IsSeamAllowance(), and VAbstractPiece::IsSeamAllowanceBuiltIn().
QPainterPath VLayoutPiece::LayoutAllowancePath | ( | ) | const |
Definition at line 1071 of file vlayoutpiece.cpp.
References getLayoutAllowancePoints().
Referenced by VPosition::Crossing().
QRectF VLayoutPiece::LayoutBoundingRect | ( | ) | const |
Definition at line 819 of file vlayoutpiece.cpp.
References getLayoutAllowancePoints().
Referenced by VPosition::Crossing(), and Diagonal().
QLineF VLayoutPiece::LayoutEdge | ( | int | i | ) | const |
Definition at line 784 of file vlayoutpiece.cpp.
Referenced by VContour::AppendWhole(), VPosition::CombineEdges(), VPosition::RotateEdges(), and VContour::UniteWithContour().
int VLayoutPiece::LayoutEdgeByPoint | ( | const QPointF & | p1 | ) | const |
Definition at line 796 of file vlayoutpiece.cpp.
References d, and EdgeByPoint().
Referenced by VPosition::CheckCombineEdges().
int VLayoutPiece::LayoutEdgesCount | ( | ) | const |
Definition at line 772 of file vlayoutpiece.cpp.
References d.
Referenced by VLayoutPaper::AddToSheet(), VContour::AppendWhole(), VLayoutPaper::arrangePiece(), and VContour::UniteWithContour().
Definition at line 952 of file vlayoutpiece.cpp.
References d.
Referenced by EdgeByPoint(), getContourPoints(), getGrainline(), getLayoutAllowancePoints(), getNotches(), GetSeamAllowancePoints(), and InternalPathsForCut().
void VLayoutPiece::Mirror | ( | const QLineF & | edge | ) |
Definition at line 733 of file vlayoutpiece.cpp.
References d.
Referenced by VPosition::CheckCombineEdges().
VLayoutPiece & VLayoutPiece::operator= | ( | const VLayoutPiece & | detail | ) |
Definition at line 401 of file vlayoutpiece.cpp.
References d, and VAbstractPiece::operator=().
QRectF VLayoutPiece::pieceBoundingRect | ( | ) | const |
Definition at line 802 of file vlayoutpiece.cpp.
References getContourPoints(), GetSeamAllowancePoints(), VAbstractPiece::IsSeamAllowance(), and VAbstractPiece::IsSeamAllowanceBuiltIn().
Referenced by VPosition::CheckCombineEdges(), VPosition::CheckRotationEdges(), and VPosition::Crossing().
QLineF VLayoutPiece::pieceEdge | ( | int | i | ) | const |
Definition at line 778 of file vlayoutpiece.cpp.
References Edge(), and piecePath().
Referenced by VPosition::CombineEdges(), and VPosition::RotateEdges().
int VLayoutPiece::pieceEdgeByPoint | ( | const QPointF & | p1 | ) | const |
Definition at line 790 of file vlayoutpiece.cpp.
References EdgeByPoint(), and piecePath().
Referenced by VPosition::CheckCombineEdges().
int VLayoutPiece::pieceEdgesCount | ( | ) | const |
Definition at line 766 of file vlayoutpiece.cpp.
References piecePath().
Referenced by VLayoutPaper::AddToSheet(), and VLayoutPaper::arrangePiece().
|
private |
Definition at line 1233 of file vlayoutpiece.cpp.
References d, VAbstractPiece::IsSeamAllowance(), and VAbstractPiece::IsSeamAllowanceBuiltIn().
Referenced by pieceEdge(), pieceEdgeByPoint(), and pieceEdgesCount().
void VLayoutPiece::Rotate | ( | const QPointF & | originPoint, |
qreal | degrees | ||
) |
Definition at line 723 of file vlayoutpiece.cpp.
References d.
Referenced by VPosition::CombineEdges(), and VPosition::RotateEdges().
void VLayoutPiece::SetCountourPoints | ( | const QVector< QPointF > & | points, |
bool | hideMainPath = false |
||
) |
Definition at line 472 of file vlayoutpiece.cpp.
References d, VAbstractPiece::RemoveDublicates(), and VAbstractPiece::setHideSeamLine().
Referenced by Create().
void VLayoutPiece::setCutoutPaths | ( | const QVector< VLayoutPiecePath > & | cutoutPaths | ) |
void VLayoutPiece::setGrainline | ( | const VGrainlineData & | geom, |
const VContainer * | pattern | ||
) |
Definition at line 634 of file vlayoutpiece.cpp.
References atFront, atRear, anonymous_namespace{vlayoutpiece.cpp}::CorrectPosition(), d, anonymous_namespace{vlayoutpiece.cpp}::FindGrainlineGeometry(), VGrainlineData::GetArrowType(), getMainPathItem(), and SCASSERT.
Referenced by Create().
void VLayoutPiece::setInternalPaths | ( | const QVector< VLayoutPiecePath > & | internalPaths | ) |
void VLayoutPiece::SetLayoutAllowancePoints | ( | ) |
Definition at line 868 of file vlayoutpiece.cpp.
References d, VAbstractPiece::Equidistant(), getContourPoints(), GetSeamAllowancePoints(), VAbstractPiece::IsSeamAllowance(), VAbstractPiece::IsSeamAllowanceBuiltIn(), and anonymous_namespace{vlayoutpiece.cpp}::PrepareAllowance().
void VLayoutPiece::SetLayoutWidth | ( | const qreal & | value | ) |
Definition at line 709 of file vlayoutpiece.cpp.
References d.
void VLayoutPiece::SetMirror | ( | bool | value | ) |
Definition at line 1319 of file vlayoutpiece.cpp.
References d.
Referenced by VLayoutPaper::SaveResult().
void VLayoutPiece::setNotches | ( | const QVector< QLineF > & | notches | ) |
Definition at line 902 of file vlayoutpiece.cpp.
References d, and VAbstractPiece::IsSeamAllowance().
Referenced by Create().
void VLayoutPiece::SetPatternInfo | ( | VAbstractPattern * | pDoc, |
const VPatternLabelData & | geom, | ||
const QFont & | font, | ||
const VContainer * | pattern | ||
) |
Definition at line 592 of file vlayoutpiece.cpp.
References anonymous_namespace{vlayoutpiece.cpp}::CorrectPosition(), d, anonymous_namespace{vlayoutpiece.cpp}::FindLabelGeometry(), VPatternLabelData::getFontSize(), getMainPathItem(), VContainer::GetPatternUnit(), anonymous_namespace{vlayoutpiece.cpp}::RotatePoint(), and ToPixel().
Referenced by Create().
void VLayoutPiece::SetPieceText | ( | const QString & | qsName, |
const VPieceLabelData & | data, | ||
const QFont & | font, | ||
const VContainer * | pattern | ||
) |
Definition at line 531 of file vlayoutpiece.cpp.
References anonymous_namespace{vlayoutpiece.cpp}::CorrectPosition(), d, anonymous_namespace{vlayoutpiece.cpp}::FindLabelGeometry(), VPatternLabelData::getFontSize(), getMainPathItem(), VContainer::GetPatternUnit(), anonymous_namespace{vlayoutpiece.cpp}::RotatePoint(), and ToPixel().
Referenced by Create().
void VLayoutPiece::setSeamAllowancePoints | ( | const QVector< QPointF > & | points, |
bool | seamAllowance = true , |
||
bool | seamAllowanceBuiltIn = false |
||
) |
Definition at line 486 of file vlayoutpiece.cpp.
References d, VAbstractPiece::IsSeamAllowanceBuiltIn(), VAbstractPiece::RemoveDublicates(), VAbstractPiece::SetSeamAllowance(), and VAbstractPiece::SetSeamAllowanceBuiltIn().
Referenced by Create().
void VLayoutPiece::setTransform | ( | const QTransform & | transform | ) |
Definition at line 697 of file vlayoutpiece.cpp.
References d.
Referenced by VLayoutPaper::SaveResult().
qint64 VLayoutPiece::Square | ( | ) | const |
Definition at line 854 of file vlayoutpiece.cpp.
References d, and VAbstractPiece::sumTrapezoids().
void VLayoutPiece::Swap | ( | VLayoutPiece & | detail | ) |
Definition at line 385 of file vlayoutpiece.cpp.
References VAbstractPiece::Swap().
void VLayoutPiece::Translate | ( | qreal | dx, |
qreal | dy | ||
) |
Definition at line 715 of file vlayoutpiece.cpp.
References d.
Referenced by VPosition::CombineEdges(), VLayoutGenerator::movePieces(), and VPosition::RotateEdges().
|
private |
Definition at line 169 of file vlayoutpiece.h.
Referenced by createCutoutPathItem(), createGrainlineItem(), createInternalPathItem(), createLabelItem(), Edge(), getContourPoints(), getCutoutPaths(), getGrainline(), getInternalPaths(), GetItem(), getLayoutAllowancePoints(), GetLayoutWidth(), getNotches(), GetPatternText(), GetPatternTextPosition(), GetPieceText(), GetPieceTextPosition(), GetSeamAllowancePoints(), getTransform(), InternalPathsForCut(), isMirror(), isNull(), LayoutEdge(), LayoutEdgeByPoint(), LayoutEdgesCount(), Map(), Mirror(), operator=(), piecePath(), Rotate(), SetCountourPoints(), setCutoutPaths(), setGrainline(), setInternalPaths(), SetLayoutAllowancePoints(), SetLayoutWidth(), SetMirror(), setNotches(), SetPatternInfo(), SetPieceText(), setSeamAllowancePoints(), setTransform(), Square(), and Translate().