CutSplPath worked wrong. Simple paths do not inherited the curved path

coefficient of curvature.

--HG--
branch : develop
This commit is contained in:
dismine 2014-11-11 12:04:14 +02:00
parent f823040725
commit 62341c3c5b
2 changed files with 7 additions and 10 deletions

View File

@ -171,16 +171,7 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString
splPath1->append(VSplinePoint(splP1.P(), splP1.KAsm1(), spl1.GetAngle1()+180, spl1.GetKasm1(), splPath1->append(VSplinePoint(splP1.P(), splP1.KAsm1(), spl1.GetAngle1()+180, spl1.GetKasm1(),
spl1.GetAngle1())); spl1.GetAngle1()));
VSplinePoint cutPoint; VSplinePoint cutPoint;
// if (typeCreation == Source::FromGui) cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl1.GetAngle2(), spl2.GetKasm1(), spl1.GetAngle2()+180);
// {
// cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl1.GetAngle2(), spl2.GetKasm1(),
// spl1.GetAngle2());
// }
// else
// {
cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl1.GetAngle2(), spl2.GetKasm1(),
spl1.GetAngle2()+180);
// }
splPath1->append(cutPoint); splPath1->append(cutPoint);
continue; continue;
} }
@ -200,6 +191,8 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString
splPath2->append(splPath->at(i)); splPath2->append(splPath->at(i));
} }
} }
splPath1->setKCurve(splPath->getKCurve());
splPath2->setKCurve(splPath->getKCurve());
splPath1->setMaxCountPoints(splPath->CountPoint()); splPath1->setMaxCountPoints(splPath->CountPoint());
splPath2->setMaxCountPoints(splPath->CountPoint()); splPath2->setMaxCountPoints(splPath->CountPoint());

View File

@ -61,6 +61,7 @@ void VisToolCutSplinePath::RefreshGeometry()
QPointF spl1p2, spl1p3, spl2p2, spl2p3; QPointF spl1p2, spl1p3, spl2p2, spl2p3;
qint32 p1 = 0, p2 = 0; qint32 p1 = 0, p2 = 0;
// TODO make refactoring. CutSplPath repeat twice. Here and in VToolCutSpline.
const QPointF cutPoint = splPath->CutSplinePath(length, p1, p2, spl1p2, spl1p3, spl2p2, spl2p3); const QPointF cutPoint = splPath->CutSplinePath(length, p1, p2, spl1p2, spl1p3, spl2p2, spl2p3);
VPointF p = VPointF(cutPoint); VPointF p = VPointF(cutPoint);
@ -103,6 +104,9 @@ void VisToolCutSplinePath::RefreshGeometry()
} }
} }
spPath1.setKCurve(splPath->getKCurve());
spPath2.setKCurve(splPath->getKCurve());
DrawPoint(point, cutPoint, mainColor); DrawPoint(point, cutPoint, mainColor);
DrawPath(splPath1, spPath1.GetPath(PathDirection::Show), Qt::darkGreen, Qt::SolidLine, Qt::RoundCap); DrawPath(splPath1, spPath1.GetPath(PathDirection::Show), Qt::darkGreen, Qt::SolidLine, Qt::RoundCap);