Refactoring.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2016-01-25 19:10:39 +02:00
parent d86c79f290
commit c1fecafda9
5 changed files with 12 additions and 12 deletions

View File

@ -40,7 +40,7 @@ enum class LabelType : char {NewPatternPiece, NewLabel};
// Don't touch values!!!. Same values stored in xml.
enum class CrossCirclesPoint : char {FirstPoint = 1, SecondPoint = 2};
enum class VCrossCurvesPoint : char {HighestPoint = 1, LowestPoint = 2};
enum class HCrossCurvesPoint : char {LeftPoint = 1, RightPoint = 2};
enum class HCrossCurvesPoint : char {LeftmostPoint = 1, RightmostPoint = 2};
class VDataTool;
class VContainer;

View File

@ -241,8 +241,8 @@ void DialogTool::FillComboBoxHCrossCurvesPoint(QComboBox *box) const
{
SCASSERT(box != nullptr);
box->addItem(tr("Leftmost point"), QVariant(static_cast<int>(HCrossCurvesPoint::LeftPoint)));
box->addItem(tr("Rightmost point"), QVariant(static_cast<int>(HCrossCurvesPoint::RightPoint)));
box->addItem(tr("Leftmost point"), QVariant(static_cast<int>(HCrossCurvesPoint::LeftmostPoint)));
box->addItem(tr("Rightmost point"), QVariant(static_cast<int>(HCrossCurvesPoint::RightmostPoint)));
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -217,7 +217,7 @@ QPointF VToolPointOfIntersectionCurves::FindPoint(const QVector<QPointF> &curve1
QPointF crossPoint = vIntersections.at(0);
if (hCrossPoint == HCrossCurvesPoint::RightPoint)
if (hCrossPoint == HCrossCurvesPoint::RightmostPoint)
{
qreal maxX = vIntersections.at(0).x();

View File

@ -34,7 +34,7 @@ VisToolPointOfIntersectionCurves::VisToolPointOfIntersectionCurves(const VContai
:VisPath(data, parent),
object2Id(NULL_ID),
vCrossPoint(VCrossCurvesPoint::HighestPoint),
hCrossPoint(HCrossCurvesPoint::LeftPoint),
hCrossPoint(HCrossCurvesPoint::LeftmostPoint),
point(nullptr),
visCurve2(nullptr)
{

View File

@ -50,7 +50,7 @@ void TST_FindPoint::TestPointOfIntersectionCurves_data()
QVector<QPointF> points2;
VCrossCurvesPoint v = VCrossCurvesPoint::HighestPoint;
HCrossCurvesPoint h = HCrossCurvesPoint::LeftPoint;
HCrossCurvesPoint h = HCrossCurvesPoint::LeftmostPoint;
QPointF p;
QTest::newRow("Empty lists of points") << points1 << points2 << static_cast<int>(v) << static_cast<int>(h) << p;
@ -91,12 +91,12 @@ void TST_FindPoint::TestPointOfIntersectionCurves_data()
p = QPointF(19, 16);
h = HCrossCurvesPoint::LeftPoint;
h = HCrossCurvesPoint::LeftmostPoint;
QTest::newRow("Two intersection points (highest point, leftmost point)") << points1 << points2
<< static_cast<int>(v)
<< static_cast<int>(h) << p;
h = HCrossCurvesPoint::RightPoint;
h = HCrossCurvesPoint::RightmostPoint;
QTest::newRow("Two intersection points (highest point, rightmost point)") << points1 << points2
<< static_cast<int>(v)
<< static_cast<int>(h) << p;
@ -104,12 +104,12 @@ void TST_FindPoint::TestPointOfIntersectionCurves_data()
v = VCrossCurvesPoint::LowestPoint;
p = QPointF(19, 24);
h = HCrossCurvesPoint::LeftPoint;
h = HCrossCurvesPoint::LeftmostPoint;
QTest::newRow("Two intersection points (lowest point, leftmost point)") << points1 << points2
<< static_cast<int>(v)
<< static_cast<int>(h) << p;
h = HCrossCurvesPoint::RightPoint;
h = HCrossCurvesPoint::RightmostPoint;
QTest::newRow("Two intersection points (lowest point, rightmost point)") << points1 << points2
<< static_cast<int>(v)
<< static_cast<int>(h) << p;
@ -124,7 +124,7 @@ void TST_FindPoint::TestPointOfIntersectionCurves_data()
points2.append(QPointF(20, 15));
points2.append(QPointF(30, 30));
h = HCrossCurvesPoint::LeftPoint;
h = HCrossCurvesPoint::LeftmostPoint;
p = QPointF(16.6667, 20);
v = VCrossCurvesPoint::HighestPoint;
@ -137,7 +137,7 @@ void TST_FindPoint::TestPointOfIntersectionCurves_data()
<< static_cast<int>(v)
<< static_cast<int>(h) << p;
h = HCrossCurvesPoint::RightPoint;
h = HCrossCurvesPoint::RightmostPoint;
p = QPointF(23.3333, 20);
v = VCrossCurvesPoint::HighestPoint;