Fix typo.

This commit is contained in:
Roman Telezhynskyi 2022-11-14 18:02:00 +02:00
parent d95d755e0d
commit 2f683930e9
18 changed files with 87 additions and 49 deletions

View File

@ -149,7 +149,7 @@ void VPPiece::Update(const VPPiecePtr &piece)
}
SetName(piece->GetName());
SetCountourPoints(piece->GetContourPoints(), piece->IsHideMainPath());
SetContourPoints(piece->GetContourPoints(), piece->IsHideMainPath());
SetSeamAllowancePoints(piece->GetSeamAllowancePoints(), piece->IsSeamAllowance(), piece->IsSeamAllowanceBuiltIn());
SetInternalPaths(piece->GetInternalPaths());
SetPassmarks(piece->GetPassmarks());

View File

@ -556,7 +556,7 @@ auto VPLayoutFileReader::ReadLayoutPoints() -> QVector<VLayoutPoint>
void VPLayoutFileReader::ReadSeamLine(const VPPiecePtr &piece)
{
AssertRootTag(ML::TagSeamLine);
piece->SetCountourPoints(ReadLayoutPoints());
piece->SetContourPoints(ReadLayoutPoints());
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -4057,8 +4057,8 @@ void VPattern::ParsePathElement(VMainGraphicsScene *scene, QDomElement &domEleme
if (initData.path.GetType() == PiecePathType::InternalPath)
{
initData.path.SetCutPath(GetParametrBool(domElement, AttrCut, falseStr));
initData.path.SetFirstToCuttingCountour(GetParametrBool(domElement, AttrFirstToCountour, falseStr));
initData.path.SetLastToCuttingCountour(GetParametrBool(domElement, AttrLastToCountour, falseStr));
initData.path.SetFirstToCuttingContour(GetParametrBool(domElement, AttrFirstToContour, falseStr));
initData.path.SetLastToCuttingContour(GetParametrBool(domElement, AttrLastToContour, falseStr));
initData.path.SetVisibilityTrigger(GetParametrString(domElement, AttrVisible, QChar('1')));
}

View File

@ -137,8 +137,8 @@ const QString AttrWidth = QStringLiteral("width");
const QString AttrHeight = QStringLiteral("height");
const QString AttrPlaceLabelType = QStringLiteral("placeLabelType");
const QString AttrVersion = QStringLiteral("version");
const QString AttrFirstToCountour = QStringLiteral("firstToCountour");
const QString AttrLastToCountour = QStringLiteral("lastToCountour");
const QString AttrFirstToContour = QStringLiteral("firstToContour");
const QString AttrLastToContour = QStringLiteral("lastToContour");
const QString AttrNotes = QStringLiteral("notes");
const QString AttrAlias = QStringLiteral("alias");
const QString AttrAlias1 = QStringLiteral("alias1");

View File

@ -156,8 +156,8 @@ extern const QString AttrWidth;
extern const QString AttrHeight;
extern const QString AttrPlaceLabelType;
extern const QString AttrVersion;
extern const QString AttrFirstToCountour;
extern const QString AttrLastToCountour;
extern const QString AttrFirstToContour;
extern const QString AttrLastToContour;
extern const QString AttrNotes;
extern const QString AttrAlias;
extern const QString AttrAlias1;

View File

@ -441,8 +441,8 @@
<xs:attribute name="typeLine" type="curvePenStyle"/>
<xs:attribute name="cut" type="xs:boolean"/>
<xs:attribute name="visible" type="xs:string"/>
<xs:attribute name="firstToCountour" type="xs:boolean"/>
<xs:attribute name="lastToCountour" type="xs:boolean"/>
<xs:attribute name="firstToContour" type="xs:boolean"/>
<xs:attribute name="lastToContour" type="xs:boolean"/>
<xs:attribute name="cuttingNumber" type="xs:unsignedInt"/>
<xs:attribute name="cuttingVelocityReduction" type="velocityReduction"/>
</xs:complexType>

View File

@ -169,6 +169,10 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, strCutNumber, (QLatin1String("cutNumber
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strQuantity, (QLatin1String("quantity"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strExtension, (QLatin1String("extension"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strContentType, (QLatin1String("contentType"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strFirstToCountour, (QLatin1String("firstToCountour"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strFirstToContour, (QLatin1String("firstToContour"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strLastToCountour, (QLatin1String("lastToCountour"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strLastToContour, (QLatin1String("lastToContour"))) // NOLINT
} // anonymous namespace
//---------------------------------------------------------------------------------------------------------------------
@ -574,6 +578,7 @@ void VPatternConverter::ToV0_9_2()
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 9, 2),
"Time to refactor the code.");
ConvertPathAttributesToV0_9_2();
SetVersion(QStringLiteral("0.9.2"));
Save();
}
@ -2218,6 +2223,37 @@ void VPatternConverter::ConvertMeasurementsPathToV0_9_1()
}
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ConvertPathAttributesToV0_9_2()
{
// TODO. Delete if minimal supported version is 0.9.2
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 9, 2),
"Time to refactor the code.");
const QDomNodeList paths = this->elementsByTagName(*strPath);
for (int i=0; i < paths.size(); ++i)
{
QDomElement domElement = paths.at(i).toElement();
if (domElement.isNull())
{
continue;
}
if (domElement.hasAttribute(*strFirstToCountour))
{
domElement.setAttribute(*strFirstToContour, domElement.attribute(*strFirstToCountour));
domElement.removeAttribute(*strFirstToCountour);
}
if (domElement.hasAttribute(*strLastToCountour))
{
domElement.setAttribute(*strLastToContour, domElement.attribute(*strLastToCountour));
domElement.removeAttribute(*strLastToCountour);
}
}
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::TagUnionDetailsToV0_4_0()
{

View File

@ -146,6 +146,8 @@ private:
void ConvertImageToV0_9_0();
void ConvertMeasurementsPathToV0_9_1();
void ConvertPathAttributesToV0_9_2();
};
//---------------------------------------------------------------------------------------------------------------------

View File

@ -295,7 +295,7 @@ QLineF VContour::GlobalEdge(int i) const
edge = QLineF(d->globalContour.at(i-1), d->globalContour.at(i));
}
else
{ // Closed countour
{ // Closed contour
edge = QLineF(d->globalContour.at(GlobalEdgesCount()-1), d->globalContour.at(0));
}
}

View File

@ -654,7 +654,7 @@ auto VLayoutPiece::Create(const VPiece &piece, vidtype id, const VContainer *pat
qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg;
}
det.SetCountourPoints(futureMainPath.result(),
det.SetContourPoints(futureMainPath.result(),
VAbstractApplication::VApp()->Settings()->IsPieceShowMainPath() ? false
: piece.IsHideMainPath());
det.SetSeamAllowancePoints(futureSeamAllowance.result(), piece.IsSeamAllowance(), piece.IsSeamAllowanceBuiltIn());
@ -764,7 +764,7 @@ auto VLayoutPiece::GetContourPoints() const -> QVector<VLayoutPoint>
}
//---------------------------------------------------------------------------------------------------------------------
void VLayoutPiece::SetCountourPoints(const QVector<VLayoutPoint> &points, bool hideMainPath)
void VLayoutPiece::SetContourPoints(const QVector<VLayoutPoint> &points, bool hideMainPath)
{
d->m_contour = RemoveDublicates(points, false);
SetHideMainPath(hideMainPath);

View File

@ -82,7 +82,7 @@ public:
auto GetMappedContourPoints() const -> QVector<VLayoutPoint>;
auto GetContourPoints() const -> QVector<VLayoutPoint>;
void SetCountourPoints(const QVector<VLayoutPoint> &points, bool hideMainPath = false);
void SetContourPoints(const QVector<VLayoutPoint> &points, bool hideMainPath = false);
auto GetMappedSeamAllowancePoints() const -> QVector<VLayoutPoint>;
auto GetSeamAllowancePoints() const -> QVector<VLayoutPoint>;

View File

@ -1243,7 +1243,7 @@ void VPiece::TestInternalPathCuttingPathIntersection(const VContainer *data) con
if (internalPath.intersects(contourPath))
{
const QString errorMsg = QObject::tr("Piece '%1'. Internal path '%2' intersects with cutting "
"countour.").arg(GetName(), path.GetName());
"contour.").arg(GetName(), path.GetName());
VAbstractApplication::VApp()->IsPedantic() ? throw VExceptionObjectError(errorMsg) :
qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg;
continue;
@ -1252,7 +1252,7 @@ void VPiece::TestInternalPathCuttingPathIntersection(const VContainer *data) con
if (not contourPath.contains(internalPath))
{
const QString errorMsg = QObject::tr("Piece '%1'. Internal path '%2' not inside of cutting "
"countour.").arg(GetName(), path.GetName());
"contour.").arg(GetName(), path.GetName());
VAbstractApplication::VApp()->IsPedantic() ? throw VExceptionObjectError(errorMsg) :
qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg;
}

View File

@ -198,7 +198,7 @@ qreal FindTipDirection(const QVector<T> &points)
}
//---------------------------------------------------------------------------------------------------------------------
bool IntersectionWithCuttingCountour(const QVector<QPointF> &cuttingPath, const QVector<VLayoutPoint> &points,
bool IntersectionWithCuttingContour(const QVector<QPointF> &cuttingPath, const QVector<VLayoutPoint> &points,
QPointF *connection)
{
if (points.size() <= 1)
@ -209,7 +209,7 @@ bool IntersectionWithCuttingCountour(const QVector<QPointF> &cuttingPath, const
const QPointF &first = ConstFirst(points);
if (VAbstractCurve::IsPointOnCurve(cuttingPath, first))
{ // Point is already part of a cutting countour
{ // Point is already part of a cutting contour
*connection = first;
return true;
}
@ -390,27 +390,27 @@ void VPiecePath::SetVisibilityTrigger(const QString &formula)
}
//---------------------------------------------------------------------------------------------------------------------
void VPiecePath::SetFirstToCuttingCountour(bool value)
void VPiecePath::SetFirstToCuttingContour(bool value)
{
d->m_firstToCuttingCountour = value;
d->m_firstToCuttingContour = value;
}
//---------------------------------------------------------------------------------------------------------------------
bool VPiecePath::IsFirstToCuttingCountour() const
bool VPiecePath::IsFirstToCuttingContour() const
{
return d->m_firstToCuttingCountour;
return d->m_firstToCuttingContour;
}
//---------------------------------------------------------------------------------------------------------------------
void VPiecePath::SetLastToCuttingCountour(bool value)
void VPiecePath::SetLastToCuttingContour(bool value)
{
d->m_lastToCuttingCountour = value;
d->m_lastToCuttingContour = value;
}
//---------------------------------------------------------------------------------------------------------------------
bool VPiecePath::IsLastToCuttingCountour() const
bool VPiecePath::IsLastToCuttingContour() const
{
return d->m_lastToCuttingCountour;
return d->m_lastToCuttingContour;
}
//---------------------------------------------------------------------------------------------------------------------
@ -422,10 +422,10 @@ QVector<VLayoutPoint> VPiecePath::PathPoints(const VContainer *data, const QVect
{
QVector<VLayoutPoint> extended = points;
if (IsFirstToCuttingCountour())
if (IsFirstToCuttingContour())
{
VLayoutPoint firstConnection;
if (IntersectionWithCuttingCountour(cuttingPath, points, &firstConnection))
if (IntersectionWithCuttingContour(cuttingPath, points, &firstConnection))
{
firstConnection.SetTurnPoint(true);
extended.prepend(firstConnection);
@ -433,17 +433,17 @@ QVector<VLayoutPoint> VPiecePath::PathPoints(const VContainer *data, const QVect
else
{
const QString errorMsg = QObject::tr("Error in internal path '%1'. There is no intersection of first "
"point with cutting countour")
"point with cutting contour")
.arg(GetName());
VAbstractApplication::VApp()->IsPedantic() ? throw VExceptionObjectError(errorMsg) :
qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg;
}
}
if (IsLastToCuttingCountour())
if (IsLastToCuttingContour())
{
VLayoutPoint lastConnection;
if (IntersectionWithCuttingCountour(cuttingPath, Reverse(points), &lastConnection))
if (IntersectionWithCuttingContour(cuttingPath, Reverse(points), &lastConnection))
{
lastConnection.SetTurnPoint(true);
extended.append(lastConnection);
@ -451,7 +451,7 @@ QVector<VLayoutPoint> VPiecePath::PathPoints(const VContainer *data, const QVect
else
{
const QString errorMsg = QObject::tr("Error in internal path '%1'. There is no intersection of last "
"point with cutting countour")
"point with cutting contour")
.arg(GetName());
VAbstractApplication::VApp()->IsPedantic() ? throw VExceptionObjectError(errorMsg) :
qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg;

View File

@ -84,11 +84,11 @@ public:
QString GetVisibilityTrigger() const;
void SetVisibilityTrigger(const QString &formula);
void SetFirstToCuttingCountour(bool value);
bool IsFirstToCuttingCountour() const;
void SetFirstToCuttingContour(bool value);
bool IsFirstToCuttingContour() const;
void SetLastToCuttingCountour(bool value);
bool IsLastToCuttingCountour() const;
void SetLastToCuttingContour(bool value);
bool IsLastToCuttingContour() const;
QVector<VLayoutPoint> PathPoints(const VContainer *data,
const QVector<QPointF> &cuttingPath = QVector<QPointF>()) const;

View File

@ -59,8 +59,8 @@ public:
m_penType(path.m_penType),
m_cut(path.m_cut),
m_visibilityTrigger(path.m_visibilityTrigger),
m_firstToCuttingCountour(path.m_firstToCuttingCountour),
m_lastToCuttingCountour(path.m_lastToCuttingCountour)
m_firstToCuttingContour(path.m_firstToCuttingContour),
m_lastToCuttingContour(path.m_lastToCuttingContour)
{}
~VPiecePathData();
@ -71,8 +71,8 @@ public:
Qt::PenStyle m_penType{Qt::SolidLine};
bool m_cut{false};
QString m_visibilityTrigger{'1'};
bool m_firstToCuttingCountour{false};
bool m_lastToCuttingCountour{false};
bool m_firstToCuttingContour{false};
bool m_lastToCuttingContour{false};
private:
Q_DISABLE_ASSIGN(VPiecePathData)

View File

@ -1358,8 +1358,8 @@ void DialogPiecePath::SetPiecePath(const VPiecePath &path)
SetPenType(path.GetPenType());
SetCutPath(path.IsCutPath());
ui->checkBoxFirstPointToCuttingContour->setChecked(path.IsFirstToCuttingCountour());
ui->checkBoxLastPointToCuttingContour->setChecked(path.IsLastToCuttingCountour());
ui->checkBoxFirstPointToCuttingContour->setChecked(path.IsFirstToCuttingContour());
ui->checkBoxLastPointToCuttingContour->setChecked(path.IsLastToCuttingContour());
if (path.GetType() == PiecePathType::InternalPath)
{
@ -1628,8 +1628,8 @@ VPiecePath DialogPiecePath::CreatePath() const
path.SetName(ui->lineEditName->text());
path.SetPenType(isInternalPath ? GetPenType() : Qt::SolidLine);
path.SetCutPath(isInternalPath ? IsCutPath() : false);
path.SetFirstToCuttingCountour(isInternalPath ? ui->checkBoxFirstPointToCuttingContour->isChecked() : false);
path.SetLastToCuttingCountour(isInternalPath ? ui->checkBoxLastPointToCuttingContour->isChecked() : false);
path.SetFirstToCuttingContour(isInternalPath ? ui->checkBoxFirstPointToCuttingContour->isChecked() : false);
path.SetLastToCuttingContour(isInternalPath ? ui->checkBoxLastPointToCuttingContour->isChecked() : false);
path.SetVisibilityTrigger(isInternalPath ? GetFormulaVisible() : QChar('1'));
return path;

View File

@ -194,8 +194,8 @@ void VToolPiecePath::AddAttributes(VAbstractPattern *doc, QDomElement &domElemen
{
doc->SetAttribute(domElement, VAbstractPattern::AttrVisible, path.GetVisibilityTrigger());
doc->SetAttribute(domElement, AttrCut, path.IsCutPath());
doc->SetAttribute(domElement, AttrFirstToCountour, path.IsFirstToCuttingCountour());
doc->SetAttribute(domElement, AttrLastToCountour, path.IsLastToCuttingCountour());
doc->SetAttribute(domElement, AttrFirstToContour, path.IsFirstToCuttingContour());
doc->SetAttribute(domElement, AttrLastToContour, path.IsLastToCuttingContour());
}
}

View File

@ -59,7 +59,7 @@ void TST_VLayoutDetail::Case1() const
VLayoutPiece det = VLayoutPiece();
QVector<VLayoutPoint> inputPoints;
CastTo(InputPointsCase1(), inputPoints);
det.SetCountourPoints(inputPoints);
det.SetContourPoints(inputPoints);
// Begin comparison
QVector<QPointF> contourPoints;
@ -125,7 +125,7 @@ void TST_VLayoutDetail::Case2() const
VLayoutPiece det = VLayoutPiece();
QVector<VLayoutPoint> inputPoints;
CastTo(InputPointsCase2(), inputPoints);
det.SetCountourPoints(inputPoints);
det.SetContourPoints(inputPoints);
// Begin comparison
QVector<QPointF> contourPoints;
@ -170,7 +170,7 @@ void TST_VLayoutDetail::Case3() const
VLayoutPiece det = VLayoutPiece();
QVector<VLayoutPoint> inputPoints;
CastTo(InputPointsCase3(), inputPoints);
det.SetCountourPoints(inputPoints);
det.SetContourPoints(inputPoints);
// Begin comparison
QVector<QPointF> contourPoints;