Seamly2D
Code documentation
VPiece Class Reference

#include <vpiece.h>

Inheritance diagram for VPiece:
Collaboration diagram for VPiece:

Public Member Functions

 VPiece ()
 
 VPiece (const VPiece &piece)
 
virtual ~VPiece ()
 
VPieceoperator= (const VPiece &piece)
 
void Swap (VPiece &piece) Q_DECL_NOTHROW
 
VPiecePath GetPath () const
 
VPiecePathGetPath ()
 
void SetPath (const VPiecePath &path)
 
QVector< QPointF > MainPathPoints (const VContainer *data) const
 
QVector< VPointFMainPathNodePoints (const VContainer *data, bool showExcluded=false) const
 
QVector< QPointF > SeamAllowancePoints (const VContainer *data) const
 
QVector< QLineF > createNotchLines (const VContainer *data, const QVector< QPointF > &seamAllowance=QVector< QPointF >()) const
 
QPainterPath MainPathPath (const VContainer *data) const
 
QPainterPath SeamAllowancePath (const VContainer *data) const
 
QPainterPath SeamAllowancePath (const QVector< QPointF > &points) const
 
QPainterPath getNotchesPath (const VContainer *data, const QVector< QPointF > &seamAllowance=QVector< QPointF >()) const
 
bool isInLayout () const
 
void SetInLayout (bool inLayout)
 
bool isLocked () const
 
void setIsLocked (bool isLocked)
 
bool IsUnited () const
 
void SetUnited (bool united)
 
QString getSeamAllowanceWidthFormula () const
 
void setSeamAllowanceWidthFormula (const QString &formula, qreal value)
 
QVector< quint32 > GetInternalPaths () const
 
QVector< quint32 > & GetInternalPaths ()
 
void SetInternalPaths (const QVector< quint32 > &iPaths)
 
QVector< CustomSARecordGetCustomSARecords () const
 
QVector< CustomSARecord > & GetCustomSARecords ()
 
void SetCustomSARecords (const QVector< CustomSARecord > &records)
 
QVector< quint32 > getAnchors () const
 
QVector< quint32 > & getAnchors ()
 
void setAnchors (const QVector< quint32 > &anchors)
 
QVector< quint32 > MissingNodes (const VPiece &piece) const
 MissingNodes find missing nodes in piece. When we deleted object in piece and return this piece need understand, what nodes need make invisible. More...
 
QVector< quint32 > MissingCSAPath (const VPiece &piece) const
 
QVector< quint32 > MissingInternalPaths (const VPiece &piece) const
 
QVector< quint32 > missingAnchors (const VPiece &piece) const
 
void SetPatternPieceData (const VPieceLabelData &data)
 
VPieceLabelDataGetPatternPieceData ()
 Returns full access to the pattern piece data object. More...
 
const VPieceLabelDataGetPatternPieceData () const
 Returns the read only reference to the pattern piece data object. More...
 
void SetPatternInfo (const VPatternLabelData &info)
 
VPatternLabelDataGetPatternInfo ()
 Returns full access to the pattern info geometry object. More...
 
const VPatternLabelDataGetPatternInfo () const
 Returns the read only reference to the pattern info geometry object. More...
 
VGrainlineDataGetGrainlineGeometry ()
 VDetail::GetGrainlineGeometry full access to the grainline geometry object. More...
 
const VGrainlineDataGetGrainlineGeometry () const
 VDetail::GetGrainlineGeometry returns the read-only reference to the grainline geometry object. More...
 
- 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)
 

Private Member Functions

QVector< VPieceNodeGetUnitedPath (const VContainer *data) const
 
QVector< CustomSARecordGetValidRecords () const
 
QVector< CustomSARecordFilterRecords (QVector< CustomSARecord > records) const
 
QVector< VSAPointgetNodeSAPoints (const QVector< VPieceNode > &path, int index, const VContainer *data) const
 
bool getNotchSAPoint (const QVector< VPieceNode > &path, int index, const VContainer *data, VSAPoint &point) const
 
bool getNotchPreviousSAPoints (const QVector< VPieceNode > &path, int index, const VSAPoint &notchSAPoint, const VContainer *data, VSAPoint &point) const
 
int getNextNotchSAPoints (const QVector< VPieceNode > &path, int index, const VSAPoint &notchSAPoint, const VContainer *data, VSAPoint &point) const
 
bool getSeamNotchSAPoint (const VSAPoint &previousSAPoint, const VSAPoint &notchSAPoint, const VSAPoint &nextSAPoint, const VContainer *data, QPointF &point) const
 
bool isNotchVisible (const QVector< VPieceNode > &path, int notchIndex) const
 
QVector< QLineF > createNotch (const QVector< VPieceNode > &path, int previousIndex, int notchIndex, int nextIndex, const VContainer *data, const QVector< QPointF > &pathPoints=QVector< QPointF >()) const
 
QVector< QLineF > createSeamAllowanceNotch (const QVector< VPieceNode > &path, VSAPoint &previousSAPoint, const VSAPoint &notchSAPoint, VSAPoint &nextSAPoint, const VContainer *data, int notchIndex, const QVector< QPointF > &pathPoints=QVector< QPointF >()) const
 
QVector< QLineF > createBuiltInSaNotch (const QVector< VPieceNode > &path, const VSAPoint &previousSAPoint, const VSAPoint &notchSAPoint, const VSAPoint &nextSAPoint, const VContainer *data, int notchIndex, const QVector< QPointF > &pathPoints) const
 
QVector< QLineF > createSlitNotch (NotchData notchData, const QVector< QPointF > &seamAllowance) const
 
QVector< QLineF > createTNotch (NotchData notchData, const QVector< QPointF > &pathPoints) const
 
QVector< QLineF > createUNotch (const NotchData notchData, const QVector< QPointF > &seamAllowance) const
 
QVector< QLineF > createVInternalNotch (NotchData notchData, const QVector< QPointF > &pathPoints) const
 
QVector< QLineF > createVExternalNotch (NotchData notchData, const QVector< QPointF > &seamAllowance) const
 
QVector< QLineF > createCastleNotch (const NotchData notchData, const QVector< QPointF > &seamAllowance) const
 
QVector< QLineF > createDiamondNotch (NotchData notchData, const QVector< QPointF > &seamAllowance) const
 
QVector< QLineF > createNotches (NotchData notchData, const QVector< QPointF > &seamAllowance) const
 
QLineF findIntersection (const QVector< QPointF > &seamAllowance, const QLineF &line) const
 

Static Private Member Functions

static int IsCSAStart (const QVector< CustomSARecord > &records, quint32 id)
 

Private Attributes

QSharedDataPointer< VPieceDatad
 

Additional Inherited Members

- 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...
 
- 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 87 of file vpiece.h.

Constructor & Destructor Documentation

◆ VPiece() [1/2]

VPiece::VPiece ( )

Definition at line 128 of file vpiece.cpp.

References PiecePath.

◆ VPiece() [2/2]

VPiece::VPiece ( const VPiece piece)

Definition at line 134 of file vpiece.cpp.

◆ ~VPiece()

VPiece::~VPiece ( )
virtual

Definition at line 152 of file vpiece.cpp.

Member Function Documentation

◆ createBuiltInSaNotch()

QVector< QLineF > VPiece::createBuiltInSaNotch ( const QVector< VPieceNode > &  path,
const VSAPoint previousSAPoint,
const VSAPoint notchSAPoint,
const VSAPoint nextSAPoint,
const VContainer data,
int  notchIndex,
const QVector< QPointF > &  pathPoints 
) const
private

◆ createCastleNotch()

QVector< QLineF > VPiece::createCastleNotch ( const NotchData  notchData,
const QVector< QPointF > &  seamAllowance 
) const
private

◆ createDiamondNotch()

QVector< QLineF > VPiece::createDiamondNotch ( NotchData  notchData,
const QVector< QPointF > &  seamAllowance 
) const
private

Definition at line 1292 of file vpiece.cpp.

References NotchData::angle, and createVExternalNotch().

Referenced by createNotches().

◆ createNotch()

QVector< QLineF > VPiece::createNotch ( const QVector< VPieceNode > &  path,
int  previousIndex,
int  notchIndex,
int  nextIndex,
const VContainer data,
const QVector< QPointF > &  pathPoints = QVector<QPointF>() 
) const
private

◆ createNotches()

◆ createNotchLines()

QVector< QLineF > VPiece::createNotchLines ( const VContainer data,
const QVector< QPointF > &  seamAllowance = QVector<QPointF>() 
) const

◆ createSeamAllowanceNotch()

◆ createSlitNotch()

QVector< QLineF > VPiece::createSlitNotch ( NotchData  notchData,
const QVector< QPointF > &  seamAllowance 
) const
private

◆ createTNotch()

QVector< QLineF > VPiece::createTNotch ( NotchData  notchData,
const QVector< QPointF > &  pathPoints 
) const
private

◆ createUNotch()

QVector< QLineF > VPiece::createUNotch ( const NotchData  notchData,
const QVector< QPointF > &  seamAllowance 
) const
private

◆ createVExternalNotch()

QVector< QLineF > VPiece::createVExternalNotch ( NotchData  notchData,
const QVector< QPointF > &  seamAllowance 
) const
private

◆ createVInternalNotch()

QVector< QLineF > VPiece::createVInternalNotch ( NotchData  notchData,
const QVector< QPointF > &  pathPoints 
) const
private

◆ FilterRecords()

QVector< CustomSARecord > VPiece::FilterRecords ( QVector< CustomSARecord records) const
private

Definition at line 680 of file vpiece.cpp.

References d, and CustomSARecord::endPoint.

Referenced by GetUnitedPath(), isNotchVisible(), and SeamAllowancePoints().

◆ findIntersection()

QLineF VPiece::findIntersection ( const QVector< QPointF > &  seamAllowance,
const QLineF &  line 
) const
private

◆ getAnchors() [1/2]

QVector< quint32 > & VPiece::getAnchors ( )

Definition at line 468 of file vpiece.cpp.

References d.

◆ getAnchors() [2/2]

◆ GetCustomSARecords() [1/2]

QVector< CustomSARecord > & VPiece::GetCustomSARecords ( )

Definition at line 450 of file vpiece.cpp.

References d.

◆ GetCustomSARecords() [2/2]

◆ GetGrainlineGeometry() [1/2]

◆ GetGrainlineGeometry() [2/2]

const VGrainlineData & VPiece::GetGrainlineGeometry ( ) const

VDetail::GetGrainlineGeometry returns the read-only reference to the grainline geometry object.

Returns
reference to grainline geometry object

Definition at line 588 of file vpiece.cpp.

References d.

◆ GetInternalPaths() [1/2]

QVector< quint32 > & VPiece::GetInternalPaths ( )

Definition at line 432 of file vpiece.cpp.

References d.

◆ GetInternalPaths() [2/2]

◆ getNextNotchSAPoints()

int VPiece::getNextNotchSAPoints ( const QVector< VPieceNode > &  path,
int  index,
const VSAPoint notchSAPoint,
const VContainer data,
VSAPoint point 
) const
private

Definition at line 808 of file vpiece.cpp.

References getNodeSAPoints(), and SCASSERT.

Referenced by createNotch().

◆ getNodeSAPoints()

◆ getNotchesPath()

QPainterPath VPiece::getNotchesPath ( const VContainer data,
const QVector< QPointF > &  seamAllowance = QVector<QPointF>() 
) const

Definition at line 352 of file vpiece.cpp.

References createNotchLines(), and VAbstractPiece::IsSeamAllowance().

Referenced by PatternPieceTool::RefreshGeometry().

◆ getNotchPreviousSAPoints()

bool VPiece::getNotchPreviousSAPoints ( const QVector< VPieceNode > &  path,
int  index,
const VSAPoint notchSAPoint,
const VContainer data,
VSAPoint point 
) const
private

Definition at line 775 of file vpiece.cpp.

References getNodeSAPoints(), and SCASSERT.

Referenced by createNotch().

◆ getNotchSAPoint()

bool VPiece::getNotchSAPoint ( const QVector< VPieceNode > &  path,
int  index,
const VContainer data,
VSAPoint point 
) const
private

Definition at line 758 of file vpiece.cpp.

References getNodeSAPoints(), and SCASSERT.

Referenced by createNotch().

◆ GetPath() [1/2]

VPiecePath & VPiece::GetPath ( )

Definition at line 162 of file vpiece.cpp.

References d.

◆ GetPath() [2/2]

◆ GetPatternInfo() [1/2]

◆ GetPatternInfo() [2/2]

const VPatternLabelData & VPiece::GetPatternInfo ( ) const

Returns the read only reference to the pattern info geometry object.

Returns
pattern info geometry object

Definition at line 568 of file vpiece.cpp.

References d.

◆ GetPatternPieceData() [1/2]

◆ GetPatternPieceData() [2/2]

const VPieceLabelData & VPiece::GetPatternPieceData ( ) const

Returns the read only reference to the pattern piece data object.

Returns
pattern piece data object

Definition at line 542 of file vpiece.cpp.

References d.

◆ getSeamAllowanceWidthFormula()

QString VPiece::getSeamAllowanceWidthFormula ( ) const

◆ getSeamNotchSAPoint()

bool VPiece::getSeamNotchSAPoint ( const VSAPoint previousSAPoint,
const VSAPoint notchSAPoint,
const VSAPoint nextSAPoint,
const VContainer data,
QPointF &  point 
) const
private

◆ GetUnitedPath()

◆ GetValidRecords()

QVector< CustomSARecord > VPiece::GetValidRecords ( ) const
private

◆ IsCSAStart()

int VPiece::IsCSAStart ( const QVector< CustomSARecord > &  records,
quint32  id 
)
staticprivate

Definition at line 1103 of file vpiece.cpp.

Referenced by SeamAllowancePoints().

◆ isInLayout()

◆ isLocked()

◆ isNotchVisible()

◆ IsUnited()

bool VPiece::IsUnited ( ) const

Definition at line 400 of file vpiece.cpp.

References d.

Referenced by PatternPieceTool::AddAttributes().

◆ MainPathNodePoints()

QVector< VPointF > VPiece::MainPathNodePoints ( const VContainer data,
bool  showExcluded = false 
) const

Definition at line 182 of file vpiece.cpp.

References GetPath(), and VPiecePath::PathNodePoints().

Referenced by PatternPieceVisual::RefreshGeometry().

◆ MainPathPath()

QPainterPath VPiece::MainPathPath ( const VContainer data) const

◆ MainPathPoints()

◆ missingAnchors()

QVector< quint32 > VPiece::missingAnchors ( const VPiece piece) const

◆ MissingCSAPath()

QVector< quint32 > VPiece::MissingCSAPath ( const VPiece piece) const

◆ MissingInternalPaths()

QVector< quint32 > VPiece::MissingInternalPaths ( const VPiece piece) const

◆ MissingNodes()

QVector< quint32 > VPiece::MissingNodes ( const VPiece piece) const

MissingNodes find missing nodes in piece. When we deleted object in piece and return this piece need understand, what nodes need make invisible.

Parameters
piecechanged piece.
Returns
list with missing nodes.

Definition at line 486 of file vpiece.cpp.

References d, and GetPath().

Referenced by SavePieceOptions::redo(), and SavePieceOptions::undo().

◆ operator=()

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

Definition at line 140 of file vpiece.cpp.

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

◆ SeamAllowancePath() [1/2]

QPainterPath VPiece::SeamAllowancePath ( const QVector< QPointF > &  points) const

◆ SeamAllowancePath() [2/2]

QPainterPath VPiece::SeamAllowancePath ( const VContainer data) const

Definition at line 323 of file vpiece.cpp.

References SeamAllowancePoints().

Referenced by PatternPieceTool::RefreshGeometry().

◆ SeamAllowancePoints()

◆ setAnchors()

void VPiece::setAnchors ( const QVector< quint32 > &  anchors)

Definition at line 474 of file vpiece.cpp.

References d.

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

◆ SetCustomSARecords()

void VPiece::SetCustomSARecords ( const QVector< CustomSARecord > &  records)

Definition at line 456 of file vpiece.cpp.

References d.

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

◆ SetInLayout()

void VPiece::SetInLayout ( bool  inLayout)

◆ SetInternalPaths()

void VPiece::SetInternalPaths ( const QVector< quint32 > &  iPaths)

Definition at line 438 of file vpiece.cpp.

References d.

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

◆ setIsLocked()

void VPiece::setIsLocked ( bool  isLocked)

Definition at line 394 of file vpiece.cpp.

References d, and isLocked().

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

◆ SetPath()

void VPiece::SetPath ( const VPiecePath path)

Definition at line 168 of file vpiece.cpp.

References d.

Referenced by QT_WARNING_POP::CreateUnitedNodes(), and VPattern::parsePieceElement().

◆ SetPatternInfo()

void VPiece::SetPatternInfo ( const VPatternLabelData info)

Definition at line 548 of file vpiece.cpp.

References d.

◆ SetPatternPieceData()

void VPiece::SetPatternPieceData ( const VPieceLabelData data)

Definition at line 522 of file vpiece.cpp.

References d.

◆ setSeamAllowanceWidthFormula()

void VPiece::setSeamAllowanceWidthFormula ( const QString &  formula,
qreal  value 
)

◆ SetUnited()

void VPiece::SetUnited ( bool  united)

Definition at line 406 of file vpiece.cpp.

References d.

Referenced by QT_WARNING_POP::createUnion(), and VPattern::parsePieceElement().

◆ Swap()

void VPiece::Swap ( VPiece piece)

Definition at line 124 of file vpiece.cpp.

References VAbstractPiece::Swap().

Member Data Documentation

◆ d


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