diff --git a/ChangeLog.txt b/ChangeLog.txt index 8f5f95723..0872f0e62 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,6 +1,7 @@ # Version 0.6.0 - [#682] New feature. Export increments to Excel .csv. - [#681] Enhance feature: Dashed line options for curves, arcs, etc. +- [#684] Proposal: Add option to only show outer edges on detail. # Version 0.5.1 - [#683] Tool Seam allowance's dialog is off screen on small resolutions. diff --git a/src/app/valentina/dialogs/configpages/preferencespatternpage.cpp b/src/app/valentina/dialogs/configpages/preferencespatternpage.cpp index 2cf9578ad..16c3a19fc 100644 --- a/src/app/valentina/dialogs/configpages/preferencespatternpage.cpp +++ b/src/app/valentina/dialogs/configpages/preferencespatternpage.cpp @@ -54,6 +54,7 @@ PreferencesPatternPage::PreferencesPatternPage(QWidget *parent) ui->forbidFlippingCheck->setChecked(qApp->ValentinaSettings()->GetForbidWorkpieceFlipping()); ui->doublePassmarkCheck->setChecked(qApp->ValentinaSettings()->IsDoublePassmark()); + ui->checkBoxHideMainPath->setChecked(qApp->ValentinaSettings()->IsHideMainPath()); } //--------------------------------------------------------------------------------------------------------------------- @@ -79,6 +80,7 @@ void PreferencesPatternPage::Apply() settings->SetUndoCount(ui->undoCount->value()); settings->SetForbidWorkpieceFlipping(ui->forbidFlippingCheck->isChecked()); + settings->SetHideMainPath(ui->checkBoxHideMainPath->isChecked()); if (settings->IsDoublePassmark() != ui->doublePassmarkCheck->isChecked()) { diff --git a/src/app/valentina/dialogs/configpages/preferencespatternpage.ui b/src/app/valentina/dialogs/configpages/preferencespatternpage.ui index f972ae8ed..403b37069 100644 --- a/src/app/valentina/dialogs/configpages/preferencespatternpage.ui +++ b/src/app/valentina/dialogs/configpages/preferencespatternpage.ui @@ -123,6 +123,16 @@ + + + + By default hide the main path if the seam allowance was enabled + + + Hide main path + + + diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 9341efddd..2baf87b64 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -703,6 +703,8 @@ void VPattern::ParseDetailElement(QDomElement &domElement, const Document &parse detail.SetMx(qApp->toPixel(GetParametrDouble(domElement, AttrMx, "0.0"))); detail.SetMy(qApp->toPixel(GetParametrDouble(domElement, AttrMy, "0.0"))); detail.SetSeamAllowance(GetParametrBool(domElement, VToolSeamAllowance::AttrSeamAllowance, falseStr)); + detail.SetHideMainPath(GetParametrBool(domElement, VToolSeamAllowance::AttrHideMainPath, + QString().setNum(qApp->ValentinaSettings()->IsHideMainPath()))); detail.SetSeamAllowanceBuiltIn(GetParametrBool(domElement, VToolSeamAllowance::AttrSeamAllowanceBuiltIn, falseStr)); detail.SetForbidFlipping(GetParametrBool(domElement, VToolSeamAllowance::AttrForbidFlipping, diff --git a/src/libs/ifc/schema/pattern/v0.5.0.xsd b/src/libs/ifc/schema/pattern/v0.5.0.xsd index 59865fb36..723834aff 100644 --- a/src/libs/ifc/schema/pattern/v0.5.0.xsd +++ b/src/libs/ifc/schema/pattern/v0.5.0.xsd @@ -609,6 +609,7 @@ + diff --git a/src/libs/vlayout/vabstractpiece.cpp b/src/libs/vlayout/vabstractpiece.cpp index c49a1781c..b90804175 100644 --- a/src/libs/vlayout/vabstractpiece.cpp +++ b/src/libs/vlayout/vabstractpiece.cpp @@ -111,6 +111,18 @@ void VAbstractPiece::SetSeamAllowanceBuiltIn(bool value) d->m_seamAllowanceBuiltIn = value; } +//--------------------------------------------------------------------------------------------------------------------- +bool VAbstractPiece::IsHideMainPath() const +{ + return d->m_hideMainPath; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractPiece::SetHideMainPath(bool value) +{ + d->m_hideMainPath = value; +} + //--------------------------------------------------------------------------------------------------------------------- qreal VAbstractPiece::GetSAWidth() const { diff --git a/src/libs/vlayout/vabstractpiece.h b/src/libs/vlayout/vabstractpiece.h index 2bfc21ca4..71e45e50c 100644 --- a/src/libs/vlayout/vabstractpiece.h +++ b/src/libs/vlayout/vabstractpiece.h @@ -164,6 +164,9 @@ public: bool IsSeamAllowanceBuiltIn() const; void SetSeamAllowanceBuiltIn(bool value); + bool IsHideMainPath() const; + void SetHideMainPath(bool value); + qreal GetSAWidth() const; void SetSAWidth(qreal value); diff --git a/src/libs/vlayout/vabstractpiece_p.h b/src/libs/vlayout/vabstractpiece_p.h index 933fef8cf..5b36f82c0 100644 --- a/src/libs/vlayout/vabstractpiece_p.h +++ b/src/libs/vlayout/vabstractpiece_p.h @@ -47,6 +47,7 @@ public: m_forbidFlipping(false), m_seamAllowance(false), m_seamAllowanceBuiltIn(false), + m_hideMainPath(false), m_width(0) {} @@ -56,6 +57,7 @@ public: m_forbidFlipping(piece.m_forbidFlipping), m_seamAllowance(piece.m_seamAllowance), m_seamAllowanceBuiltIn(piece.m_seamAllowanceBuiltIn), + m_hideMainPath(piece.m_hideMainPath), m_width(piece.m_width) {} @@ -66,6 +68,7 @@ public: bool m_forbidFlipping; bool m_seamAllowance; bool m_seamAllowanceBuiltIn; + bool m_hideMainPath; qreal m_width; private: diff --git a/src/libs/vlayout/vlayoutpiece.cpp b/src/libs/vlayout/vlayoutpiece.cpp index 2ffb1fb27..78c61f12c 100644 --- a/src/libs/vlayout/vlayoutpiece.cpp +++ b/src/libs/vlayout/vlayoutpiece.cpp @@ -382,7 +382,7 @@ VLayoutPiece::~VLayoutPiece() VLayoutPiece VLayoutPiece::Create(const VPiece &piece, const VContainer *pattern) { VLayoutPiece det; - det.SetCountourPoints(piece.MainPathPoints(pattern)); + det.SetCountourPoints(piece.MainPathPoints(pattern), piece.IsHideMainPath()); det.SetSeamAllowancePoints(piece.SeamAllowancePoints(pattern), piece.IsSeamAllowance(), piece.IsSeamAllowanceBuiltIn()); det.SetInternalPaths(ConvertInternalPaths(piece, pattern)); @@ -429,9 +429,10 @@ QVector VLayoutPiece::GetContourPoints() const } //--------------------------------------------------------------------------------------------------------------------- -void VLayoutPiece::SetCountourPoints(const QVector &points) +void VLayoutPiece::SetCountourPoints(const QVector &points, bool hideMainPath) { d->contour = RemoveDublicates(RoundPoints(points), false); + SetHideMainPath(hideMainPath); } //--------------------------------------------------------------------------------------------------------------------- @@ -862,12 +863,16 @@ QPainterPath VLayoutPiece::ContourPath() const // contour QVector points = GetContourPoints(); - path.moveTo(points.at(0)); - for (qint32 i = 1; i < points.count(); ++i) + + if (not IsHideMainPath() || not IsSeamAllowance() || IsSeamAllowanceBuiltIn()) { - path.lineTo(points.at(i)); + path.moveTo(points.at(0)); + for (qint32 i = 1; i < points.count(); ++i) + { + path.lineTo(points.at(i)); + } + path.lineTo(points.at(0)); } - path.lineTo(points.at(0)); // seam allowance if (IsSeamAllowance()) diff --git a/src/libs/vlayout/vlayoutpiece.h b/src/libs/vlayout/vlayoutpiece.h index 9f37428ce..f64de592e 100644 --- a/src/libs/vlayout/vlayoutpiece.h +++ b/src/libs/vlayout/vlayoutpiece.h @@ -73,7 +73,7 @@ public: static VLayoutPiece Create(const VPiece &piece, const VContainer *pattern); QVector GetContourPoints() const; - void SetCountourPoints(const QVector &points); + void SetCountourPoints(const QVector &points, bool hideMainPath = false); QVector GetSeamAllowancePoints() const; void SetSeamAllowancePoints(const QVector &points, bool seamAllowance = true, diff --git a/src/libs/vmisc/vcommonsettings.cpp b/src/libs/vmisc/vcommonsettings.cpp index 47ee673fa..cddd6a77a 100644 --- a/src/libs/vmisc/vcommonsettings.cpp +++ b/src/libs/vmisc/vcommonsettings.cpp @@ -61,6 +61,7 @@ const QString settingConfigurationToolBarStyle = QStringLiteral("confi const QString settingPatternUser = QStringLiteral("pattern/user"); const QString settingPatternUndo = QStringLiteral("pattern/undo"); const QString settingPatternForbidFlipping = QStringLiteral("pattern/forbidFlipping"); +const QString settingPatternHideMainPath = QStringLiteral("pattern/hideMainPath"); const QString settingDoublePassmark = QStringLiteral("pattern/doublePassmark"); const QString settingGeneralRecentFileList = QStringLiteral("recentFileList"); @@ -606,6 +607,18 @@ void VCommonSettings::SetForbidWorkpieceFlipping(bool value) setValue(settingPatternForbidFlipping, value); } +//--------------------------------------------------------------------------------------------------------------------- +bool VCommonSettings::IsHideMainPath() const +{ + return value(settingPatternHideMainPath, false).toBool(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VCommonSettings::SetHideMainPath(bool value) +{ + setValue(settingPatternHideMainPath, value); +} + //--------------------------------------------------------------------------------------------------------------------- bool VCommonSettings::IsDoublePassmark() const { diff --git a/src/libs/vmisc/vcommonsettings.h b/src/libs/vmisc/vcommonsettings.h index c2062df19..c2185293a 100644 --- a/src/libs/vmisc/vcommonsettings.h +++ b/src/libs/vmisc/vcommonsettings.h @@ -133,6 +133,9 @@ public: bool GetForbidWorkpieceFlipping() const; void SetForbidWorkpieceFlipping(bool value); + bool IsHideMainPath() const; + void SetHideMainPath(bool value); + bool IsDoublePassmark() const; void SetDoublePassmark(bool value); diff --git a/src/libs/vpatterndb/vpiece.cpp b/src/libs/vpatterndb/vpiece.cpp index d5fc46c57..c5bdec7b3 100644 --- a/src/libs/vpatterndb/vpiece.cpp +++ b/src/libs/vpatterndb/vpiece.cpp @@ -1105,6 +1105,7 @@ QVector VPiece::CreatePassmark(const QVector &path, int prev QVector lines; lines += SAPassmark(path, previousSAPoint, passmarkSAPoint, nextSAPoint, data, passmarkIndex); if (qApp->Settings()->IsDoublePassmark() + && not IsHideMainPath() && path.at(passmarkIndex).IsMainPathNode() && path.at(passmarkIndex).GetPassmarkAngleType() != PassmarkAngleType::Intersection && path.at(passmarkIndex).IsShowSecondPassmark()) diff --git a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp index 80d6c0b4e..225a0e5e3 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp @@ -200,6 +200,7 @@ void DialogSeamAllowance::SetPiece(const VPiece &piece) NewMainPathItem(piece.GetPath().at(i)); } + uiTabPaths->checkBoxHideMainPath->setChecked(piece.IsHideMainPath()); uiTabPaths->listWidgetCustomSA->blockSignals(true); uiTabPaths->listWidgetCustomSA->clear(); for (int i = 0; i < piece.GetCustomSARecords().size(); ++i) @@ -2079,6 +2080,7 @@ VPiece DialogSeamAllowance::CreatePiece() const piece.SetForbidFlipping(uiTabPaths->checkBoxForbidFlipping->isChecked()); piece.SetSeamAllowance(uiTabPaths->checkBoxSeams->isChecked()); piece.SetSeamAllowanceBuiltIn(uiTabPaths->checkBoxBuiltIn->isChecked()); + piece.SetHideMainPath(uiTabPaths->checkBoxHideMainPath->isChecked()); piece.SetName(uiTabLabels->lineEditName->text()); piece.SetMx(m_mx); piece.SetMy(m_my); diff --git a/src/libs/vtools/dialogs/tools/piece/tabs/tabpaths.ui b/src/libs/vtools/dialogs/tools/piece/tabs/tabpaths.ui index 6f237f911..7de6b5f19 100644 --- a/src/libs/vtools/dialogs/tools/piece/tabs/tabpaths.ui +++ b/src/libs/vtools/dialogs/tools/piece/tabs/tabpaths.ui @@ -83,6 +83,16 @@ + + + + Hide the main path if the seam allowance is enabled + + + Hide main path + + + diff --git a/src/libs/vtools/tools/vtoolseamallowance.cpp b/src/libs/vtools/tools/vtoolseamallowance.cpp index f79f7469c..c7e07b7e7 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.cpp +++ b/src/libs/vtools/tools/vtoolseamallowance.cpp @@ -73,6 +73,7 @@ const QString VToolSeamAllowance::TagPins = QStringLiteral("pins"); const QString VToolSeamAllowance::AttrVersion = QStringLiteral("version"); const QString VToolSeamAllowance::AttrForbidFlipping = QStringLiteral("forbidFlipping"); const QString VToolSeamAllowance::AttrSeamAllowance = QStringLiteral("seamAllowance"); +const QString VToolSeamAllowance::AttrHideMainPath = QStringLiteral("hideMainPath"); const QString VToolSeamAllowance::AttrSeamAllowanceBuiltIn = QStringLiteral("seamAllowanceBuiltIn"); const QString VToolSeamAllowance::AttrHeight = QStringLiteral("height"); const QString VToolSeamAllowance::AttrUnited = QStringLiteral("united"); @@ -218,6 +219,7 @@ void VToolSeamAllowance::AddAttributes(VAbstractPattern *doc, QDomElement &domEl doc->SetAttribute(domElement, AttrInLayout, piece.IsInLayout()); doc->SetAttribute(domElement, AttrForbidFlipping, piece.IsForbidFlipping()); doc->SetAttribute(domElement, AttrSeamAllowance, piece.IsSeamAllowance()); + doc->SetAttribute(domElement, AttrHideMainPath, piece.IsHideMainPath()); const bool saBuiltIn = piece.IsSeamAllowanceBuiltIn(); if (saBuiltIn) @@ -1164,7 +1166,17 @@ void VToolSeamAllowance::RefreshGeometry() this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, false); const VPiece detail = VAbstractTool::data.GetPiece(id); - QPainterPath path = detail.MainPathPath(this->getData()); + QPainterPath path; + + if (not detail.IsHideMainPath() || not detail.IsSeamAllowance() || detail.IsSeamAllowanceBuiltIn()) + { + m_seamAllowance->setBrush(QBrush(Qt::Dense7Pattern)); + path = detail.MainPathPath(this->getData()); + } + else + { + m_seamAllowance->setBrush(QBrush(Qt::NoBrush)); // Disable if the main path was hidden + } { QPainterPath mainPath = path; diff --git a/src/libs/vtools/tools/vtoolseamallowance.h b/src/libs/vtools/tools/vtoolseamallowance.h index 280244cda..7733a2824 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.h +++ b/src/libs/vtools/tools/vtoolseamallowance.h @@ -63,6 +63,7 @@ public: static const QString AttrVersion; static const QString AttrForbidFlipping; static const QString AttrSeamAllowance; + static const QString AttrHideMainPath; static const QString AttrSeamAllowanceBuiltIn; static const QString AttrHeight; static const QString AttrUnited;