Code that converts VPiece to VLayoutDetail moved to static function.
--HG-- branch : feature
This commit is contained in:
parent
26c76bbc71
commit
8fb6c9c508
|
@ -475,37 +475,7 @@ void MainWindowsNoGUI::PrepareDetailsForLayout(const QHash<quint32, VPiece> *det
|
||||||
QHash<quint32, VPiece>::const_iterator i = details->constBegin();
|
QHash<quint32, VPiece>::const_iterator i = details->constBegin();
|
||||||
while (i != details->constEnd())
|
while (i != details->constEnd())
|
||||||
{
|
{
|
||||||
VLayoutDetail det = VLayoutDetail();
|
listDetails.append(VLayoutDetail::Create(i.value(), pattern));
|
||||||
const VPiece d = i.value();
|
|
||||||
det.SetCountourPoints(d.MainPathPoints(pattern));
|
|
||||||
det.SetSeamAllowencePoints(d.SeamAllowancePoints(pattern), d.IsSeamAllowance(), false);
|
|
||||||
det.setName(d.GetName());
|
|
||||||
const VPatternPieceData& data = d.GetPatternPieceData();
|
|
||||||
if (data.IsVisible() == true)
|
|
||||||
{
|
|
||||||
det.SetDetail(d.GetName(), data, qApp->font());
|
|
||||||
}
|
|
||||||
const VPatternInfoGeometry& geom = d.GetPatternInfo();
|
|
||||||
if (geom.IsVisible() == true)
|
|
||||||
{
|
|
||||||
VAbstractPattern* pDoc = qApp->getCurrentDocument();
|
|
||||||
QDate date;
|
|
||||||
if (pDoc->IsDateVisible() == true)
|
|
||||||
{
|
|
||||||
date = QDate::currentDate();
|
|
||||||
}
|
|
||||||
det.SetPatternInfo(pDoc, geom, qApp->font(), pattern->size(), pattern->height());
|
|
||||||
}
|
|
||||||
const VGrainlineGeometry& grainlineGeom = d.GetGrainlineGeometry();
|
|
||||||
if (grainlineGeom.IsVisible() == true)
|
|
||||||
{
|
|
||||||
det.SetGrainline(grainlineGeom, *pattern);
|
|
||||||
}
|
|
||||||
det.setWidth(qApp->toPixel(d.GetSAWidth()));
|
|
||||||
det.CreateTextItems();
|
|
||||||
det.setForbidFlipping(d.IsForbidFlipping());
|
|
||||||
|
|
||||||
listDetails.append(det);
|
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,6 +83,41 @@ VLayoutDetail &VLayoutDetail::operator=(const VLayoutDetail &detail)
|
||||||
VLayoutDetail::~VLayoutDetail()
|
VLayoutDetail::~VLayoutDetail()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
VLayoutDetail VLayoutDetail::Create(const VPiece &piece, const VContainer *pattern)
|
||||||
|
{
|
||||||
|
VLayoutDetail det = VLayoutDetail();
|
||||||
|
det.SetCountourPoints(piece.MainPathPoints(pattern));
|
||||||
|
det.SetSeamAllowencePoints(piece.SeamAllowancePoints(pattern), piece.IsSeamAllowance(), false);
|
||||||
|
det.setName(piece.GetName());
|
||||||
|
const VPatternPieceData& data = piece.GetPatternPieceData();
|
||||||
|
if (data.IsVisible() == true)
|
||||||
|
{
|
||||||
|
det.SetDetail(piece.GetName(), data, qApp->font());
|
||||||
|
}
|
||||||
|
const VPatternInfoGeometry& geom = piece.GetPatternInfo();
|
||||||
|
if (geom.IsVisible() == true)
|
||||||
|
{
|
||||||
|
VAbstractPattern* pDoc = qApp->getCurrentDocument();
|
||||||
|
QDate date;
|
||||||
|
if (pDoc->IsDateVisible() == true)
|
||||||
|
{
|
||||||
|
date = QDate::currentDate();
|
||||||
|
}
|
||||||
|
det.SetPatternInfo(pDoc, geom, qApp->font(), pattern->size(), pattern->height());
|
||||||
|
}
|
||||||
|
const VGrainlineGeometry& grainlineGeom = piece.GetGrainlineGeometry();
|
||||||
|
if (grainlineGeom.IsVisible() == true)
|
||||||
|
{
|
||||||
|
det.SetGrainline(grainlineGeom, *pattern);
|
||||||
|
}
|
||||||
|
det.setWidth(qApp->toPixel(piece.GetSAWidth()));
|
||||||
|
det.CreateTextItems();
|
||||||
|
det.setForbidFlipping(piece.IsForbidFlipping());
|
||||||
|
|
||||||
|
return det;
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
// cppcheck-suppress unusedFunction
|
// cppcheck-suppress unusedFunction
|
||||||
QVector<QPointF> VLayoutDetail::GetContourPoints() const
|
QVector<QPointF> VLayoutDetail::GetContourPoints() const
|
||||||
|
|
|
@ -68,6 +68,8 @@ public:
|
||||||
VLayoutDetail &operator=(const VLayoutDetail &detail);
|
VLayoutDetail &operator=(const VLayoutDetail &detail);
|
||||||
virtual ~VLayoutDetail() Q_DECL_OVERRIDE;
|
virtual ~VLayoutDetail() Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
static VLayoutDetail Create(const VPiece &piece, const VContainer *pattern);
|
||||||
|
|
||||||
QVector<QPointF> GetContourPoints() const;
|
QVector<QPointF> GetContourPoints() const;
|
||||||
void SetCountourPoints(const QVector<QPointF> &points);
|
void SetCountourPoints(const QVector<QPointF> &points);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user