From a05bf82c248f2e2fc605a83492380dacbbfc467b Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 8 May 2019 20:05:26 +0300 Subject: [PATCH] Clang warning. --HG-- branch : develop --- src/libs/vpatterndb/vpiece.cpp | 126 --------------------------------- 1 file changed, 126 deletions(-) diff --git a/src/libs/vpatterndb/vpiece.cpp b/src/libs/vpatterndb/vpiece.cpp index 093b095de..086f5acbe 100644 --- a/src/libs/vpatterndb/vpiece.cpp +++ b/src/libs/vpatterndb/vpiece.cpp @@ -364,72 +364,6 @@ QVector CreateBoxMarkPassmark(const QLineF &line, const QVector return PointsToSegments(points); } -//--------------------------------------------------------------------------------------------------------------------- -QVector CreatePassmarkLines(PassmarkLineType lineType, PassmarkAngleType angleType, const QLineF &line, - const QVector &seamAllowance) -{ - QVector passmarksLines; - - if (angleType == PassmarkAngleType::Straightforward - || angleType == PassmarkAngleType::Intersection - || angleType == PassmarkAngleType::IntersectionOnlyLeft - || angleType == PassmarkAngleType::IntersectionOnlyRight - || angleType == PassmarkAngleType::Intersection2 - || angleType == PassmarkAngleType::Intersection2OnlyLeft - || angleType == PassmarkAngleType::Intersection2OnlyRight) - { - switch (lineType) - { - case PassmarkLineType::TwoLines: - passmarksLines += CreateTwoPassmarkLines(line, seamAllowance); - break; - case PassmarkLineType::ThreeLines: - passmarksLines += CreateThreePassmarkLines(line, seamAllowance); - break; - case PassmarkLineType::TMark: - passmarksLines += CreateTMarkPassmark(line); - break; - case PassmarkLineType::VMark: - passmarksLines += CreateVMarkPassmark(line); - break; - case PassmarkLineType::VMark2: - passmarksLines += CreateVMark2Passmark(line, seamAllowance); - break; - case PassmarkLineType::UMark: - passmarksLines += CreateUMarkPassmark(line, seamAllowance); - break; - case PassmarkLineType::BoxMark: - passmarksLines += CreateBoxMarkPassmark(line, seamAllowance); - 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: - case PassmarkLineType::VMark2: - case PassmarkLineType::UMark: - case PassmarkLineType::BoxMark: - default: - passmarksLines.append(line); - break; - } - } - - return passmarksLines; -} - //--------------------------------------------------------------------------------------------------------------------- bool IsPassmarksPossible(const QVector &path) { @@ -449,66 +383,6 @@ bool IsPassmarksPossible(const QVector &path) return countPointNodes >= 3 || (countPointNodes >= 1 && countOthers >= 1); } -//--------------------------------------------------------------------------------------------------------------------- -bool FixNotchPoint(const QVector &seamAllowance, const QPointF ¬chBase, QPointF *notch) -{ - bool fixed = true; - if (not VAbstractCurve::IsPointOnCurve(seamAllowance, *notch)) - { - fixed = false; - QLineF axis = QLineF(notchBase, *notch); - axis.setLength(ToPixel(50, Unit::Cm)); - const QVector points = VAbstractCurve::CurveIntersectLine(seamAllowance, axis); - - if (points.size() > 0) - { - if (points.size() == 1) - { - *notch = points.at(0); - fixed = true; - } - else - { - QMap forward; - - for ( qint32 i = 0; i < points.size(); ++i ) - { - if (points.at(i) == notchBase) - { // Always seek unique intersection - continue; - } - - const QLineF length(notchBase, points.at(i)); - if (qAbs(length.angle() - axis.angle()) < 0.1) - { - forward.insert(length.length(), i); - } - } - - - // Closest point is not always want we need. First return point in forward direction if exists. - if (not forward.isEmpty()) - { - *notch = points.at(forward.first()); - fixed = true; - } - } - } - } - else - { // Fixing distortion - QLineF axis = QLineF(notchBase, *notch); - axis.setLength(axis.length() + accuracyPointOnLine * 10); - const QVector points = VAbstractCurve::CurveIntersectLine(seamAllowance, axis); - if (points.size() == 1) - { - *notch = points.first(); - } - } - - return fixed; -} - //--------------------------------------------------------------------------------------------------------------------- QVector RotatePath(const QVector &path, int index) {