Seamly2D
Code documentation
VAbstractPiece Class Reference

#include <vabstractpiece.h>

Inheritance diagram for VAbstractPiece:
Collaboration diagram for VAbstractPiece:

Public Member Functions

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

Static Protected Member Functions

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)
 

Static Private Member Functions

static bool CheckIntersection (const QVector< QPointF > &points, int i, int iNext, int j, int jNext, const QPointF &crossPoint)
 
static bool ParallelCrossPoint (const QLineF &line1, const QLineF &line2, QPointF &point)
 
static bool Crossing (const QVector< QPointF > &sub1, const QVector< QPointF > &sub2)
 
static QVector< QPointF > SubPath (const QVector< QPointF > &path, int startIndex, int endIndex)
 
static Q_DECL_CONSTEXPR qreal PointPosition (const QPointF &p, const QLineF &line)
 
static QVector< QPointF > AngleByLength (const QPointF &p2, const QPointF &sp1, const QPointF &sp2, const QPointF &sp3, qreal width)
 
static QVector< QPointF > AngleByIntersection (const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &sp1, const QPointF &sp2, const QPointF &sp3, qreal width)
 
static QVector< QPointF > AngleByFirstSymmetry (const QPointF &p1, const QPointF &p2, const QPointF &sp1, const QPointF &sp2, const QPointF &sp3, qreal width)
 
static QVector< QPointF > AngleBySecondSymmetry (const QPointF &p2, const QPointF &p3, const QPointF &sp1, const QPointF &sp2, const QPointF &sp3, qreal width)
 
static QVector< QPointF > AngleByFirstRightAngle (const QPointF &p1, const QPointF &p2, const QPointF &sp1, const QPointF &sp2, const QPointF &sp3, qreal width)
 
static QVector< QPointF > AngleBySecondRightAngle (const QPointF &p2, const QPointF &p3, const QPointF &sp1, const QPointF &sp2, const QPointF &sp3, qreal width)
 
static QPointF SingleParallelPoint (const QPointF &p1, const QPointF &p2, qreal angle, qreal width)
 
static QLineF BisectorLine (const QPointF &p1, const QPointF &p2, const QPointF &p3)
 
static qreal AngleBetweenBisectors (const QLineF &b1, const QLineF &b2)
 

Private Attributes

QSharedDataPointer< VAbstractPieceDatad
 

Detailed Description

Definition at line 164 of file vabstractpiece.h.

Constructor & Destructor Documentation

◆ VAbstractPiece() [1/2]

VAbstractPiece::VAbstractPiece ( )

Definition at line 73 of file vabstractpiece.cpp.

◆ VAbstractPiece() [2/2]

VAbstractPiece::VAbstractPiece ( const VAbstractPiece piece)

Definition at line 78 of file vabstractpiece.cpp.

◆ ~VAbstractPiece()

VAbstractPiece::~VAbstractPiece ( )
virtual

Definition at line 94 of file vabstractpiece.cpp.

Member Function Documentation

◆ AngleBetweenBisectors()

qreal VAbstractPiece::AngleBetweenBisectors ( const QLineF &  b1,
const QLineF &  b2 
)
staticprivate

Definition at line 909 of file vabstractpiece.cpp.

References VFuzzyComparePossibleNulls().

Referenced by EkvPoint().

◆ AngleByFirstRightAngle()

QVector< QPointF > VAbstractPiece::AngleByFirstRightAngle ( const QPointF &  p1,
const QPointF &  p2,
const QPointF &  sp1,
const QPointF &  sp2,
const QPointF &  sp3,
qreal  width 
)
staticprivate

Definition at line 772 of file vabstractpiece.cpp.

References AngleByLength(), and maxL.

Referenced by EkvPoint().

◆ AngleByFirstSymmetry()

QVector< QPointF > VAbstractPiece::AngleByFirstSymmetry ( const QPointF &  p1,
const QPointF &  p2,
const QPointF &  sp1,
const QPointF &  sp2,
const QPointF &  sp3,
qreal  width 
)
staticprivate

Definition at line 690 of file vabstractpiece.cpp.

References AngleByLength(), VPointF::FlipPF(), and maxL.

Referenced by EkvPoint().

◆ AngleByIntersection()

QVector< QPointF > VAbstractPiece::AngleByIntersection ( const QPointF &  p1,
const QPointF &  p2,
const QPointF &  p3,
const QPointF &  sp1,
const QPointF &  sp2,
const QPointF &  sp3,
qreal  width 
)
staticprivate

Definition at line 649 of file vabstractpiece.cpp.

References AngleByLength(), and maxL.

Referenced by EkvPoint().

◆ AngleByLength()

QVector< QPointF > VAbstractPiece::AngleByLength ( const QPointF &  p2,
const QPointF &  sp1,
const QPointF &  sp2,
const QPointF &  sp3,
qreal  width 
)
staticprivate

◆ AngleBySecondRightAngle()

QVector< QPointF > VAbstractPiece::AngleBySecondRightAngle ( const QPointF &  p2,
const QPointF &  p3,
const QPointF &  sp1,
const QPointF &  sp2,
const QPointF &  sp3,
qreal  width 
)
staticprivate

Definition at line 810 of file vabstractpiece.cpp.

References AngleByLength(), and maxL.

Referenced by EkvPoint().

◆ AngleBySecondSymmetry()

QVector< QPointF > VAbstractPiece::AngleBySecondSymmetry ( const QPointF &  p2,
const QPointF &  p3,
const QPointF &  sp1,
const QPointF &  sp2,
const QPointF &  sp3,
qreal  width 
)
staticprivate

Definition at line 731 of file vabstractpiece.cpp.

References AngleByLength(), VPointF::FlipPF(), and maxL.

Referenced by EkvPoint().

◆ BisectorLine()

QLineF VAbstractPiece::BisectorLine ( const QPointF &  p1,
const QPointF &  p2,
const QPointF &  p3 
)
staticprivate

Definition at line 885 of file vabstractpiece.cpp.

Referenced by EkvPoint().

◆ CheckIntersection()

bool VAbstractPiece::CheckIntersection ( const QVector< QPointF > &  points,
int  i,
int  iNext,
int  j,
int  jNext,
const QPointF &  crossPoint 
)
staticprivate

Definition at line 936 of file vabstractpiece.cpp.

References CheckLoops(), CorrectEquidistantPoints(), Crossing(), SubPath(), and sumTrapezoids().

Referenced by CheckLoops().

◆ CheckLoops()

QVector< QPointF > VAbstractPiece::CheckLoops ( const QVector< QPointF > &  points)
static

CheckLoops seek and delete loops in equidistant.

Parameters
pointsvector of points of equidistant.
Returns
vector of points of equidistant.

Definition at line 315 of file vabstractpiece.cpp.

References CheckIntersection(), VGObject::IsPointOnLineviaPDP(), and ParallelCrossPoint().

Referenced by CheckIntersection(), Equidistant(), and VPiece::MainPathPoints().

◆ CorrectEquidistantPoints()

template<class T >
QVector< T > VAbstractPiece::CorrectEquidistantPoints ( const QVector< T > &  points,
bool  removeFirstAndLast = true 
)
static

CorrectEquidistantPoints clear equivalent points and remove point on line from equdistant.

Parameters
pointslist of points equdistant.
Returns
corrected list.

Definition at line 271 of file vabstractpiece.h.

References IsEkvPointOnLine(), and RemoveDublicates().

Referenced by CheckIntersection(), Equidistant(), and VPiece::MainPathPoints().

◆ createParallelLine() [1/2]

QLineF VAbstractPiece::createParallelLine ( const QPointF &  p1,
const QPointF &  p2,
qreal  width 
)
static

Definition at line 868 of file vabstractpiece.cpp.

References SingleParallelPoint().

◆ createParallelLine() [2/2]

◆ Crossing()

bool VAbstractPiece::Crossing ( const QVector< QPointF > &  sub1,
const QVector< QPointF > &  sub2 
)
staticprivate

Definition at line 992 of file vabstractpiece.cpp.

Referenced by CheckIntersection().

◆ EkvPoint()

QVector< QPointF > VAbstractPiece::EkvPoint ( const VSAPoint p1Line1,
const VSAPoint p2Line1,
const VSAPoint p1Line2,
const VSAPoint p2Line2,
qreal  width 
)
static

EkvPoint return seam allowance points in place of intersection of two edges. Last points of two edges should be equal.

Parameters
widthglobal seam allowance width.
Returns
seam allowance points.

Definition at line 481 of file vabstractpiece.cpp.

References AngleBetweenBisectors(), AngleByFirstRightAngle(), AngleByFirstSymmetry(), AngleByIntersection(), AngleByLength(), AngleBySecondRightAngle(), AngleBySecondSymmetry(), BisectorLine(), ByFirstEdgeRightAngle, ByFirstEdgeSymmetry, ByLength, ByPointsIntersection, BySecondEdgeRightAngle, BySecondEdgeSymmetry, createParallelLine(), VSAPoint::GetAngleType(), MaxLocalSA(), PointPosition(), and VFuzzyComparePossibleNulls().

Referenced by Equidistant(), and VPiece::getSeamNotchSAPoint().

◆ Equidistant()

QVector< QPointF > VAbstractPiece::Equidistant ( const QVector< VSAPoint > &  points,
qreal  width 
)
static

◆ getColor()

QString VAbstractPiece::getColor ( ) const

◆ getFill()

QString VAbstractPiece::getFill ( ) const

◆ getLock()

bool VAbstractPiece::getLock ( ) const

Definition at line 135 of file vabstractpiece.cpp.

References d.

◆ GetMx()

◆ GetMy()

◆ GetName()

◆ GetSAWidth()

◆ isClockwise()

bool VAbstractPiece::isClockwise ( const QVector< QPointF > &  points)
static

◆ IsEkvPointOnLine() [1/2]

bool VAbstractPiece::IsEkvPointOnLine ( const QPointF &  iPoint,
const QPointF &  prevPoint,
const QPointF &  nextPoint 
)
staticprotected

◆ IsEkvPointOnLine() [2/2]

bool VAbstractPiece::IsEkvPointOnLine ( const VSAPoint iPoint,
const VSAPoint prevPoint,
const VSAPoint nextPoint 
)
staticprotected

◆ IsForbidFlipping()

◆ isHideSeamLine()

◆ IsSeamAllowance()

◆ IsSeamAllowanceBuiltIn()

◆ MaxLocalSA()

qreal VAbstractPiece::MaxLocalSA ( const VSAPoint p,
qreal  width 
)
staticprotected

Definition at line 457 of file vabstractpiece.cpp.

References VSAPoint::GetSAAfter(), and VSAPoint::GetSABefore().

Referenced by EkvPoint(), and VPiece::getSeamNotchSAPoint().

◆ operator=()

VAbstractPiece & VAbstractPiece::operator= ( const VAbstractPiece piece)

Definition at line 83 of file vabstractpiece.cpp.

References d.

Referenced by VLayoutPiece::operator=(), and VPiece::operator=().

◆ ParallelCrossPoint()

bool VAbstractPiece::ParallelCrossPoint ( const QLineF &  line1,
const QLineF &  line2,
QPointF &  point 
)
staticprivate

Definition at line 967 of file vabstractpiece.cpp.

Referenced by CheckLoops().

◆ PointPosition()

Q_DECL_CONSTEXPR qreal VAbstractPiece::PointPosition ( const QPointF &  p,
const QLineF &  line 
)
staticprivate

Definition at line 450 of file vabstractpiece.cpp.

Referenced by EkvPoint().

◆ RemoveDublicates()

template<class T >
QVector< T > VAbstractPiece::RemoveDublicates ( const QVector< T > &  points,
bool  removeFirstAndLast = true 
)
staticprotected

◆ setColor()

void VAbstractPiece::setColor ( const QString &  value)

◆ setFill()

void VAbstractPiece::setFill ( const QString &  value)

Definition at line 129 of file vabstractpiece.cpp.

References d.

Referenced by PatternPieceDialog::CreatePiece(), and VPattern::parsePieceElement().

◆ SetForbidFlipping()

void VAbstractPiece::SetForbidFlipping ( bool  value)

◆ setHideSeamLine()

void VAbstractPiece::setHideSeamLine ( bool  value)

◆ setLock()

void VAbstractPiece::setLock ( bool  value)

Definition at line 141 of file vabstractpiece.cpp.

References d.

◆ SetMx()

void VAbstractPiece::SetMx ( qreal  value)

◆ SetMy()

void VAbstractPiece::SetMy ( qreal  value)

◆ SetName()

void VAbstractPiece::SetName ( const QString &  value)

◆ SetSAWidth()

void VAbstractPiece::SetSAWidth ( qreal  value)

Definition at line 201 of file vabstractpiece.cpp.

References d.

Referenced by VLayoutPiece::Create(), and VPiece::setSeamAllowanceWidthFormula().

◆ SetSeamAllowance()

◆ SetSeamAllowanceBuiltIn()

void VAbstractPiece::SetSeamAllowanceBuiltIn ( bool  value)

◆ SingleParallelPoint()

QPointF VAbstractPiece::SingleParallelPoint ( const QPointF &  p1,
const QPointF &  p2,
qreal  angle,
qreal  width 
)
staticprivate

Definition at line 876 of file vabstractpiece.cpp.

Referenced by createParallelLine().

◆ SubPath()

QVector< QPointF > VAbstractPiece::SubPath ( const QVector< QPointF > &  path,
int  startIndex,
int  endIndex 
)
staticprivate

Definition at line 1035 of file vabstractpiece.cpp.

Referenced by CheckIntersection().

◆ sumTrapezoids()

qreal VAbstractPiece::sumTrapezoids ( const QVector< QPointF > &  points)
static

Definition at line 256 of file vabstractpiece.cpp.

Referenced by CheckIntersection(), isClockwise(), and VLayoutPiece::Square().

◆ Swap()

void VAbstractPiece::Swap ( VAbstractPiece piece)

Definition at line 69 of file vabstractpiece.cpp.

Referenced by VLayoutPiece::Swap(), and VPiece::Swap().

Member Data Documentation

◆ d


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