Seamly2D
Code documentation
VLayoutPiece Class Reference

#include <vlayoutpiece.h>

Inheritance diagram for VLayoutPiece:
Collaboration diagram for VLayoutPiece:

Public Member Functions

 VLayoutPiece ()
 
 VLayoutPiece (const VLayoutPiece &detail)
 
virtual ~VLayoutPiece () Q_DECL_OVERRIDE
 
VLayoutPieceoperator= (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 > &notches)
 
QVector< QVector< QPointF > > InternalPathsForCut (bool cut) const
 
QVector< VLayoutPiecePathgetInternalPaths () const
 
void setInternalPaths (const QVector< VLayoutPiecePath > &internalPaths)
 
QVector< VLayoutPiecePathgetCutoutPaths () 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 ()
 
VAbstractPieceoperator= (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< VLayoutPieceDatad
 

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)
 

Detailed Description

Definition at line 79 of file vlayoutpiece.h.

Constructor & Destructor Documentation

◆ VLayoutPiece() [1/2]

VLayoutPiece::VLayoutPiece ( )

Definition at line 389 of file vlayoutpiece.cpp.

◆ VLayoutPiece() [2/2]

VLayoutPiece::VLayoutPiece ( const VLayoutPiece detail)

Definition at line 395 of file vlayoutpiece.cpp.

◆ ~VLayoutPiece()

VLayoutPiece::~VLayoutPiece ( )
virtual

Definition at line 413 of file vlayoutpiece.cpp.

Member Function Documentation

◆ Create()

◆ createAllowanceItem()

void VLayoutPiece::createAllowanceItem ( QGraphicsItem *  parent) const
private

Definition at line 1270 of file vlayoutpiece.cpp.

References createAllowancePath(), lineTypeToPenStyle(), Mm, qApp, and ToPixel().

Referenced by GetItem().

◆ createAllowancePath()

QPainterPath VLayoutPiece::createAllowancePath ( ) const

◆ createCutoutPathItem()

void VLayoutPiece::createCutoutPathItem ( int  i,
QGraphicsItem *  parent 
) const
private

Definition at line 1058 of file vlayoutpiece.cpp.

References d, Mm, qApp, SCASSERT, and ToPixel().

Referenced by GetItem().

◆ createGrainlineItem()

void VLayoutPiece::createGrainlineItem ( QGraphicsItem *  parent,
bool  textAsPaths 
) const
private

Definition at line 1211 of file vlayoutpiece.cpp.

References d, getGrainline(), qApp, and SCASSERT.

Referenced by GetItem().

◆ createInternalPathItem()

void VLayoutPiece::createInternalPathItem ( int  i,
QGraphicsItem *  parent 
) const
private

Definition at line 1045 of file vlayoutpiece.cpp.

References d, Mm, qApp, SCASSERT, and ToPixel().

Referenced by GetItem().

◆ createLabelItem()

void VLayoutPiece::createLabelItem ( QGraphicsItem *  parent,
const QVector< QPointF > &  labelShape,
const VTextManager tm,
bool  textAsPaths 
) const
private

◆ createMainItem()

QGraphicsPathItem * VLayoutPiece::createMainItem ( ) const
private

◆ createMainPath()

QPainterPath VLayoutPiece::createMainPath ( ) const

◆ createNotchesItem()

void VLayoutPiece::createNotchesItem ( QGraphicsItem *  parent) const
private

Definition at line 1282 of file vlayoutpiece.cpp.

References createNotchesPath(), and qApp.

Referenced by GetItem().

◆ createNotchesPath()

QPainterPath VLayoutPiece::createNotchesPath ( ) const

Definition at line 1025 of file vlayoutpiece.cpp.

References getNotches().

Referenced by createNotchesItem().

◆ Diagonal()

qreal VLayoutPiece::Diagonal ( ) const

Definition at line 827 of file vlayoutpiece.cpp.

References LayoutBoundingRect().

◆ Edge()

QLineF VLayoutPiece::Edge ( const QVector< QPointF > &  path,
int  i 
) const
private

Definition at line 1325 of file vlayoutpiece.cpp.

References d.

Referenced by LayoutEdge(), and pieceEdge().

◆ EdgeByPoint()

int VLayoutPiece::EdgeByPoint ( const QVector< QPointF > &  path,
const QPointF &  p1 
) const
private

Definition at line 1359 of file vlayoutpiece.cpp.

References Map().

Referenced by LayoutEdgeByPoint(), and pieceEdgeByPoint().

◆ getContourPoints()

QVector< QPointF > VLayoutPiece::getContourPoints ( ) const

◆ getCutoutPaths()

QVector< VLayoutPiecePath > VLayoutPiece::getCutoutPaths ( ) const

Definition at line 939 of file vlayoutpiece.cpp.

References d.

◆ getGrainline()

QVector< QPointF > VLayoutPiece::getGrainline ( ) const

Definition at line 685 of file vlayoutpiece.cpp.

References d, and Map().

Referenced by createGrainlineItem(), and VDxfEngine::ExportAAMAGrainline().

◆ getInternalPaths()

QVector< VLayoutPiecePath > VLayoutPiece::getInternalPaths ( ) const

Definition at line 927 of file vlayoutpiece.cpp.

References d.

◆ GetItem()

QGraphicsItem * VLayoutPiece::GetItem ( bool  textAsPaths) const

◆ getLayoutAllowancePoints()

QVector< QPointF > VLayoutPiece::getLayoutAllowancePoints ( ) const

Definition at line 506 of file vlayoutpiece.cpp.

References d, and Map().

Referenced by VPosition::DrawDebug(), LayoutAllowancePath(), and LayoutBoundingRect().

◆ GetLayoutWidth()

qreal VLayoutPiece::GetLayoutWidth ( ) const

Definition at line 703 of file vlayoutpiece.cpp.

References d.

◆ getMainPathItem()

QGraphicsPathItem * VLayoutPiece::getMainPathItem ( ) const
private

Definition at line 1292 of file vlayoutpiece.cpp.

References getContourPoints().

Referenced by setGrainline(), SetPatternInfo(), and SetPieceText().

◆ getNotches()

QVector< QLineF > VLayoutPiece::getNotches ( ) const

Definition at line 896 of file vlayoutpiece.cpp.

References d, and Map().

Referenced by createNotchesPath(), and VDxfEngine::ExportAAMANotch().

◆ GetPatternText()

QStringList VLayoutPiece::GetPatternText ( ) const

Definition at line 586 of file vlayoutpiece.cpp.

References d, and anonymous_namespace{vlayoutpiece.cpp}::PieceLabelText().

◆ GetPatternTextPosition()

QPointF VLayoutPiece::GetPatternTextPosition ( ) const

Definition at line 573 of file vlayoutpiece.cpp.

References d.

◆ GetPieceText()

QStringList VLayoutPiece::GetPieceText ( ) const

◆ GetPieceTextPosition()

QPointF VLayoutPiece::GetPieceTextPosition ( ) const

Definition at line 512 of file vlayoutpiece.cpp.

References d.

Referenced by VDxfEngine::ExportAAMAText().

◆ GetSeamAllowancePoints()

QVector< QPointF > VLayoutPiece::GetSeamAllowancePoints ( ) const

◆ getTransform()

QTransform VLayoutPiece::getTransform ( ) const

Definition at line 691 of file vlayoutpiece.cpp.

References d.

Referenced by VPosition::SaveCandidate().

◆ InternalPathsForCut()

QVector< QVector< QPointF > > VLayoutPiece::InternalPathsForCut ( bool  cut) const

Definition at line 911 of file vlayoutpiece.cpp.

References d, and Map().

Referenced by VDxfEngine::ExportAAMAIntcut().

◆ isMirror()

bool VLayoutPiece::isMirror ( ) const

Definition at line 1313 of file vlayoutpiece.cpp.

References d.

Referenced by VPosition::SaveCandidate().

◆ isNull()

bool VLayoutPiece::isNull ( ) const

◆ LayoutAllowancePath()

QPainterPath VLayoutPiece::LayoutAllowancePath ( ) const

Definition at line 1071 of file vlayoutpiece.cpp.

References getLayoutAllowancePoints().

Referenced by VPosition::Crossing().

◆ LayoutBoundingRect()

QRectF VLayoutPiece::LayoutBoundingRect ( ) const

Definition at line 819 of file vlayoutpiece.cpp.

References getLayoutAllowancePoints().

Referenced by VPosition::Crossing(), and Diagonal().

◆ LayoutEdge()

QLineF VLayoutPiece::LayoutEdge ( int  i) const

◆ LayoutEdgeByPoint()

int VLayoutPiece::LayoutEdgeByPoint ( const QPointF &  p1) const

Definition at line 796 of file vlayoutpiece.cpp.

References d, and EdgeByPoint().

Referenced by VPosition::CheckCombineEdges().

◆ LayoutEdgesCount()

int VLayoutPiece::LayoutEdgesCount ( ) const

◆ Map()

template<class T >
QVector< T > VLayoutPiece::Map ( const QVector< T > &  points) const
private

◆ Mirror()

void VLayoutPiece::Mirror ( const QLineF &  edge)

Definition at line 733 of file vlayoutpiece.cpp.

References d.

Referenced by VPosition::CheckCombineEdges().

◆ operator=()

VLayoutPiece & VLayoutPiece::operator= ( const VLayoutPiece detail)

Definition at line 401 of file vlayoutpiece.cpp.

References d, and VAbstractPiece::operator=().

◆ pieceBoundingRect()

◆ pieceEdge()

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().

◆ pieceEdgeByPoint()

int VLayoutPiece::pieceEdgeByPoint ( const QPointF &  p1) const

Definition at line 790 of file vlayoutpiece.cpp.

References EdgeByPoint(), and piecePath().

Referenced by VPosition::CheckCombineEdges().

◆ pieceEdgesCount()

int VLayoutPiece::pieceEdgesCount ( ) const

Definition at line 766 of file vlayoutpiece.cpp.

References piecePath().

Referenced by VLayoutPaper::AddToSheet(), and VLayoutPaper::arrangePiece().

◆ piecePath()

QVector< QPointF > VLayoutPiece::piecePath ( ) const
private

◆ Rotate()

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().

◆ SetCountourPoints()

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().

◆ setCutoutPaths()

void VLayoutPiece::setCutoutPaths ( const QVector< VLayoutPiecePath > &  cutoutPaths)

Definition at line 945 of file vlayoutpiece.cpp.

References d.

Referenced by Create().

◆ setGrainline()

◆ setInternalPaths()

void VLayoutPiece::setInternalPaths ( const QVector< VLayoutPiecePath > &  internalPaths)

Definition at line 933 of file vlayoutpiece.cpp.

References d.

Referenced by Create().

◆ SetLayoutAllowancePoints()

◆ SetLayoutWidth()

void VLayoutPiece::SetLayoutWidth ( const qreal &  value)

Definition at line 709 of file vlayoutpiece.cpp.

References d.

◆ SetMirror()

void VLayoutPiece::SetMirror ( bool  value)

Definition at line 1319 of file vlayoutpiece.cpp.

References d.

Referenced by VLayoutPaper::SaveResult().

◆ setNotches()

void VLayoutPiece::setNotches ( const QVector< QLineF > &  notches)

Definition at line 902 of file vlayoutpiece.cpp.

References d, and VAbstractPiece::IsSeamAllowance().

Referenced by Create().

◆ SetPatternInfo()

◆ SetPieceText()

◆ setSeamAllowancePoints()

void VLayoutPiece::setSeamAllowancePoints ( const QVector< QPointF > &  points,
bool  seamAllowance = true,
bool  seamAllowanceBuiltIn = false 
)

◆ setTransform()

void VLayoutPiece::setTransform ( const QTransform &  transform)

Definition at line 697 of file vlayoutpiece.cpp.

References d.

Referenced by VLayoutPaper::SaveResult().

◆ Square()

qint64 VLayoutPiece::Square ( ) const

Definition at line 854 of file vlayoutpiece.cpp.

References d, and VAbstractPiece::sumTrapezoids().

◆ Swap()

void VLayoutPiece::Swap ( VLayoutPiece detail)

Definition at line 385 of file vlayoutpiece.cpp.

References VAbstractPiece::Swap().

◆ Translate()

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().

Member Data Documentation

◆ d


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