Resolved issue #652. Show passmarks for builtin seam allowance.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-04-05 13:22:33 +03:00
parent 4cd09e54e4
commit c0f36dffbe
28 changed files with 1319 additions and 66 deletions

View file

@ -31,6 +31,8 @@
#include "../../core/vapplication.h"
#include "../vmisc/vsettings.h"
#include "../vwidgets/vmaingraphicsview.h"
#include "../ifc/xml/vabstractpattern.h"
#include <QGroupBox>
#include <QLabel>
#include <QSettings>
@ -56,7 +58,8 @@ PatternPage::PatternPage(QWidget *parent):
userMaterialsGroup(nullptr),
userMaterialClearButton(nullptr),
workpieceGroup(nullptr),
forbidFlippingCheck(nullptr)
forbidFlippingCheck(nullptr),
doublePassmarkCheck(nullptr)
{
QGroupBox *userGroup = UserGroup();
QGroupBox *graphOutputGroup = GraphOutputGroup();
@ -91,6 +94,12 @@ void PatternPage::Apply()
settings->SetUndoCount(undoCount->value());
settings->SetForbidWorkpieceFlipping(forbidFlippingCheck->isChecked());
if (settings->IsDoublePassmark() != doublePassmarkCheck->isChecked())
{
settings->SetDoublePassmark(doublePassmarkCheck->isChecked());
qApp->getCurrentDocument()->LiteParseTree(Document::LiteParse);
}
}
//---------------------------------------------------------------------------------------------------------------------
@ -198,8 +207,13 @@ QGroupBox *PatternPage::UserWorkpieceGroup()
forbidFlippingCheck->setToolTip(tr("By default forbid flipping for all new created workpieces"));
forbidFlippingCheck->setChecked(qApp->ValentinaSettings()->GetForbidWorkpieceFlipping());
doublePassmarkCheck = new QCheckBox(tr("Show second passmark on seam line"));
doublePassmarkCheck->setToolTip(tr("Show a passmark both in the seam allowance and on the seam line."));
doublePassmarkCheck->setChecked(qApp->ValentinaSettings()->IsDoublePassmark());
QVBoxLayout *editLayout = new QVBoxLayout;
editLayout->addWidget(forbidFlippingCheck);
editLayout->addWidget(doublePassmarkCheck);
workpieceGroup->setLayout(editLayout);
return workpieceGroup;
@ -210,8 +224,19 @@ void PatternPage::RetranslateUi()
{
userGroup->setTitle(tr("User"));
userNameLabel->setText(tr("User name:"));
graphOutputGroup->setTitle(tr("Graphical output"));
graphOutputCheck->setText(tr("Use antialiasing"));
undoGroup->setTitle(tr("Undo"));
countStepsLabel->setText(tr("Count steps (0 - no limit):"));
userMaterialsGroup->setTitle(tr("User defined materials"));
userMaterialClearButton->setText(tr("Delete all"));
workpieceGroup->setTitle(tr("Workpiece"));
forbidFlippingCheck->setText(tr("Forbid flipping"));
forbidFlippingCheck->setToolTip(tr("By default forbid flipping for all new created workpieces"));
doublePassmarkCheck->setText(tr("Show second passmark on seam line"));
doublePassmarkCheck->setToolTip(tr("Show a passmark both in the seam allowance and on the seam line."));
}

View file

@ -63,6 +63,7 @@ private:
QPushButton* userMaterialClearButton;
QGroupBox *workpieceGroup;
QCheckBox *forbidFlippingCheck;
QCheckBox *doublePassmarkCheck;
QGroupBox *UserGroup() Q_REQUIRED_RESULT;
QGroupBox *GraphOutputGroup() Q_REQUIRED_RESULT;

View file

@ -21,7 +21,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
<number>3</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">

View file

@ -4253,6 +4253,7 @@ void MainWindow::Preferences()
connect(dlg.data(), &ConfigDialog::UpdateProperties, this, &MainWindow::WindowsLocale); // Must be first
connect(dlg.data(), &ConfigDialog::UpdateProperties, toolOptions, &VToolOptionsPropertyBrowser::RefreshOptions);
connect(dlg.data(), &ConfigDialog::UpdateProperties, this, &MainWindow::ToolBarStyles);
if (guard->exec() == QDialog::Accepted)
{
InitAutoSave();

View file

@ -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.SetSeamAllowanceBuiltIn(GetParametrBool(domElement, VToolSeamAllowance::AttrSeamAllowanceBuiltIn,
falseStr));
detail.SetForbidFlipping(GetParametrBool(domElement, VToolSeamAllowance::AttrForbidFlipping,
QString().setNum(qApp->ValentinaSettings()->GetForbidWorkpieceFlipping())));
detail.SetInLayout(GetParametrBool(domElement, AttrInLayout, trueStr));

View file

@ -30,6 +30,7 @@
<file>schema/pattern/v0.4.4.xsd</file>
<file>schema/pattern/v0.4.5.xsd</file>
<file>schema/pattern/v0.4.6.xsd</file>
<file>schema/pattern/v0.4.7.xsd</file>
<file>schema/standard_measurements/v0.3.0.xsd</file>
<file>schema/standard_measurements/v0.4.0.xsd</file>
<file>schema/standard_measurements/v0.4.1.xsd</file>

View file

@ -0,0 +1,902 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<!-- XML Schema Generated from XML Document-->
<xs:element name="pattern">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="version" type="formatVersion"/>
<xs:element name="unit" type="units"/>
<xs:element name="image" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="extension" type="imageExtension"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="author" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="notes" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="gradation" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="heights">
<xs:complexType>
<xs:attribute name="all" type="xs:boolean" use="required"/>
<xs:attribute name="h50" type="xs:boolean"/>
<xs:attribute name="h56" type="xs:boolean"/>
<xs:attribute name="h62" type="xs:boolean"/>
<xs:attribute name="h68" type="xs:boolean"/>
<xs:attribute name="h74" type="xs:boolean"/>
<xs:attribute name="h80" type="xs:boolean"/>
<xs:attribute name="h86" type="xs:boolean"/>
<xs:attribute name="h92" type="xs:boolean"/>
<xs:attribute name="h98" type="xs:boolean"/>
<xs:attribute name="h104" type="xs:boolean"/>
<xs:attribute name="h110" type="xs:boolean"/>
<xs:attribute name="h116" type="xs:boolean"/>
<xs:attribute name="h122" type="xs:boolean"/>
<xs:attribute name="h128" type="xs:boolean"/>
<xs:attribute name="h134" type="xs:boolean"/>
<xs:attribute name="h140" type="xs:boolean"/>
<xs:attribute name="h146" type="xs:boolean"/>
<xs:attribute name="h152" type="xs:boolean"/>
<xs:attribute name="h158" type="xs:boolean"/>
<xs:attribute name="h164" type="xs:boolean"/>
<xs:attribute name="h170" type="xs:boolean"/>
<xs:attribute name="h176" type="xs:boolean"/>
<xs:attribute name="h182" type="xs:boolean"/>
<xs:attribute name="h188" type="xs:boolean"/>
<xs:attribute name="h194" type="xs:boolean"/>
<xs:attribute name="h200" type="xs:boolean"/>
</xs:complexType>
</xs:element>
<xs:element name="sizes">
<xs:complexType>
<xs:attribute name="all" type="xs:boolean" use="required"/>
<xs:attribute name="s22" type="xs:boolean"/>
<xs:attribute name="s24" type="xs:boolean"/>
<xs:attribute name="s26" type="xs:boolean"/>
<xs:attribute name="s28" type="xs:boolean"/>
<xs:attribute name="s30" type="xs:boolean"/>
<xs:attribute name="s32" type="xs:boolean"/>
<xs:attribute name="s34" type="xs:boolean"/>
<xs:attribute name="s36" type="xs:boolean"/>
<xs:attribute name="s38" type="xs:boolean"/>
<xs:attribute name="s40" type="xs:boolean"/>
<xs:attribute name="s42" type="xs:boolean"/>
<xs:attribute name="s44" type="xs:boolean"/>
<xs:attribute name="s46" type="xs:boolean"/>
<xs:attribute name="s48" type="xs:boolean"/>
<xs:attribute name="s50" type="xs:boolean"/>
<xs:attribute name="s52" type="xs:boolean"/>
<xs:attribute name="s54" type="xs:boolean"/>
<xs:attribute name="s56" type="xs:boolean"/>
<xs:attribute name="s58" type="xs:boolean"/>
<xs:attribute name="s60" type="xs:boolean"/>
<xs:attribute name="s62" type="xs:boolean"/>
<xs:attribute name="s64" type="xs:boolean"/>
<xs:attribute name="s66" type="xs:boolean"/>
<xs:attribute name="s68" type="xs:boolean"/>
<xs:attribute name="s70" type="xs:boolean"/>
<xs:attribute name="s72" type="xs:boolean"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="custom" type="xs:boolean"/>
<xs:attribute name="defHeight" type="baseHeight"/>
<xs:attribute name="defSize" type="baseSize"/>
</xs:complexType>
</xs:element>
<xs:element name="patternName" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="patternNumber" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="company" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="customer" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="size" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="showDate" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
<xs:element name="showMeasurements" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
<xs:element name="measurements" type="xs:string"/>
<xs:element name="increments" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="increment" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="description" type="xs:string" use="required"/>
<xs:attribute name="name" type="shortName" use="required"/>
<xs:attribute name="formula" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:unique name="incrementName">
<xs:selector xpath="increment"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
<xs:element name="draw" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="calculation" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="point" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="id" type="xs:unsignedInt" use="required"/>
<xs:attribute name="x" type="xs:double"/>
<xs:attribute name="y" type="xs:double"/>
<xs:attribute name="mx" type="xs:double"/>
<xs:attribute name="my" type="xs:double"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="name" type="shortName"/>
<xs:attribute name="firstPoint" type="xs:unsignedInt"/>
<xs:attribute name="secondPoint" type="xs:unsignedInt"/>
<xs:attribute name="thirdPoint" type="xs:unsignedInt"/>
<xs:attribute name="basePoint" type="xs:unsignedInt"/>
<xs:attribute name="pShoulder" type="xs:unsignedInt"/>
<xs:attribute name="p1Line" type="xs:unsignedInt"/>
<xs:attribute name="p2Line" type="xs:unsignedInt"/>
<xs:attribute name="length" type="xs:string"/>
<xs:attribute name="angle" type="xs:string"/>
<xs:attribute name="typeLine" type="xs:string"/>
<xs:attribute name="splinePath" type="xs:unsignedInt"/>
<xs:attribute name="spline" type="xs:unsignedInt"/>
<xs:attribute name="p1Line1" type="xs:unsignedInt"/>
<xs:attribute name="p1Line2" type="xs:unsignedInt"/>
<xs:attribute name="p2Line1" type="xs:unsignedInt"/>
<xs:attribute name="p2Line2" type="xs:unsignedInt"/>
<xs:attribute name="center" type="xs:unsignedInt"/>
<xs:attribute name="radius" type="xs:string"/>
<xs:attribute name="axisP1" type="xs:unsignedInt"/>
<xs:attribute name="axisP2" type="xs:unsignedInt"/>
<xs:attribute name="arc" type="xs:unsignedInt"/>
<xs:attribute name="elArc" type="xs:unsignedInt"/>
<xs:attribute name="curve" type="xs:unsignedInt"/>
<xs:attribute name="curve1" type="xs:unsignedInt"/>
<xs:attribute name="curve2" type="xs:unsignedInt"/>
<xs:attribute name="lineColor" type="colors"/>
<xs:attribute name="color" type="colors"/>
<xs:attribute name="firstArc" type="xs:unsignedInt"/>
<xs:attribute name="secondArc" type="xs:unsignedInt"/>
<xs:attribute name="crossPoint" type="crossType"/>
<xs:attribute name="vCrossPoint" type="crossType"/>
<xs:attribute name="hCrossPoint" type="crossType"/>
<xs:attribute name="c1Center" type="xs:unsignedInt"/>
<xs:attribute name="c2Center" type="xs:unsignedInt"/>
<xs:attribute name="c1Radius" type="xs:string"/>
<xs:attribute name="c2Radius" type="xs:string"/>
<xs:attribute name="cRadius" type="xs:string"/>
<xs:attribute name="tangent" type="xs:unsignedInt"/>
<xs:attribute name="cCenter" type="xs:unsignedInt"/>
<xs:attribute name="name1" type="shortName"/>
<xs:attribute name="mx1" type="xs:double"/>
<xs:attribute name="my1" type="xs:double"/>
<xs:attribute name="name2" type="shortName"/>
<xs:attribute name="mx2" type="xs:double"/>
<xs:attribute name="my2" type="xs:double"/>
<xs:attribute name="point1" type="xs:unsignedInt"/>
<xs:attribute name="point2" type="xs:unsignedInt"/>
<xs:attribute name="dartP1" type="xs:unsignedInt"/>
<xs:attribute name="dartP2" type="xs:unsignedInt"/>
<xs:attribute name="dartP3" type="xs:unsignedInt"/>
<xs:attribute name="baseLineP1" type="xs:unsignedInt"/>
<xs:attribute name="baseLineP2" type="xs:unsignedInt"/>
</xs:complexType>
</xs:element>
<xs:element name="line" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="id" type="xs:unsignedInt" use="required"/>
<xs:attribute name="firstPoint" type="xs:unsignedInt"/>
<xs:attribute name="secondPoint" type="xs:unsignedInt"/>
<xs:attribute name="typeLine" type="xs:string"/>
<xs:attribute name="lineColor" type="colors"/>
</xs:complexType>
</xs:element>
<xs:element name="operation" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="source" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="item" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="idObject" type="xs:unsignedInt" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="destination" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="item" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="idObject" type="xs:unsignedInt" use="required"/>
<xs:attribute name="mx" type="xs:double"/>
<xs:attribute name="my" type="xs:double"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:unsignedInt" use="required"/>
<xs:attribute name="center" type="xs:unsignedInt"/>
<xs:attribute name="angle" type="xs:string"/>
<xs:attribute name="length" type="xs:string"/>
<xs:attribute name="suffix" type="xs:string"/>
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute name="p1Line" type="xs:unsignedInt"/>
<xs:attribute name="p2Line" type="xs:unsignedInt"/>
<xs:attribute name="axisType" type="axisType"/>
</xs:complexType>
</xs:element>
<xs:element name="arc" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="angle1" type="xs:string"/>
<xs:attribute name="id" type="xs:unsignedInt" use="required"/>
<xs:attribute name="angle2" type="xs:string"/>
<xs:attribute name="radius" type="xs:string"/>
<xs:attribute name="center" type="xs:unsignedInt"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="color" type="colors"/>
<xs:attribute name="length" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="elArc" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="angle1" type="xs:string"/>
<xs:attribute name="id" type="xs:unsignedInt" use="required"/>
<xs:attribute name="angle2" type="xs:string"/>
<xs:attribute name="rotationAngle" type="xs:string"/>
<xs:attribute name="radius1" type="xs:string"/>
<xs:attribute name="radius2" type="xs:string"/>
<xs:attribute name="center" type="xs:unsignedInt"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="color" type="colors"/>
<xs:attribute name="length" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="spline" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="pathPoint" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="kAsm2" type="xs:string"/>
<xs:attribute name="pSpline" type="xs:unsignedInt"/>
<xs:attribute name="angle" type="xs:string"/>
<xs:attribute name="angle1" type="xs:string"/>
<xs:attribute name="angle2" type="xs:string"/>
<xs:attribute name="length1" type="xs:string"/>
<xs:attribute name="length2" type="xs:string"/>
<xs:attribute name="kAsm1" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:unsignedInt" use="required"/>
<xs:attribute name="kCurve" type="xs:double"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="kAsm1" type="xs:double"/>
<xs:attribute name="kAsm2" type="xs:double"/>
<xs:attribute name="angle1" type="xs:string"/>
<xs:attribute name="angle2" type="xs:string"/>
<xs:attribute name="length1" type="xs:string"/>
<xs:attribute name="length2" type="xs:string"/>
<xs:attribute name="point1" type="xs:unsignedInt"/>
<xs:attribute name="point2" type="xs:unsignedInt"/>
<xs:attribute name="point3" type="xs:unsignedInt"/>
<xs:attribute name="point4" type="xs:unsignedInt"/>
<xs:attribute name="color" type="colors"/>
<xs:attribute name="duplicate" type="xs:unsignedInt"/>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="modeling" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="point" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="id" type="xs:unsignedInt" use="required"/>
<xs:attribute name="idObject" type="xs:unsignedInt"/>
<xs:attribute name="mx" type="xs:double"/>
<xs:attribute name="my" type="xs:double"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="idTool" type="xs:unsignedInt"/>
<xs:attribute name="inUse" type="xs:boolean"/>
</xs:complexType>
</xs:element>
<xs:element name="arc" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="id" type="xs:unsignedInt" use="required"/>
<xs:attribute name="idObject" type="xs:unsignedInt"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="idTool" type="xs:unsignedInt"/>
<xs:attribute name="inUse" type="xs:boolean"/>
</xs:complexType>
</xs:element>
<xs:element name="elArc" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="id" type="xs:unsignedInt" use="required"/>
<xs:attribute name="idObject" type="xs:unsignedInt"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="idTool" type="xs:unsignedInt"/>
<xs:attribute name="inUse" type="xs:boolean"/>
</xs:complexType>
</xs:element>
<xs:element name="spline" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="id" type="xs:unsignedInt" use="required"/>
<xs:attribute name="idObject" type="xs:unsignedInt"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="idTool" type="xs:unsignedInt"/>
<xs:attribute name="inUse" type="xs:boolean"/>
</xs:complexType>
</xs:element>
<xs:element name="path" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="nodes" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="node" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute name="idObject" type="xs:unsignedInt" use="required"/>
<xs:attribute name="reverse" type="xs:unsignedInt"/>
<xs:attribute name="excluded" type="xs:boolean"/>
<xs:attribute name="before" type="xs:double"/>
<xs:attribute name="after" type="xs:double"/>
<xs:attribute name="angle" type="nodeAngle"/>
<xs:attribute name="passmark" type="xs:boolean"/>
<xs:attribute name="passmarkLine" type="passmarkLineType"/>
<xs:attribute name="passmarkAngle" type="passmarkAngleType"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:unsignedInt" use="required"/>
<xs:attribute name="type" type="piecePathType"/>
<xs:attribute name="idTool" type="xs:unsignedInt"/>
<xs:attribute name="inUse" type="xs:boolean"/>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="typeLine" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="tools" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="det" minOccurs="2" maxOccurs="2">
<xs:complexType>
<xs:sequence>
<xs:element name="nodes" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="node" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute name="idObject" type="xs:unsignedInt" use="required"/>
<xs:attribute name="reverse" type="xs:unsignedInt"/>
<xs:attribute name="excluded" type="xs:boolean"/>
<xs:attribute name="before" type="xs:string"/>
<xs:attribute name="after" type="xs:string"/>
<xs:attribute name="angle" type="nodeAngle"/>
<xs:attribute name="passmark" type="xs:boolean"/>
<xs:attribute name="passmarkLine" type="passmarkLineType"/>
<xs:attribute name="passmarkAngle" type="passmarkAngleType"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="csa" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="record" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="start" type="xs:unsignedInt"/>
<xs:attribute name="path" type="xs:unsignedInt" use="required"/>
<xs:attribute name="end" type="xs:unsignedInt"/>
<xs:attribute name="reverse" type="xs:boolean"/>
<xs:attribute name="includeAs" type="piecePathIncludeType"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="iPaths" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="record" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="path" type="xs:unsignedInt" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="pins" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="record" type="xs:unsignedInt" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="children" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="nodes" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="child" type="xs:unsignedInt" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="csa" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="child" type="xs:unsignedInt" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="iPaths" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="child" type="xs:unsignedInt" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="pins" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="child" type="xs:unsignedInt" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:unsignedInt" use="required"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="indexD1" type="xs:unsignedInt"/>
<xs:attribute name="indexD2" type="xs:unsignedInt"/>
<xs:attribute name="inUse" type="xs:boolean"/>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="details" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="detail" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="data" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="mcp" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="cutNumber" type="xs:unsignedInt"/>
<xs:attribute name="userDef" type="xs:string"/>
<xs:attribute name="material" type="materialType"/>
<xs:attribute name="placement" type="placementType"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="letter" type="xs:string"/>
<xs:attribute name="visible" type="xs:boolean"/>
<xs:attribute name="fontSize" type="xs:unsignedInt"/>
<xs:attribute name="mx" type="xs:double"/>
<xs:attribute name="my" type="xs:double"/>
<xs:attribute name="width" type="xs:string"/>
<xs:attribute name="height" type="xs:string"/>
<xs:attribute name="rotation" type="xs:string"/>
<xs:attribute name="centerPin" type="xs:unsignedInt"/>
<xs:attribute name="topLeftPin" type="xs:unsignedInt"/>
<xs:attribute name="bottomRightPin" type="xs:unsignedInt"/>
</xs:complexType>
</xs:element>
<xs:element name="patternInfo" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="visible" type="xs:boolean"/>
<xs:attribute name="fontSize" type="xs:unsignedInt"/>
<xs:attribute name="mx" type="xs:double"/>
<xs:attribute name="my" type="xs:double"/>
<xs:attribute name="width" type="xs:string"/>
<xs:attribute name="height" type="xs:string"/>
<xs:attribute name="rotation" type="xs:string"/>
<xs:attribute name="centerPin" type="xs:unsignedInt"/>
<xs:attribute name="topLeftPin" type="xs:unsignedInt"/>
<xs:attribute name="bottomRightPin" type="xs:unsignedInt"/>
</xs:complexType>
</xs:element>
<xs:element name="grainline" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="visible" type="xs:boolean"/>
<xs:attribute name="mx" type="xs:double"/>
<xs:attribute name="my" type="xs:double"/>
<xs:attribute name="length" type="xs:string"/>
<xs:attribute name="rotation" type="xs:string"/>
<xs:attribute name="arrows" type="arrowType"/>
<xs:attribute name="centerPin" type="xs:unsignedInt"/>
<xs:attribute name="topPin" type="xs:unsignedInt"/>
<xs:attribute name="bottomPin" type="xs:unsignedInt"/>
</xs:complexType>
</xs:element>
<xs:element name="nodes" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="node" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute name="idObject" type="xs:unsignedInt" use="required"/>
<xs:attribute name="reverse" type="xs:unsignedInt"/>
<xs:attribute name="excluded" type="xs:boolean"/>
<xs:attribute name="before" type="xs:string"/>
<xs:attribute name="after" type="xs:string"/>
<xs:attribute name="angle" type="nodeAngle"/>
<xs:attribute name="mx" type="xs:double"/>
<xs:attribute name="my" type="xs:double"/>
<xs:attribute name="passmark" type="xs:boolean"/>
<xs:attribute name="passmarkLine" type="passmarkLineType"/>
<xs:attribute name="passmarkAngle" type="passmarkAngleType"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="csa" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="record" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="start" type="xs:unsignedInt"/>
<xs:attribute name="path" type="xs:unsignedInt" use="required"/>
<xs:attribute name="end" type="xs:unsignedInt"/>
<xs:attribute name="reverse" type="xs:boolean"/>
<xs:attribute name="includeAs" type="piecePathIncludeType"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="iPaths" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="record" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="path" type="xs:unsignedInt" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="pins" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="record" type="xs:unsignedInt" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:unsignedInt" use="required"/>
<xs:attribute name="version" type="pieceVersion"/>
<xs:attribute name="mx" type="xs:double"/>
<xs:attribute name="my" type="xs:double"/>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="inLayout" type="xs:boolean"/>
<xs:attribute name="forbidFlipping" type="xs:boolean"/>
<xs:attribute name="width" type="xs:string"/>
<xs:attribute name="seamAllowance" type="xs:boolean"/>
<xs:attribute name="seamAllowanceBuiltIn" type="xs:boolean"/>
<xs:attribute name="united" type="xs:boolean"/>
<xs:attribute name="closed" type="xs:unsignedInt"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="groups" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="group" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="item" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="object" type="xs:unsignedInt"/>
<xs:attribute name="tool" type="xs:unsignedInt"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:unsignedInt" use="required"/>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="visible" type="xs:boolean"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="readOnly" type="xs:boolean"/>
</xs:complexType>
</xs:element>
<xs:simpleType name="shortName">
<xs:restriction base="xs:string">
<xs:pattern value="^([^\p{Nd}\p{Zs}*/&amp;|!&lt;&gt;^\-()+=?:;'\&quot;]){1,1}([^\p{Zs}*/&amp;|!&lt;&gt;^\-()+=?:;\&quot;]){0,}$"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="units">
<xs:restriction base="xs:string">
<xs:enumeration value="mm"/>
<xs:enumeration value="cm"/>
<xs:enumeration value="inch"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="measurementsTypes">
<xs:restriction base="xs:string">
<xs:enumeration value="standard"/>
<xs:enumeration value="individual"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="formatVersion">
<xs:restriction base="xs:string">
<xs:pattern value="^(0|([1-9][0-9]*))\.(0|([1-9][0-9]*))\.(0|([1-9][0-9]*))$"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="imageExtension">
<xs:restriction base="xs:string">
<xs:enumeration value="PNG"/>
<xs:enumeration value="JPG"/>
<xs:enumeration value="BMP"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="colors">
<xs:restriction base="xs:string">
<xs:enumeration value="black"/>
<xs:enumeration value="green"/>
<xs:enumeration value="blue"/>
<xs:enumeration value="darkRed"/>
<xs:enumeration value="darkGreen"/>
<xs:enumeration value="darkBlue"/>
<xs:enumeration value="yellow"/>
<xs:enumeration value="lightsalmon"/>
<xs:enumeration value="goldenrod"/>
<xs:enumeration value="orange"/>
<xs:enumeration value="deeppink"/>
<xs:enumeration value="violet"/>
<xs:enumeration value="darkviolet"/>
<xs:enumeration value="mediumseagreen"/>
<xs:enumeration value="lime"/>
<xs:enumeration value="deepskyblue"/>
<xs:enumeration value="cornflowerblue"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="baseHeight">
<xs:restriction base="xs:unsignedInt">
<xs:enumeration value="50"/>
<xs:enumeration value="56"/>
<xs:enumeration value="62"/>
<xs:enumeration value="68"/>
<xs:enumeration value="74"/>
<xs:enumeration value="80"/>
<xs:enumeration value="86"/>
<xs:enumeration value="92"/>
<xs:enumeration value="98"/>
<xs:enumeration value="104"/>
<xs:enumeration value="110"/>
<xs:enumeration value="116"/>
<xs:enumeration value="122"/>
<xs:enumeration value="128"/>
<xs:enumeration value="134"/>
<xs:enumeration value="140"/>
<xs:enumeration value="146"/>
<xs:enumeration value="152"/>
<xs:enumeration value="158"/>
<xs:enumeration value="164"/>
<xs:enumeration value="170"/>
<xs:enumeration value="176"/>
<xs:enumeration value="182"/>
<xs:enumeration value="188"/>
<xs:enumeration value="194"/>
<xs:enumeration value="200"/>
<xs:enumeration value="500"/>
<xs:enumeration value="560"/>
<xs:enumeration value="620"/>
<xs:enumeration value="680"/>
<xs:enumeration value="740"/>
<xs:enumeration value="800"/>
<xs:enumeration value="860"/>
<xs:enumeration value="920"/>
<xs:enumeration value="980"/>
<xs:enumeration value="1040"/>
<xs:enumeration value="1100"/>
<xs:enumeration value="1160"/>
<xs:enumeration value="1220"/>
<xs:enumeration value="1280"/>
<xs:enumeration value="1340"/>
<xs:enumeration value="1400"/>
<xs:enumeration value="1460"/>
<xs:enumeration value="1520"/>
<xs:enumeration value="1580"/>
<xs:enumeration value="1640"/>
<xs:enumeration value="1700"/>
<xs:enumeration value="1760"/>
<xs:enumeration value="1820"/>
<xs:enumeration value="1880"/>
<xs:enumeration value="1940"/>
<xs:enumeration value="2000"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="baseSize">
<xs:restriction base="xs:unsignedInt">
<xs:enumeration value="22"/>
<xs:enumeration value="24"/>
<xs:enumeration value="26"/>
<xs:enumeration value="28"/>
<xs:enumeration value="30"/>
<xs:enumeration value="32"/>
<xs:enumeration value="34"/>
<xs:enumeration value="36"/>
<xs:enumeration value="38"/>
<xs:enumeration value="40"/>
<xs:enumeration value="42"/>
<xs:enumeration value="44"/>
<xs:enumeration value="46"/>
<xs:enumeration value="48"/>
<xs:enumeration value="50"/>
<xs:enumeration value="52"/>
<xs:enumeration value="54"/>
<xs:enumeration value="56"/>
<xs:enumeration value="58"/>
<xs:enumeration value="60"/>
<xs:enumeration value="62"/>
<xs:enumeration value="64"/>
<xs:enumeration value="66"/>
<xs:enumeration value="68"/>
<xs:enumeration value="70"/>
<xs:enumeration value="72"/>
<xs:enumeration value="220"/>
<xs:enumeration value="240"/>
<xs:enumeration value="260"/>
<xs:enumeration value="280"/>
<xs:enumeration value="300"/>
<xs:enumeration value="320"/>
<xs:enumeration value="340"/>
<xs:enumeration value="360"/>
<xs:enumeration value="380"/>
<xs:enumeration value="400"/>
<xs:enumeration value="420"/>
<xs:enumeration value="440"/>
<xs:enumeration value="460"/>
<xs:enumeration value="480"/>
<xs:enumeration value="500"/>
<xs:enumeration value="520"/>
<xs:enumeration value="540"/>
<xs:enumeration value="560"/>
<xs:enumeration value="580"/>
<xs:enumeration value="600"/>
<xs:enumeration value="620"/>
<xs:enumeration value="640"/>
<xs:enumeration value="660"/>
<xs:enumeration value="680"/>
<xs:enumeration value="700"/>
<xs:enumeration value="720"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="crossType">
<xs:restriction base="xs:unsignedInt">
<xs:enumeration value="1"/>
<xs:enumeration value="2"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="axisType">
<xs:restriction base="xs:unsignedInt">
<xs:enumeration value="1"/>
<xs:enumeration value="2"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="materialType">
<xs:restriction base="xs:unsignedInt">
<xs:enumeration value="0"/>
<!--Fabric-->
<xs:enumeration value="1"/>
<!--Lining-->
<xs:enumeration value="2"/>
<!--Interfacing-->
<xs:enumeration value="3"/>
<!--Interlining-->
<xs:enumeration value="4"/>
<!--UserDefined-->
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="placementType">
<xs:restriction base="xs:unsignedInt">
<xs:enumeration value="0"/>
<!--No placement-->
<xs:enumeration value="1"/>
<!--Cut on Fold-->
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="arrowType">
<xs:restriction base="xs:unsignedInt">
<xs:enumeration value="0"/>
<!--Both-->
<xs:enumeration value="1"/>
<!--Front-->
<xs:enumeration value="2"/>
<!--Rear-->
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="pieceVersion">
<xs:restriction base="xs:unsignedInt">
<xs:enumeration value="1"/>
<!--Old version-->
<xs:enumeration value="2"/>
<!--New version-->
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="nodeAngle">
<xs:restriction base="xs:unsignedInt">
<xs:enumeration value="0"/>
<!--by length-->
<xs:enumeration value="1"/>
<!--by points intersections-->
<xs:enumeration value="2"/>
<!--by second edge symmetry-->
<xs:enumeration value="3"/>
<!--by first edge symmetry-->
<xs:enumeration value="4"/>
<!--by first edge right angle-->
<xs:enumeration value="5"/>
<!--by first edge right angle-->
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="piecePathType">
<xs:restriction base="xs:unsignedInt">
<xs:enumeration value="1"/>
<!--custom seam allowance-->
<xs:enumeration value="2"/>
<!--internal path-->
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="piecePathIncludeType">
<xs:restriction base="xs:unsignedInt">
<xs:enumeration value="0"/>
<!--as main path-->
<xs:enumeration value="1"/>
<!--as custom seam allowance-->
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="passmarkLineType">
<xs:restriction base="xs:string">
<xs:enumeration value="one"/>
<xs:enumeration value="two"/>
<xs:enumeration value="three"/>
<xs:enumeration value="tMark"/>
<xs:enumeration value="vMark"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="passmarkAngleType">
<xs:restriction base="xs:string">
<xs:enumeration value="straightforward"/>
<xs:enumeration value="bisector"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>

View file

@ -58,8 +58,8 @@ class QDomElement;
*/
const QString VPatternConverter::PatternMinVerStr = QStringLiteral("0.1.0");
const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.4.6");
const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.4.6.xsd");
const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.4.7");
const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.4.7.xsd");
//VPatternConverter::PatternMinVer; // <== DON'T FORGET TO UPDATE TOO!!!!
//VPatternConverter::PatternMaxVer; // <== DON'T FORGET TO UPDATE TOO!!!!
@ -207,6 +207,8 @@ QString VPatternConverter::XSDSchema(int ver) const
case (0x000405):
return QStringLiteral("://schema/pattern/v0.4.5.xsd");
case (0x000406):
return QStringLiteral("://schema/pattern/v0.4.6.xsd");
case (0x000407):
return CurrentSchema;
default:
InvalidVersion(ver);
@ -337,6 +339,10 @@ void VPatternConverter::ApplyPatches()
ValidateXML(XSDSchema(0x000406), m_convertedFileName);
V_FALLTHROUGH
case (0x000406):
ToV0_4_7();
ValidateXML(XSDSchema(0x000407), m_convertedFileName);
V_FALLTHROUGH
case (0x000407):
break;
default:
InvalidVersion(m_ver);
@ -355,7 +361,7 @@ void VPatternConverter::DowngradeToCurrentMaxVersion()
bool VPatternConverter::IsReadOnly() const
{
// Check if attribute readOnly was not changed in file format
Q_STATIC_ASSERT_X(VPatternConverter::PatternMaxVer == CONVERTER_VERSION_CHECK(0, 4, 6),
Q_STATIC_ASSERT_X(VPatternConverter::PatternMaxVer == CONVERTER_VERSION_CHECK(0, 4, 7),
"Check attribute readOnly.");
// Possibly in future attribute readOnly will change position etc.
@ -704,6 +710,16 @@ void VPatternConverter::ToV0_4_6()
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_4_7()
{
// TODO. Delete if minimal supported version is 0.4.7
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < CONVERTER_VERSION_CHECK(0, 4, 7),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.4.7"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::TagUnitToV0_2_0()
{

View file

@ -55,10 +55,10 @@ public:
// GCC 4.6 doesn't allow constexpr and const together
#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) <= 406
static Q_DECL_CONSTEXPR int PatternMinVer = CONVERTER_VERSION_CHECK(0, 1, 0);
static Q_DECL_CONSTEXPR int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 4, 6);
static Q_DECL_CONSTEXPR int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 4, 7);
#else
static Q_DECL_CONSTEXPR const int PatternMinVer = CONVERTER_VERSION_CHECK(0, 1, 0);
static Q_DECL_CONSTEXPR const int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 4, 6);
static Q_DECL_CONSTEXPR const int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 4, 7);
#endif
protected:
@ -107,6 +107,7 @@ private:
void ToV0_4_4();
void ToV0_4_5();
void ToV0_4_6();
void ToV0_4_7();
void TagUnitToV0_2_0();
void TagIncrementToV0_2_0();

View file

@ -99,6 +99,18 @@ void VAbstractPiece::SetSeamAllowance(bool value)
d->m_seamAllowance = value;
}
//---------------------------------------------------------------------------------------------------------------------
bool VAbstractPiece::IsSeamAllowanceBuiltIn() const
{
return d->m_seamAllowanceBuiltIn;
}
//---------------------------------------------------------------------------------------------------------------------
void VAbstractPiece::SetSeamAllowanceBuiltIn(bool value)
{
d->m_seamAllowanceBuiltIn = value;
}
//---------------------------------------------------------------------------------------------------------------------
qreal VAbstractPiece::GetSAWidth() const
{

View file

@ -152,6 +152,9 @@ public:
bool IsSeamAllowance() const;
void SetSeamAllowance(bool value);
bool IsSeamAllowanceBuiltIn() const;
void SetSeamAllowanceBuiltIn(bool value);
qreal GetSAWidth() const;
void SetSAWidth(qreal value);

View file

@ -46,6 +46,7 @@ public:
: m_name(tr("Detail")),
m_forbidFlipping(false),
m_seamAllowance(false),
m_seamAllowanceBuiltIn(false),
m_width(0)
{}
@ -54,6 +55,7 @@ public:
m_name(piece.m_name),
m_forbidFlipping(piece.m_forbidFlipping),
m_seamAllowance(piece.m_seamAllowance),
m_seamAllowanceBuiltIn(piece.m_seamAllowanceBuiltIn),
m_width(piece.m_width)
{}
@ -63,6 +65,7 @@ public:
/** @brief forbidFlipping forbid piece be mirrored in a layout. */
bool m_forbidFlipping;
bool m_seamAllowance;
bool m_seamAllowanceBuiltIn;
qreal m_width;
private:

View file

@ -383,7 +383,8 @@ VLayoutPiece VLayoutPiece::Create(const VPiece &piece, const VContainer *pattern
{
VLayoutPiece det;
det.SetCountourPoints(piece.MainPathPoints(pattern));
det.SetSeamAllowancePoints(piece.SeamAllowancePoints(pattern), piece.IsSeamAllowance());
det.SetSeamAllowancePoints(piece.SeamAllowancePoints(pattern), piece.IsSeamAllowance(),
piece.IsSeamAllowanceBuiltIn());
det.SetInternalPaths(ConvertInternalPaths(piece, pattern));
det.SetPassmarks(piece.PassmarksLines(pattern));
@ -441,17 +442,18 @@ QVector<QPointF> VLayoutPiece::GetSeamAllowancePoints() const
}
//---------------------------------------------------------------------------------------------------------------------
void VLayoutPiece::SetSeamAllowancePoints(const QVector<QPointF> &points, bool seamAllowance)
void VLayoutPiece::SetSeamAllowancePoints(const QVector<QPointF> &points, bool seamAllowance, bool seamAllowanceBuiltIn)
{
if (seamAllowance)
{
SetSeamAllowance(seamAllowance);
SetSeamAllowanceBuiltIn(seamAllowanceBuiltIn);
d->seamAllowance = points;
if (not d->seamAllowance.isEmpty())
{
d->seamAllowance = RemoveDublicates(RoundPoints(d->seamAllowance), false);
}
else
else if (not IsSeamAllowanceBuiltIn())
{
qWarning()<<"Seam allowance is empty.";
SetSeamAllowance(false);
@ -706,7 +708,7 @@ int VLayoutPiece::LayoutEdgeByPoint(const QPointF &p1) const
QRectF VLayoutPiece::DetailBoundingRect() const
{
QVector<QPointF> points;
if (IsSeamAllowance())
if (IsSeamAllowance() && not IsSeamAllowanceBuiltIn())
{
points = GetSeamAllowancePoints();
}
@ -739,7 +741,7 @@ bool VLayoutPiece::isNull() const
{
if (d->contour.isEmpty() == false && d->layoutWidth > 0)
{
if (IsSeamAllowance() && d->seamAllowance.isEmpty() == false)
if (IsSeamAllowance() && not IsSeamAllowanceBuiltIn() && d->seamAllowance.isEmpty() == false)
{
return false;
}
@ -773,7 +775,7 @@ void VLayoutPiece::SetLayoutAllowancePoints()
{
if (d->layoutWidth > 0)
{
if (IsSeamAllowance())
if (IsSeamAllowance() && not IsSeamAllowanceBuiltIn())
{
d->layoutAllowance = Equidistant(PrepareAllowance(GetSeamAllowancePoints()), d->layoutWidth);
if (d->layoutAllowance.isEmpty() == false)
@ -868,24 +870,27 @@ QPainterPath VLayoutPiece::ContourPath() const
path.lineTo(points.at(0));
// seam allowance
if (IsSeamAllowance() == true)
if (IsSeamAllowance())
{
// Draw seam allowance
points = GetSeamAllowancePoints();
if (points.last().toPoint() != points.first().toPoint())
if (not IsSeamAllowanceBuiltIn())
{
points.append(points.at(0));// Should be always closed
}
// Draw seam allowance
points = GetSeamAllowancePoints();
QPainterPath ekv;
ekv.moveTo(points.at(0));
for (qint32 i = 1; i < points.count(); ++i)
{
ekv.lineTo(points.at(i));
}
if (points.last().toPoint() != points.first().toPoint())
{
points.append(points.at(0));// Should be always closed
}
path.addPath(ekv);
QPainterPath ekv;
ekv.moveTo(points.at(0));
for (qint32 i = 1; i < points.count(); ++i)
{
ekv.lineTo(points.at(i));
}
path.addPath(ekv);
}
// Draw passmarks
const QVector<QLineF> passmarks = GetPassmarks();
@ -973,7 +978,7 @@ void VLayoutPiece::CreateGrainlineItem(QGraphicsItem *parent) const
//---------------------------------------------------------------------------------------------------------------------
QVector<QPointF> VLayoutPiece::DetailPath() const
{
if (IsSeamAllowance())
if (IsSeamAllowance() && not IsSeamAllowanceBuiltIn())
{
return d->seamAllowance;
}

View file

@ -68,7 +68,8 @@ public:
void SetCountourPoints(const QVector<QPointF> &points);
QVector<QPointF> GetSeamAllowancePoints() const;
void SetSeamAllowancePoints(const QVector<QPointF> &points, bool seamAllowance = true);
void SetSeamAllowancePoints(const QVector<QPointF> &points, bool seamAllowance = true,
bool seamAllowanceBuiltIn = false);
QVector<QPointF> GetLayoutAllowancePoints() const;
void SetLayoutAllowancePoints();

View file

@ -2026,6 +2026,8 @@ void InitHighDpiScaling(int argc, char *argv[])
const QString strOne = QStringLiteral("one");
const QString strTwo = QStringLiteral("two");
const QString strThree = QStringLiteral("three");
const QString strTMark = QStringLiteral("tMark");
const QString strVMark = QStringLiteral("vMark");
//---------------------------------------------------------------------------------------------------------------------
QString PassmarkLineTypeToString(PassmarkLineType type)
@ -2038,6 +2040,10 @@ QString PassmarkLineTypeToString(PassmarkLineType type)
return strTwo;
case PassmarkLineType::ThreeLines:
return strThree;
case PassmarkLineType::TMark:
return strTMark;
case PassmarkLineType::VMark:
return strVMark;
default:
break;
}
@ -2048,16 +2054,20 @@ QString PassmarkLineTypeToString(PassmarkLineType type)
//---------------------------------------------------------------------------------------------------------------------
PassmarkLineType StringToPassmarkLineType(const QString &value)
{
const QStringList values = QStringList() << strOne << strTwo << strThree;
const QStringList values = QStringList() << strOne << strTwo << strThree << strTMark << strVMark;
switch(values.indexOf(value))
{
case 0:
case 0: // strOne
return PassmarkLineType::OneLine;
case 1:
case 1: // strTwo
return PassmarkLineType::TwoLines;
case 2:
case 2: // strThree
return PassmarkLineType::ThreeLines;
case 3: // strTMark
return PassmarkLineType::TMark;
case 4: // strVMark
return PassmarkLineType::VMark;
default:
break;
}

View file

@ -93,7 +93,9 @@ enum class PassmarkLineType : unsigned char
{
OneLine = 0, // Default
TwoLines,
ThreeLines
ThreeLines,
TMark,
VMark
};
QString PassmarkLineTypeToString(PassmarkLineType type);

View file

@ -60,6 +60,7 @@ const QString VCommonSettings::SettingConfigurationToolBarStyle = QString
const QString VCommonSettings::SettingPatternUser = QStringLiteral("pattern/user");
const QString VCommonSettings::SettingPatternUndo = QStringLiteral("pattern/undo");
const QString VCommonSettings::SettingPatternForbidFlipping = QStringLiteral("pattern/forbidFlipping");
const QString VCommonSettings::SettingDoublePassmark = QStringLiteral("pattern/doublePassmark");
const QString VCommonSettings::SettingGeneralRecentFileList = QStringLiteral("recentFileList");
const QString VCommonSettings::SettingGeneralRestoreFileList = QStringLiteral("restoreFileList");
@ -587,3 +588,15 @@ void VCommonSettings::SetForbidWorkpieceFlipping(bool value)
{
setValue(SettingPatternForbidFlipping, value);
}
//---------------------------------------------------------------------------------------------------------------------
bool VCommonSettings::IsDoublePassmark() const
{
return value(SettingDoublePassmark, false).toBool();
}
//---------------------------------------------------------------------------------------------------------------------
void VCommonSettings::SetDoublePassmark(bool value)
{
setValue(SettingDoublePassmark, value);
}

View file

@ -130,6 +130,9 @@ public:
bool GetForbidWorkpieceFlipping() const;
void SetForbidWorkpieceFlipping(bool value);
bool IsDoublePassmark() const;
void SetDoublePassmark(bool value);
#if !defined(Q_OS_WIN)
static const QString unixStandardSharePath;
#endif
@ -154,6 +157,7 @@ private:
static const QString SettingPatternUser;
static const QString SettingPatternUndo;
static const QString SettingPatternForbidFlipping;
static const QString SettingDoublePassmark;
static const QString SettingGeneralRecentFileList;
static const QString SettingGeneralRestoreFileList;

View file

@ -31,11 +31,15 @@
#include "../vgeometry/vpointf.h"
#include "../vgeometry/vabstractcurve.h"
#include "vcontainer.h"
#include "../vmisc/vabstractapplication.h"
#include <QSharedPointer>
#include <QDebug>
#include <QPainterPath>
const qreal passmarkFactor = 0.5;
const qreal maxPassmarkLength = (10/*mm*/ / 25.4) * PrintDPI;
namespace
{
QVector<quint32> PieceMissingNodes(const QVector<quint32> &d1Nodes, const QVector<quint32> &d2Nodes)
@ -152,6 +156,93 @@ QVector<QLineF> CreateThreePassmarkLines(const QLineF &line)
return lines;
}
//---------------------------------------------------------------------------------------------------------------------
QVector<QLineF> CreateTMarkPassmark(const QLineF &line)
{
QPointF p1;
{
QLineF tmpLine = QLineF(line.p2(), line.p1());
tmpLine.setAngle(tmpLine.angle() - 90);
tmpLine.setLength(line.length() * 0.75 / 2);
p1 = tmpLine.p2();
}
QPointF p2;
{
QLineF tmpLine = QLineF(line.p2(), line.p1());
tmpLine.setAngle(tmpLine.angle() + 90);
tmpLine.setLength(line.length() * 0.75 / 2);
p2 = tmpLine.p2();
}
QVector<QLineF> lines;
lines.append(line);
lines.append(QLineF(p1, p2));
return lines;
}
//---------------------------------------------------------------------------------------------------------------------
QVector<QLineF> CreateVMarkPassmark(const QLineF &line)
{
QLineF l1 = line;
l1.setAngle(l1.angle() - 35);
QLineF l2 = line;
l2.setAngle(l2.angle() + 35);
QVector<QLineF> lines;
lines.append(l1);
lines.append(l2);
return lines;
}
//---------------------------------------------------------------------------------------------------------------------
QVector<QLineF> CreatePassmarkLines(PassmarkLineType lineType, PassmarkAngleType angleType, const QLineF &line)
{
QVector<QLineF> passmarksLines;
if (angleType == PassmarkAngleType::Straightforward)
{
switch (lineType)
{
case PassmarkLineType::TwoLines:
passmarksLines += CreateTwoPassmarkLines(line);
break;
case PassmarkLineType::ThreeLines:
passmarksLines += CreateThreePassmarkLines(line);
break;
case PassmarkLineType::TMark:
passmarksLines += CreateTMarkPassmark(line);
break;
case PassmarkLineType::VMark:
passmarksLines += CreateVMarkPassmark(line);
break;
case PassmarkLineType::OneLine:
default:
passmarksLines.append(line);
break;
}
}
else
{
switch (lineType)
{
case PassmarkLineType::TMark:
passmarksLines += CreateTMarkPassmark(line);
break;
case PassmarkLineType::OneLine:
case PassmarkLineType::TwoLines:
case PassmarkLineType::ThreeLines:
case PassmarkLineType::VMark:
default:
passmarksLines.append(line);
break;
}
}
return passmarksLines;
}
//---------------------------------------------------------------------------------------------------------------------
bool IsPassmarksPossible(const QVector<VPieceNode> &path)
{
@ -237,7 +328,7 @@ QVector<QPointF> VPiece::SeamAllowancePoints(const VContainer *data) const
SCASSERT(data != nullptr);
if (not IsSeamAllowance())
if (not IsSeamAllowance() || IsSeamAllowanceBuiltIn())
{
return QVector<QPointF>();
}
@ -392,7 +483,7 @@ QPainterPath VPiece::SeamAllowancePath(const VContainer *data) const
QPainterPath ekv;
// seam allowence
if (IsSeamAllowance())
if (IsSeamAllowance() && not IsSeamAllowanceBuiltIn())
{
if (not pointsEkv.isEmpty())
{
@ -669,6 +760,12 @@ QVector<VPieceNode> VPiece::GetUnitedPath(const VContainer *data) const
SCASSERT(data != nullptr)
QVector<VPieceNode> united = d->m_path.GetNodes();
if (IsSeamAllowance() && IsSeamAllowanceBuiltIn())
{
return united;
}
const QVector<CustomSARecord> records = FilterRecords(GetValidRecords());
for (int i = 0; i < records.size(); ++i)
@ -690,12 +787,26 @@ QVector<VPieceNode> VPiece::GetUnitedPath(const VContainer *data) const
if (records.at(i).reverse)
{
customNodes = VGObject::GetReversePoints(customNodes);
}
for (int j = 0; j < customNodes.size(); ++j)
{
// Additionally reverse all curves
for (int j = 0; j < customNodes.size(); ++j)
{ // don't make a check because node point will ignore the change
if (records.at(i).reverse)
{
// don't make a check because node point will ignore the change
customNodes[j].SetReverse(not customNodes.at(j).GetReverse());
}
// If seam allowance is built in main path user will not see a passmark provided by piece path
if (IsSeamAllowanceBuiltIn())
{
customNodes[j].SetPassmark(false);
}
else
{
customNodes[j].SetMainPathNode(false);
}
}
united = midBefore + customNodes + midAfter;
@ -929,6 +1040,11 @@ bool VPiece::IsPassmarkVisible(const QVector<VPieceNode> &path, int passmarkInde
return false;
}
if (IsSeamAllowance() && IsSeamAllowanceBuiltIn())
{
return true;
}
const QVector<CustomSARecord> records = FilterRecords(GetValidRecords());
if (records.isEmpty())
{
@ -979,6 +1095,27 @@ QVector<QLineF> VPiece::CreatePassmark(const QVector<VPieceNode> &path, int prev
return QVector<QLineF>(); // Something wrong
}
if (not IsSeamAllowanceBuiltIn())
{
QVector<QLineF> lines;
lines += SAPassmark(path, previousSAPoint, passmarkSAPoint, nextSAPoint, data, passmarkIndex);
if (qApp->Settings()->IsDoublePassmark() && path.at(passmarkIndex).IsMainPathNode())
{
lines += BuiltInSAPassmark(path, previousSAPoint, passmarkSAPoint, nextSAPoint, data, passmarkIndex);
}
return lines;
}
else
{
return BuiltInSAPassmark(path, previousSAPoint, passmarkSAPoint, nextSAPoint, data, passmarkIndex);
}
}
//---------------------------------------------------------------------------------------------------------------------
QVector<QLineF> VPiece::SAPassmark(const QVector<VPieceNode> &path, const VSAPoint &previousSAPoint,
const VSAPoint &passmarkSAPoint, const VSAPoint &nextSAPoint, const VContainer *data,
int passmarkIndex) const
{
QPointF seamPassmarkSAPoint;
if (not GetSeamPassmarkSAPoint(previousSAPoint, passmarkSAPoint, nextSAPoint, data, seamPassmarkSAPoint))
{
@ -991,24 +1128,14 @@ QVector<QLineF> VPiece::CreatePassmark(const QVector<VPieceNode> &path, int prev
QVector<QLineF> passmarksLines;
const qreal passmarkLength = VAbstractPiece::MaxLocalSA(passmarkSAPoint, width) * 0.5;
qreal passmarkLength = VAbstractPiece::MaxLocalSA(passmarkSAPoint, width) * passmarkFactor;
passmarkLength = qMin(passmarkLength, maxPassmarkLength);
const VPieceNode &node = path.at(passmarkIndex);
if (node.GetPassmarkAngleType() == PassmarkAngleType::Straightforward)
{
QLineF line = QLineF(seamPassmarkSAPoint, passmarkSAPoint);
line.setLength(passmarkLength);
if (node.GetPassmarkLineType() == PassmarkLineType::TwoLines)
{
passmarksLines += CreateTwoPassmarkLines(line);
}
else if (node.GetPassmarkLineType() == PassmarkLineType::ThreeLines)
{
passmarksLines += CreateThreePassmarkLines(line);
}
else
{
passmarksLines.append(line);
}
passmarksLines += CreatePassmarkLines(node.GetPassmarkLineType(), node.GetPassmarkAngleType(), line);
}
else
{
@ -1017,12 +1144,36 @@ QVector<QLineF> VPiece::CreatePassmark(const QVector<VPieceNode> &path, int prev
edge1.setAngle(edge1.angle() + edge1.angleTo(edge2)/2.);
edge1.setLength(passmarkLength);
passmarksLines.append(edge1);
passmarksLines += CreatePassmarkLines(node.GetPassmarkLineType(), node.GetPassmarkAngleType(), edge1);
}
return passmarksLines;
}
//---------------------------------------------------------------------------------------------------------------------
QVector<QLineF> VPiece::BuiltInSAPassmark(const QVector<VPieceNode> &path, const VSAPoint &previousSAPoint,
const VSAPoint &passmarkSAPoint, const VSAPoint &nextSAPoint,
const VContainer *data, int passmarkIndex) const
{
QVector<QLineF> passmarksLines;
const qreal width = ToPixel(GetSAWidth(), *data->GetPatternUnit());
qreal passmarkLength = VAbstractPiece::MaxLocalSA(passmarkSAPoint, width) * passmarkFactor;
passmarkLength = qMin(passmarkLength, maxPassmarkLength);
QLineF edge1 = QLineF(passmarkSAPoint, previousSAPoint);
QLineF edge2 = QLineF(passmarkSAPoint, nextSAPoint);
edge1.setAngle(edge1.angle() + edge1.angleTo(edge2)/2.);
edge1.setLength(passmarkLength);
const VPieceNode &node = path.at(passmarkIndex);
passmarksLines += CreatePassmarkLines(node.GetPassmarkLineType(), node.GetPassmarkAngleType(), edge1);
return passmarksLines;
}
//---------------------------------------------------------------------------------------------------------------------
int VPiece::IsCSAStart(const QVector<CustomSARecord> &records, quint32 id)
{

View file

@ -132,6 +132,12 @@ private:
QVector<QLineF> CreatePassmark(const QVector<VPieceNode> &path, int previousIndex, int passmarkIndex, int nextIndex,
const VContainer *data) const;
QVector<QLineF> SAPassmark(const QVector<VPieceNode> &path, const VSAPoint &previousSAPoint,
const VSAPoint &passmarkSAPoint, const VSAPoint &nextSAPoint, const VContainer *data,
int passmarkIndex) const;
QVector<QLineF> BuiltInSAPassmark(const QVector<VPieceNode> &path, const VSAPoint &previousSAPoint,
const VSAPoint &passmarkSAPoint, const VSAPoint &nextSAPoint,
const VContainer *data, int passmarkIndex) const;
static int IsCSAStart(const QVector<CustomSARecord> &records, quint32 id);
};

View file

@ -265,6 +265,18 @@ void VPieceNode::SetPassmark(bool passmark)
}
}
//---------------------------------------------------------------------------------------------------------------------
bool VPieceNode::IsMainPathNode() const
{
return d->m_isMainPathNode;
}
//---------------------------------------------------------------------------------------------------------------------
void VPieceNode::SetMainPathNode(bool value)
{
d->m_isMainPathNode = value;
}
//---------------------------------------------------------------------------------------------------------------------
PassmarkLineType VPieceNode::GetPassmarkLineType() const
{

View file

@ -80,6 +80,9 @@ public:
bool IsPassmark() const;
void SetPassmark(bool passmark);
bool IsMainPathNode() const;
void SetMainPathNode(bool value);
PassmarkLineType GetPassmarkLineType() const;
void SetPassmarkLineType(PassmarkLineType lineType);

View file

@ -46,6 +46,7 @@ public:
m_reverse(false),
m_excluded(false),
m_isPassmark(false),
m_isMainPathNode(true),
m_formulaWidthBefore(currentSeamAllowance),
m_formulaWidthAfter(currentSeamAllowance),
m_angleType(PieceNodeAngle::ByLength),
@ -59,6 +60,7 @@ public:
m_reverse(reverse),
m_excluded(false),
m_isPassmark(false),
m_isMainPathNode(true),
m_formulaWidthBefore(currentSeamAllowance),
m_formulaWidthAfter(currentSeamAllowance),
m_angleType(PieceNodeAngle::ByLength),
@ -78,6 +80,7 @@ public:
m_reverse(node.m_reverse),
m_excluded(node.m_excluded),
m_isPassmark(node.m_isPassmark),
m_isMainPathNode(node.m_isMainPathNode),
m_formulaWidthBefore(node.m_formulaWidthBefore),
m_formulaWidthAfter(node.m_formulaWidthAfter),
m_angleType(node.m_angleType),
@ -106,6 +109,9 @@ public:
/** @brief m_isPassmark has sense only for points. If true to seam allowance should be added a passmark. */
bool m_isPassmark;
/** @brief m_isMainPathNode need fin know if allowed for this passmakr to be double. */
bool m_isMainPathNode;
QString m_formulaWidthBefore;
QString m_formulaWidthAfter;

View file

@ -235,6 +235,7 @@ void DialogSeamAllowance::SetPiece(const VPiece &piece)
uiTabPaths->checkBoxForbidFlipping->setChecked(piece.IsForbidFlipping());
uiTabPaths->checkBoxSeams->setChecked(piece.IsSeamAllowance());
uiTabPaths->checkBoxBuiltIn->setChecked(piece.IsSeamAllowanceBuiltIn());
uiTabLabels->lineEditName->setText(piece.GetName());
const QString width = qApp->TrVars()->FormulaToUser(piece.GetFormulaSAWidth(), qApp->Settings()->GetOsSeparator());
@ -762,6 +763,7 @@ void DialogSeamAllowance::ListChanged()
//---------------------------------------------------------------------------------------------------------------------
void DialogSeamAllowance::EnableSeamAllowance(bool enable)
{
uiTabPaths->checkBoxBuiltIn->setEnabled(enable);
uiTabPaths->groupBoxAutomatic->setEnabled(enable);
uiTabPaths->groupBoxCustom->setEnabled(enable);
@ -846,6 +848,8 @@ void DialogSeamAllowance::PassmarkChanged(int index)
uiTabPassmarks->radioButtonOneLine->setDisabled(true);
uiTabPassmarks->radioButtonTwoLines->setDisabled(true);
uiTabPassmarks->radioButtonThreeLines->setDisabled(true);
uiTabPassmarks->radioButtonTMark->setDisabled(true);
uiTabPassmarks->radioButtonVMark->setDisabled(true);
uiTabPassmarks->radioButtonStraightforward->setDisabled(true);
uiTabPassmarks->radioButtonBisector->setDisabled(true);
@ -865,6 +869,8 @@ void DialogSeamAllowance::PassmarkChanged(int index)
uiTabPassmarks->radioButtonOneLine->setEnabled(true);
uiTabPassmarks->radioButtonTwoLines->setEnabled(true);
uiTabPassmarks->radioButtonThreeLines->setEnabled(true);
uiTabPassmarks->radioButtonTMark->setEnabled(true);
uiTabPassmarks->radioButtonVMark->setEnabled(true);
switch(node.GetPassmarkLineType())
{
@ -877,6 +883,12 @@ void DialogSeamAllowance::PassmarkChanged(int index)
case PassmarkLineType::ThreeLines:
uiTabPassmarks->radioButtonThreeLines->setChecked(true);
break;
case PassmarkLineType::TMark:
uiTabPassmarks->radioButtonTMark->setChecked(true);
break;
case PassmarkLineType::VMark:
uiTabPassmarks->radioButtonVMark->setChecked(true);
break;
default:
break;
}
@ -1171,6 +1183,14 @@ void DialogSeamAllowance::PassmarkLineTypeChanged(int id)
{
lineType = PassmarkLineType::ThreeLines;
}
else if (id == uiTabPassmarks->buttonGroupLineType->id(uiTabPassmarks->radioButtonTMark))
{
lineType = PassmarkLineType::TMark;
}
else if (id == uiTabPassmarks->buttonGroupLineType->id(uiTabPassmarks->radioButtonVMark))
{
lineType = PassmarkLineType::VMark;
}
rowNode.SetPassmarkLineType(lineType);
rowItem->setData(Qt::UserRole, QVariant::fromValue(rowNode));
@ -2036,6 +2056,7 @@ VPiece DialogSeamAllowance::CreatePiece() const
piece.SetPins(GetListInternals<quint32>(uiTabPins->listWidgetPins));
piece.SetForbidFlipping(uiTabPaths->checkBoxForbidFlipping->isChecked());
piece.SetSeamAllowance(uiTabPaths->checkBoxSeams->isChecked());
piece.SetSeamAllowanceBuiltIn(uiTabPaths->checkBoxBuiltIn->isChecked());
piece.SetName(uiTabLabels->lineEditName->text());
piece.SetMx(m_mx);
piece.SetMy(m_my);

View file

@ -79,6 +79,32 @@
</attribute>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonTMark">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>T mark</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroupLineType</string>
</attribute>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonVMark">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>V mark</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroupLineType</string>
</attribute>
</widget>
</item>
</layout>
</widget>
</item>
@ -135,7 +161,7 @@
<resources/>
<connections/>
<buttongroups>
<buttongroup name="buttonGroupLineType"/>
<buttongroup name="buttonGroupAngleType"/>
<buttongroup name="buttonGroupLineType"/>
</buttongroups>
</ui>

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>401</width>
<height>572</height>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
@ -105,6 +105,19 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxBuiltIn">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>The seam allowance is part of main path</string>
</property>
<property name="text">
<string>Built in</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBoxAutomatic">
<property name="enabled">

View file

@ -70,17 +70,18 @@ const QString VToolSeamAllowance::TagRecord = QStringLiteral("record");
const QString VToolSeamAllowance::TagIPaths = QStringLiteral("iPaths");
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::AttrHeight = QStringLiteral("height");
const QString VToolSeamAllowance::AttrUnited = QStringLiteral("united");
const QString VToolSeamAllowance::AttrFont = QStringLiteral("fontSize");
const QString VToolSeamAllowance::AttrTopLeftPin = QStringLiteral("topLeftPin");
const QString VToolSeamAllowance::AttrBottomRightPin = QStringLiteral("bottomRightPin");
const QString VToolSeamAllowance::AttrCenterPin = QStringLiteral("centerPin");
const QString VToolSeamAllowance::AttrTopPin = QStringLiteral("topPin");
const QString VToolSeamAllowance::AttrBottomPin = QStringLiteral("bottomPin");
const QString VToolSeamAllowance::AttrVersion = QStringLiteral("version");
const QString VToolSeamAllowance::AttrForbidFlipping = QStringLiteral("forbidFlipping");
const QString VToolSeamAllowance::AttrSeamAllowance = QStringLiteral("seamAllowance");
const QString VToolSeamAllowance::AttrSeamAllowanceBuiltIn = QStringLiteral("seamAllowanceBuiltIn");
const QString VToolSeamAllowance::AttrHeight = QStringLiteral("height");
const QString VToolSeamAllowance::AttrUnited = QStringLiteral("united");
const QString VToolSeamAllowance::AttrFont = QStringLiteral("fontSize");
const QString VToolSeamAllowance::AttrTopLeftPin = QStringLiteral("topLeftPin");
const QString VToolSeamAllowance::AttrBottomRightPin = QStringLiteral("bottomRightPin");
const QString VToolSeamAllowance::AttrCenterPin = QStringLiteral("centerPin");
const QString VToolSeamAllowance::AttrTopPin = QStringLiteral("topPin");
const QString VToolSeamAllowance::AttrBottomPin = QStringLiteral("bottomPin");
//---------------------------------------------------------------------------------------------------------------------
VToolSeamAllowance::~VToolSeamAllowance()
@ -223,6 +224,17 @@ 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());
const bool saBuiltIn = piece.IsSeamAllowanceBuiltIn();
if (saBuiltIn)
{
doc->SetAttribute(domElement, AttrSeamAllowanceBuiltIn, saBuiltIn);
}
else
{ // For backward compatebility.
domElement.removeAttribute(AttrSeamAllowanceBuiltIn);
}
doc->SetAttribute(domElement, VAbstractPattern::AttrWidth, piece.GetFormulaSAWidth());
doc->SetAttribute(domElement, AttrUnited, piece.IsUnited());
}
@ -1242,7 +1254,7 @@ void VToolSeamAllowance::RefreshGeometry()
this->setPos(detail.GetMx(), detail.GetMy());
if (detail.IsSeamAllowance())
if (detail.IsSeamAllowance() && not detail.IsSeamAllowanceBuiltIn())
{
path.addPath(detail.SeamAllowancePath(this->getData()));
path.setFillRule(Qt::OddEvenFill);

View file

@ -63,6 +63,7 @@ public:
static const QString AttrVersion;
static const QString AttrForbidFlipping;
static const QString AttrSeamAllowance;
static const QString AttrSeamAllowanceBuiltIn;
static const QString AttrHeight;
static const QString AttrUnited;
static const QString AttrFont;