Returned "Forbid flipping" feature.
--HG-- branch : feature
This commit is contained in:
parent
0dbf26a109
commit
df20415e9e
|
@ -621,8 +621,8 @@ void VPattern::ParseDetailElement(const QDomElement &domElement, const Document
|
||||||
// detail.setSeamAllowance(GetParametrUInt(domElement, VToolDetail::AttrSupplement, "1"));
|
// detail.setSeamAllowance(GetParametrUInt(domElement, VToolDetail::AttrSupplement, "1"));
|
||||||
// detail.setWidth(GetParametrDouble(domElement, VToolDetail::AttrWidth, "10.0"));
|
// detail.setWidth(GetParametrDouble(domElement, VToolDetail::AttrWidth, "10.0"));
|
||||||
// detail.setClosed(GetParametrUInt(domElement, VToolDetail::AttrClosed, "1"));
|
// detail.setClosed(GetParametrUInt(domElement, VToolDetail::AttrClosed, "1"));
|
||||||
// detail.setForbidFlipping(GetParametrUInt(domElement, VToolDetail::AttrForbidFlipping,
|
detail.SetForbidFlipping(GetParametrUInt(domElement, VToolSeamAllowance::AttrForbidFlipping,
|
||||||
// QString().setNum(qApp->ValentinaSettings()->GetForbidWorkpieceFlipping())));
|
QString().setNum(qApp->ValentinaSettings()->GetForbidWorkpieceFlipping())));
|
||||||
detail.SetInLayout(GetParametrBool(domElement, AttrInLayout, trueStr));
|
detail.SetInLayout(GetParametrBool(domElement, AttrInLayout, trueStr));
|
||||||
|
|
||||||
const QStringList tags = QStringList() << VToolSeamAllowance::TagNodes
|
const QStringList tags = QStringList() << VToolSeamAllowance::TagNodes
|
||||||
|
|
|
@ -414,6 +414,7 @@
|
||||||
<xs:attribute name="my" type="xs:double"></xs:attribute>
|
<xs:attribute name="my" type="xs:double"></xs:attribute>
|
||||||
<xs:attribute name="name" type="xs:string"></xs:attribute>
|
<xs:attribute name="name" type="xs:string"></xs:attribute>
|
||||||
<xs:attribute name="inLayout" type="xs:boolean"></xs:attribute>
|
<xs:attribute name="inLayout" type="xs:boolean"></xs:attribute>
|
||||||
|
<xs:attribute name="forbidFlipping" type="xs:unsignedInt"></xs:attribute>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
|
|
@ -1697,7 +1697,6 @@ void VPatternConverter::TagDetailToV0_4_0()
|
||||||
dom.removeAttribute(strSupplement);
|
dom.removeAttribute(strSupplement);
|
||||||
dom.removeAttribute(strClosed);
|
dom.removeAttribute(strClosed);
|
||||||
dom.removeAttribute(strWidth);
|
dom.removeAttribute(strWidth);
|
||||||
dom.removeAttribute(strForbidFlipping);
|
|
||||||
|
|
||||||
dom.setAttribute(strVersion, "1");
|
dom.setAttribute(strVersion, "1");
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,18 @@ void VAbstractPiece::SetName(const QString &value)
|
||||||
d->m_name = value;
|
d->m_name = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
bool VAbstractPiece::IsForbidFlipping() const
|
||||||
|
{
|
||||||
|
return d->m_forbidFlipping;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VAbstractPiece::SetForbidFlipping(bool value)
|
||||||
|
{
|
||||||
|
d->m_forbidFlipping = value;
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
qreal VAbstractPiece::SumTrapezoids(const QVector<QPointF> &points)
|
qreal VAbstractPiece::SumTrapezoids(const QVector<QPointF> &points)
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,6 +47,9 @@ public:
|
||||||
QString GetName() const;
|
QString GetName() const;
|
||||||
void SetName(const QString &value);
|
void SetName(const QString &value);
|
||||||
|
|
||||||
|
bool IsForbidFlipping() const;
|
||||||
|
void SetForbidFlipping(bool value);
|
||||||
|
|
||||||
static qreal SumTrapezoids(const QVector<QPointF> &points);
|
static qreal SumTrapezoids(const QVector<QPointF> &points);
|
||||||
static QVector<QPointF> CheckLoops(const QVector<QPointF> &points);
|
static QVector<QPointF> CheckLoops(const QVector<QPointF> &points);
|
||||||
static QVector<QPointF> CorrectEquidistantPoints(const QVector<QPointF> &points, bool removeFirstAndLast = true);
|
static QVector<QPointF> CorrectEquidistantPoints(const QVector<QPointF> &points, bool removeFirstAndLast = true);
|
||||||
|
|
|
@ -41,17 +41,21 @@ class VAbstractPieceData : public QSharedData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VAbstractPieceData()
|
VAbstractPieceData()
|
||||||
: m_name()
|
: m_name(),
|
||||||
|
m_forbidFlipping(false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
VAbstractPieceData(const VAbstractPieceData &piece)
|
VAbstractPieceData(const VAbstractPieceData &piece)
|
||||||
: QSharedData(piece),
|
: QSharedData(piece),
|
||||||
m_name(piece.m_name)
|
m_name(piece.m_name),
|
||||||
|
m_forbidFlipping(piece.m_forbidFlipping)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
~VAbstractPieceData();
|
~VAbstractPieceData();
|
||||||
|
|
||||||
QString m_name;
|
QString m_name;
|
||||||
|
/** @brief forbidFlipping forbid piece be mirrored in a layout. */
|
||||||
|
bool m_forbidFlipping;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
VAbstractPieceData &operator=(const VAbstractPieceData &) Q_DECL_EQ_DELETE;
|
VAbstractPieceData &operator=(const VAbstractPieceData &) Q_DECL_EQ_DELETE;
|
||||||
|
|
|
@ -50,6 +50,8 @@ DialogSeamAllowance::DialogSeamAllowance(const VContainer *data, const quint32 &
|
||||||
flagError = MainPathIsValid();
|
flagError = MainPathIsValid();
|
||||||
CheckState();
|
CheckState();
|
||||||
|
|
||||||
|
ui->checkBoxForbidFlipping->setChecked(qApp->Settings()->GetForbidWorkpieceFlipping());
|
||||||
|
|
||||||
ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
|
ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
connect(ui->listWidget, &QListWidget::customContextMenuRequested, this, &DialogSeamAllowance::ShowContextMenu);
|
connect(ui->listWidget, &QListWidget::customContextMenuRequested, this, &DialogSeamAllowance::ShowContextMenu);
|
||||||
connect(ui->listWidget->model(), &QAbstractItemModel::rowsMoved, this, &DialogSeamAllowance::ListChanged);
|
connect(ui->listWidget->model(), &QAbstractItemModel::rowsMoved, this, &DialogSeamAllowance::ListChanged);
|
||||||
|
@ -91,6 +93,8 @@ void DialogSeamAllowance::SetPiece(const VPiece &piece)
|
||||||
NewItem(m_piece.at(i));
|
NewItem(m_piece.at(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui->checkBoxForbidFlipping->setChecked(m_piece.IsForbidFlipping());
|
||||||
|
|
||||||
ValidObjects(MainPathIsValid());
|
ValidObjects(MainPathIsValid());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,6 +264,8 @@ VPiece DialogSeamAllowance::CreatePiece() const
|
||||||
piece.Append(qvariant_cast<VPieceNode>(item->data(Qt::UserRole)));
|
piece.Append(qvariant_cast<VPieceNode>(item->data(Qt::UserRole)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
piece.SetForbidFlipping(ui->checkBoxForbidFlipping->isChecked());
|
||||||
|
|
||||||
return piece;
|
return piece;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,16 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBoxForbidFlipping">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Forbid piece be mirrored in a layout.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Forbid flipping</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QListWidget" name="listWidget">
|
<widget class="QListWidget" name="listWidget">
|
||||||
<property name="dragDropMode">
|
<property name="dragDropMode">
|
||||||
|
|
|
@ -59,8 +59,9 @@ const quint8 VToolSeamAllowance::pieceVersion = 2;
|
||||||
const QString VToolSeamAllowance::TagNodes = QStringLiteral("nodes");
|
const QString VToolSeamAllowance::TagNodes = QStringLiteral("nodes");
|
||||||
const QString VToolSeamAllowance::TagNode = QStringLiteral("node");
|
const QString VToolSeamAllowance::TagNode = QStringLiteral("node");
|
||||||
|
|
||||||
const QString VToolSeamAllowance::AttrVersion = QStringLiteral("version");
|
const QString VToolSeamAllowance::AttrVersion = QStringLiteral("version");
|
||||||
const QString VToolSeamAllowance::AttrNodeReverse = QStringLiteral("reverse");
|
const QString VToolSeamAllowance::AttrNodeReverse = QStringLiteral("reverse");
|
||||||
|
const QString VToolSeamAllowance::AttrForbidFlipping = QStringLiteral("forbidFlipping");
|
||||||
|
|
||||||
const QString VToolSeamAllowance::NodeArc = QStringLiteral("NodeArc");
|
const QString VToolSeamAllowance::NodeArc = QStringLiteral("NodeArc");
|
||||||
const QString VToolSeamAllowance::NodePoint = QStringLiteral("NodePoint");
|
const QString VToolSeamAllowance::NodePoint = QStringLiteral("NodePoint");
|
||||||
|
@ -252,6 +253,7 @@ void VToolSeamAllowance::AddAttributes(VAbstractPattern *doc, QDomElement &domEl
|
||||||
doc->SetAttribute(domElement, AttrMx, qApp->fromPixel(piece.GetMx()));
|
doc->SetAttribute(domElement, AttrMx, qApp->fromPixel(piece.GetMx()));
|
||||||
doc->SetAttribute(domElement, AttrMy, qApp->fromPixel(piece.GetMy()));
|
doc->SetAttribute(domElement, AttrMy, qApp->fromPixel(piece.GetMy()));
|
||||||
doc->SetAttribute(domElement, AttrInLayout, piece.IsInLayout());
|
doc->SetAttribute(domElement, AttrInLayout, piece.IsInLayout());
|
||||||
|
doc->SetAttribute(domElement, AttrForbidFlipping, static_cast<quint8>(piece.IsForbidFlipping()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -59,6 +59,7 @@ public:
|
||||||
|
|
||||||
static const QString AttrVersion;
|
static const QString AttrVersion;
|
||||||
static const QString AttrNodeReverse;
|
static const QString AttrNodeReverse;
|
||||||
|
static const QString AttrForbidFlipping;
|
||||||
|
|
||||||
static const QString NodeArc;
|
static const QString NodeArc;
|
||||||
static const QString NodePoint;
|
static const QString NodePoint;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user