New option "Seam line on drawing".
There are two ways to export a sew line to DXF-AAMA: on Draw layer or Sew line layer. The second is not standard, but preferable way for most CAD systems.
This commit is contained in:
parent
acc8d73271
commit
52c8e47e60
|
@ -468,6 +468,7 @@ void VPLayoutFileReader::ReadPiece(const VPPiecePtr &piece)
|
|||
piece->SetMirror(ReadAttributeBool(attribs, ML::AttrMirrored, falseStr));
|
||||
piece->SetForbidFlipping(ReadAttributeBool(attribs, ML::AttrForbidFlipping, falseStr));
|
||||
piece->SetForceFlipping(ReadAttributeBool(attribs, ML::AttrForceFlipping, falseStr));
|
||||
piece->SetSewLineOnDrawing(ReadAttributeBool(attribs, ML::AttrSewLineOnDrawing, falseStr));
|
||||
piece->SetMatrix(StringToTransfrom(ReadAttributeEmptyString(attribs, ML::AttrTransform)));
|
||||
|
||||
const QStringList tags
|
||||
|
|
|
@ -259,6 +259,8 @@ void VPLayoutFileWriter::WritePiece(const VPPiecePtr &piece)
|
|||
[](bool forbid) noexcept {return not forbid;});
|
||||
SetAttributeOrRemoveIf<bool>(ML::AttrForceFlipping, piece->IsForceFlipping(),
|
||||
[](bool force) noexcept {return not force;});
|
||||
SetAttributeOrRemoveIf<bool>(ML::AttrSewLineOnDrawing, piece->IsSewLineOnDrawing(),
|
||||
[](bool value) noexcept {return not value;});
|
||||
SetAttribute(ML::AttrTransform, TransformToString(piece->GetMatrix()));
|
||||
SetAttributeOrRemoveIf<QString>(ML::AttrGradationLabel, piece->GetGradationId(),
|
||||
[](const QString &label) noexcept {return label.isEmpty();});
|
||||
|
|
|
@ -80,6 +80,7 @@ const QString AttrID = QStringLiteral("id"); // NOLINT(cert-er
|
|||
const QString AttrMirrored = QStringLiteral("mirrored"); // NOLINT(cert-err58-cpp)
|
||||
const QString AttrForbidFlipping = QStringLiteral("forbidFlipping"); // NOLINT(cert-err58-cpp)
|
||||
const QString AttrForceFlipping = QStringLiteral("forceFlipping"); // NOLINT(cert-err58-cpp)
|
||||
const QString AttrSewLineOnDrawing = QStringLiteral("sewLineOnDrawing"); // NOLINT(cert-err58-cpp)
|
||||
const QString AttrTransform = QStringLiteral("transform"); // NOLINT(cert-err58-cpp)
|
||||
const QString AttrShowSeamline = QStringLiteral("showSeamline"); // NOLINT(cert-err58-cpp)
|
||||
const QString AttrEnabled = QStringLiteral("enabled"); // NOLINT(cert-err58-cpp)
|
||||
|
|
|
@ -85,6 +85,7 @@ extern const QString AttrID;
|
|||
extern const QString AttrMirrored;
|
||||
extern const QString AttrForbidFlipping;
|
||||
extern const QString AttrForceFlipping;
|
||||
extern const QString AttrSewLineOnDrawing;
|
||||
extern const QString AttrTransform;
|
||||
extern const QString AttrShowSeamline;
|
||||
extern const QString AttrEnabled;
|
||||
|
|
|
@ -108,6 +108,7 @@ PreferencesPatternPage::PreferencesPatternPage(QWidget *parent)
|
|||
InitLabelDateTimeFormats();
|
||||
|
||||
ui->forbidFlippingCheck->setChecked(settings->GetForbidWorkpieceFlipping());
|
||||
ui->checkBoxSewLineOnDrawing->setChecked(settings->GetSewLineOnDrawing());
|
||||
ui->doublePassmarkCheck->setChecked(settings->IsDoublePassmark());
|
||||
ui->checkBoxHideMainPath->setChecked(settings->IsHideMainPath());
|
||||
ui->fontComboBoxLabelFont->setCurrentFont(settings->GetLabelFont());
|
||||
|
@ -162,6 +163,7 @@ auto PreferencesPatternPage::Apply() -> QStringList
|
|||
settings->SetDefaultSeamAllowance(ui->defaultSeamAllowance->value());
|
||||
|
||||
settings->SetForbidWorkpieceFlipping(ui->forbidFlippingCheck->isChecked());
|
||||
settings->SetSewLineOnDrawing(ui->checkBoxSewLineOnDrawing->isChecked());
|
||||
settings->SetHideMainPath(ui->checkBoxHideMainPath->isChecked());
|
||||
settings->SetLabelFont(ui->fontComboBoxLabelFont->currentFont());
|
||||
|
||||
|
|
|
@ -196,6 +196,16 @@ This option will take an affect after restart.</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBoxSewLineOnDrawing">
|
||||
<property name="toolTip">
|
||||
<string>By default export to DXF-AAMA sew line on Draw layer for all new created workpieces</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Sew line on drawing</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="doublePassmarkCheck">
|
||||
<property name="toolTip">
|
||||
|
|
|
@ -946,6 +946,9 @@ void VPattern::ParseDetailElement(QDomElement &domElement, const Document &parse
|
|||
initData.detail.SetForceFlipping(GetParametrBool(domElement, AttrForceFlipping,
|
||||
QString().setNum(VAbstractValApplication::VApp()
|
||||
->ValentinaSettings()->GetForceWorkpieceFlipping())));
|
||||
initData.detail.SetSewLineOnDrawing(GetParametrBool(domElement, AttrSewLineOnDrawing,
|
||||
QString().setNum(VAbstractValApplication::VApp()
|
||||
->ValentinaSettings()->GetSewLineOnDrawing())));
|
||||
initData.detail.SetInLayout(GetParametrBool(domElement, AttrInLayout, trueStr));
|
||||
initData.detail.SetUnited(GetParametrBool(domElement, VToolSeamAllowance::AttrUnited, falseStr));
|
||||
initData.detail.SetPriority(GetParametrUInt(domElement, VToolSeamAllowance::AttrPiecePriority, QChar('0')));
|
||||
|
|
|
@ -126,6 +126,7 @@ const QString AttrIdObject = QStringLiteral("idObject");
|
|||
const QString AttrInLayout = QStringLiteral("inLayout");
|
||||
const QString AttrForbidFlipping = QStringLiteral("forbidFlipping");
|
||||
const QString AttrForceFlipping = QStringLiteral("forceFlipping");
|
||||
const QString AttrSewLineOnDrawing = QStringLiteral("sewLineOnDrawing");
|
||||
const QString AttrRotationAngle = QStringLiteral("rotationAngle");
|
||||
const QString AttrClosed = QStringLiteral("closed");
|
||||
const QString AttrShowLabel = QStringLiteral("showLabel");
|
||||
|
|
|
@ -146,6 +146,7 @@ extern const QString AttrIdObject;
|
|||
extern const QString AttrInLayout;
|
||||
extern const QString AttrForbidFlipping;
|
||||
extern const QString AttrForceFlipping;
|
||||
extern const QString AttrSewLineOnDrawing;
|
||||
extern const QString AttrClosed;
|
||||
extern const QString AttrShowLabel;
|
||||
extern const QString AttrShowLabel1;
|
||||
|
|
|
@ -220,6 +220,7 @@
|
|||
<xs:attribute type="xs:boolean" name="mirrored"/>
|
||||
<xs:attribute type="xs:boolean" name="forbidFlipping"/>
|
||||
<xs:attribute type="xs:boolean" name="forceFlipping"/>
|
||||
<xs:attribute type="xs:boolean" name="sewLineOnDrawing"/>
|
||||
<xs:attribute type="Transformation" name="transform"/>
|
||||
<xs:attribute type="xs:string" name="gradationLabel"/>
|
||||
<xs:attribute type="xs:unsignedInt" name="copyNumber"/>
|
||||
|
@ -413,6 +414,7 @@
|
|||
<xs:attribute type="xs:boolean" name="mirrored"/>
|
||||
<xs:attribute type="xs:boolean" name="forbidFlipping"/>
|
||||
<xs:attribute type="xs:boolean" name="forceFlipping"/>
|
||||
<xs:attribute type="xs:boolean" name="sewLineOnDrawing"/>
|
||||
<xs:attribute type="Transformation" name="transform"/>
|
||||
<xs:attribute type="xs:string" name="gradationLabel"/>
|
||||
<xs:attribute type="xs:unsignedInt" name="copyNumber"/>
|
||||
|
|
|
@ -751,6 +751,7 @@
|
|||
<xs:attribute name="bufferInLayout" type="xs:boolean"/>
|
||||
<xs:attribute name="forbidFlipping" type="xs:boolean"/>
|
||||
<xs:attribute name="forceFlipping" type="xs:boolean"/>
|
||||
<xs:attribute name="sewLineOnDrawing" type="xs:boolean"/>
|
||||
<xs:attribute name="width" type="xs:string"/>
|
||||
<xs:attribute name="bufferVisible" type="xs:string"/>
|
||||
<xs:attribute name="bufferWidth" type="xs:string"/>
|
||||
|
|
|
@ -760,7 +760,9 @@ void VDxfEngine::ExportAAMADraw(const QSharedPointer<dx_ifaceBlock> &detailBlock
|
|||
if (detail.IsSeamAllowance() && not detail.IsHideMainPath() && not detail.IsSeamAllowanceBuiltIn())
|
||||
{
|
||||
QVector<VLayoutPoint> points = detail.GetMappedContourPoints();
|
||||
if (DRW_Entity *e = AAMAPolygon(detail.GetMappedContourPoints(), *layer8, true))
|
||||
const UTF8STRING &layer = not detail.IsSewLineOnDrawing() ? *layer14 : *layer8;
|
||||
|
||||
if (DRW_Entity *e = AAMAPolygon(points, layer, true))
|
||||
{
|
||||
detailBlock->ent.push_back(e);
|
||||
}
|
||||
|
|
|
@ -1027,6 +1027,18 @@ void VAbstractPiece::SetHideMainPath(bool value)
|
|||
d->m_hideMainPath = value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool VAbstractPiece::IsSewLineOnDrawing() const
|
||||
{
|
||||
return d->m_onDrawing;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractPiece::SetSewLineOnDrawing(bool value)
|
||||
{
|
||||
d->m_onDrawing = value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VAbstractPiece::GetSAWidth() const -> qreal
|
||||
{
|
||||
|
|
|
@ -82,6 +82,9 @@ public:
|
|||
auto IsHideMainPath() const -> bool;
|
||||
void SetHideMainPath(bool value);
|
||||
|
||||
auto IsSewLineOnDrawing() const -> bool;
|
||||
void SetSewLineOnDrawing(bool value);
|
||||
|
||||
auto GetSAWidth() const -> qreal;
|
||||
void SetSAWidth(qreal value);
|
||||
|
||||
|
|
|
@ -72,12 +72,13 @@ public:
|
|||
qreal m_my{0}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
uint m_priority{0}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
QUuid m_uuid{QUuid::createUuid()}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool m_onDrawing{false}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(VAbstractPieceData) // NOLINT
|
||||
|
||||
static constexpr quint32 streamHeader = 0x05CDD73A; // CRC-32Q string "VAbstractPieceData"
|
||||
static constexpr quint16 classVersion = 3;
|
||||
static constexpr quint16 classVersion = 4;
|
||||
};
|
||||
|
||||
QT_WARNING_POP
|
||||
|
@ -105,6 +106,9 @@ inline auto operator<<(QDataStream &dataStream, const VAbstractPieceData &piece)
|
|||
// Added in classVersion = 3
|
||||
dataStream << piece.m_uuid;
|
||||
|
||||
// Added in classVersion = 4
|
||||
dataStream << piece.m_onDrawing;
|
||||
|
||||
return dataStream;
|
||||
}
|
||||
|
||||
|
@ -154,6 +158,11 @@ inline auto operator>>(QDataStream &dataStream, VAbstractPieceData &piece) -> QD
|
|||
dataStream >> piece.m_uuid;
|
||||
}
|
||||
|
||||
if (actualClassVersion >= 4)
|
||||
{
|
||||
dataStream >> piece.m_onDrawing;
|
||||
}
|
||||
|
||||
return dataStream;
|
||||
}
|
||||
|
||||
|
|
|
@ -640,6 +640,7 @@ auto VLayoutPiece::Create(const VPiece &piece, vidtype id, const VContainer *pat
|
|||
det.SetSAWidth(VAbstractValApplication::VApp()->toPixel(piece.GetSAWidth()));
|
||||
det.SetForbidFlipping(piece.IsForbidFlipping());
|
||||
det.SetForceFlipping(piece.IsForceFlipping());
|
||||
det.SetSewLineOnDrawing(piece.IsSewLineOnDrawing());
|
||||
det.SetId(id);
|
||||
|
||||
if (not futureSeamAllowanceValid.result())
|
||||
|
|
|
@ -96,6 +96,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationDontUseNativeDialog
|
|||
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternUndo, (QLatin1String("pattern/undo"))) // NOLINT
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternForbidFlipping, (QLatin1String("pattern/forbidFlipping"))) // NOLINT
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternForceFlipping, (QLatin1String("pattern/forceFlipping"))) // NOLINT
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternSewLineOnDrawing, (QLatin1String("pattern/sewLineOnDrawing"))) // NOLINT
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternHideMainPath, (QLatin1String("pattern/hideMainPath"))) // NOLINT
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingDoublePassmark, (QLatin1String("pattern/doublePassmark"))) // NOLINT
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternDefaultSeamAllowance, (QLatin1String("pattern/defaultSeamAllowance"))) // NOLINT
|
||||
|
@ -922,6 +923,18 @@ void VCommonSettings::SetForceWorkpieceFlipping(bool value)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VCommonSettings::GetSewLineOnDrawing() const -> bool
|
||||
{
|
||||
return value(*settingPatternSewLineOnDrawing, false).toBool();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VCommonSettings::SetSewLineOnDrawing(bool value)
|
||||
{
|
||||
setValue(*settingPatternSewLineOnDrawing, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VCommonSettings::IsHideMainPath() const -> bool
|
||||
{
|
||||
|
|
|
@ -179,6 +179,9 @@ public:
|
|||
auto GetForceWorkpieceFlipping() const -> bool;
|
||||
void SetForceWorkpieceFlipping(bool value);
|
||||
|
||||
auto GetSewLineOnDrawing() const -> bool;
|
||||
void SetSewLineOnDrawing(bool value);
|
||||
|
||||
auto IsHideMainPath() const -> bool;
|
||||
void SetHideMainPath(bool value);
|
||||
|
||||
|
|
|
@ -350,6 +350,7 @@ void DialogSeamAllowance::SetPiece(const VPiece &piece)
|
|||
|
||||
uiTabPaths->checkBoxForbidFlipping->setChecked(piece.IsForbidFlipping());
|
||||
uiTabPaths->checkBoxForceFlipping->setChecked(piece.IsForceFlipping());
|
||||
uiTabPaths->checkBoxOnDrawing->setChecked(piece.IsSewLineOnDrawing());
|
||||
uiTabPaths->checkBoxSeams->setChecked(piece.IsSeamAllowance());
|
||||
uiTabPaths->checkBoxBuiltIn->setChecked(piece.IsSeamAllowanceBuiltIn());
|
||||
uiTabPaths->lineEditName->setText(piece.GetName());
|
||||
|
@ -2591,6 +2592,7 @@ VPiece DialogSeamAllowance::CreatePiece() const
|
|||
piece.SetPlaceLabels(GetListInternals<quint32>(uiTabPlaceLabels->listWidgetPlaceLabels));
|
||||
piece.SetForbidFlipping(uiTabPaths->checkBoxForbidFlipping->isChecked());
|
||||
piece.SetForceFlipping(uiTabPaths->checkBoxForceFlipping->isChecked());
|
||||
piece.SetSewLineOnDrawing(uiTabPaths->checkBoxOnDrawing->isChecked());
|
||||
piece.SetSeamAllowance(uiTabPaths->checkBoxSeams->isChecked());
|
||||
piece.SetSeamAllowanceBuiltIn(uiTabPaths->checkBoxBuiltIn->isChecked());
|
||||
piece.SetHideMainPath(uiTabPaths->checkBoxHideMainPath->isChecked());
|
||||
|
@ -3045,10 +3047,10 @@ void DialogSeamAllowance::InitPieceTab()
|
|||
}
|
||||
});
|
||||
|
||||
uiTabPaths->checkBoxForbidFlipping->setChecked(
|
||||
VAbstractApplication::VApp()->Settings()->GetForbidWorkpieceFlipping());
|
||||
uiTabPaths->checkBoxForceFlipping->setChecked(
|
||||
VAbstractApplication::VApp()->Settings()->GetForceWorkpieceFlipping());
|
||||
VCommonSettings *settings = VAbstractApplication::VApp()->Settings();
|
||||
uiTabPaths->checkBoxForbidFlipping->setChecked(settings->GetForbidWorkpieceFlipping());
|
||||
uiTabPaths->checkBoxForceFlipping->setChecked(settings->GetForceWorkpieceFlipping());
|
||||
uiTabPaths->checkBoxOnDrawing->setChecked(settings->GetSewLineOnDrawing());
|
||||
|
||||
connect(uiTabPaths->lineEditUUID, &QLineEdit::textChanged, this, &DialogSeamAllowance::DetailUUIDChanged);
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>422</width>
|
||||
<height>624</height>
|
||||
<width>427</width>
|
||||
<height>651</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -28,8 +28,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>394</width>
|
||||
<height>612</height>
|
||||
<width>407</width>
|
||||
<height>631</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
|
@ -83,6 +83,16 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBoxOnDrawing">
|
||||
<property name="toolTip">
|
||||
<string>Export to DXF-AAMA sew line on Draw layer </string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>On drawing</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="listWidgetMainPath">
|
||||
<property name="dragDropMode">
|
||||
|
@ -1127,16 +1137,16 @@
|
|||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>VPlainTextEdit</class>
|
||||
<extends>QPlainTextEdit</extends>
|
||||
<header location="global">vplaintextedit.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>VLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>vlineedit.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>VPlainTextEdit</class>
|
||||
<extends>QPlainTextEdit</extends>
|
||||
<header>vplaintextedit.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../../../../../vmisc/share/resources/icon.qrc"/>
|
||||
|
|
|
@ -361,6 +361,7 @@ void VToolSeamAllowance::AddAttributes(VAbstractPattern *doc, QDomElement &domEl
|
|||
[](bool inLayout) noexcept {return inLayout;});
|
||||
doc->SetAttribute(domElement, AttrForbidFlipping, piece.IsForbidFlipping());
|
||||
doc->SetAttribute(domElement, AttrForceFlipping, piece.IsForceFlipping());
|
||||
doc->SetAttribute(domElement, AttrSewLineOnDrawing, piece.IsSewLineOnDrawing());
|
||||
doc->SetAttributeOrRemoveIf<bool>(domElement, AttrSeamAllowance, piece.IsSeamAllowance(),
|
||||
[](bool seamAllowance) noexcept {return not seamAllowance;});
|
||||
doc->SetAttribute(domElement, AttrHideMainPath, piece.IsHideMainPath());
|
||||
|
|
Loading…
Reference in New Issue
Block a user