Fixed empty point label in SplinePath name.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-03-22 17:25:16 +02:00
parent 2e0bf11261
commit 4c1c0d4d0a
4 changed files with 6 additions and 6 deletions

View File

@ -214,7 +214,7 @@ void VAbstractCubicBezierPath::CreateName()
{ {
name = splPath; name = splPath;
name.append(QString("_%1").arg(FirstPoint().name())); name.append(QString("_%1").arg(FirstPoint().name()));
if (CountSubSpl() >= 2) if (CountSubSpl() >= 1)
{ {
name.append(QString("_%1").arg(LastPoint().name())); name.append(QString("_%1").arg(LastPoint().name()));

View File

@ -131,13 +131,12 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString
quint32 id = _id; quint32 id = _id;
VSplinePath *splPath1 = nullptr; VSplinePath *splPath1 = nullptr;
VSplinePath *splPath2 = nullptr; VSplinePath *splPath2 = nullptr;
VPointF *p = VToolCutSplinePath::CutSplinePath(qApp->toPixel(result), splPath, &splPath1, &splPath2); VPointF *p = VToolCutSplinePath::CutSplinePath(qApp->toPixel(result), splPath, pointName, &splPath1, &splPath2);
SCASSERT(splPath1 != nullptr); SCASSERT(splPath1 != nullptr);
SCASSERT(splPath2 != nullptr); SCASSERT(splPath2 != nullptr);
SCASSERT(p != nullptr); SCASSERT(p != nullptr);
p->setName(pointName);
p->setMx(mx); p->setMx(mx);
p->setMy(my); p->setMy(my);
@ -203,7 +202,7 @@ void VToolCutSplinePath::ShowVisualization(bool show)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VPointF *VToolCutSplinePath::CutSplinePath(qreal length, const QSharedPointer<VAbstractCubicBezierPath> &splPath, VPointF *VToolCutSplinePath::CutSplinePath(qreal length, const QSharedPointer<VAbstractCubicBezierPath> &splPath,
VSplinePath **splPath1, VSplinePath **splPath2) const QString &pName, VSplinePath **splPath1, VSplinePath **splPath2)
{ {
SCASSERT(splPath != nullptr); SCASSERT(splPath != nullptr);
@ -212,6 +211,7 @@ VPointF *VToolCutSplinePath::CutSplinePath(qreal length, const QSharedPointer<VA
const QPointF point = splPath->CutSplinePath(length, p1, p2, spl1p2, spl1p3, spl2p2, spl2p3); const QPointF point = splPath->CutSplinePath(length, p1, p2, spl1p2, spl1p3, spl2p2, spl2p3);
VPointF *p = new VPointF(point); VPointF *p = new VPointF(point);
p->setName(pName);
const QVector<VSplinePoint> points = splPath->GetSplinePath(); const QVector<VSplinePoint> points = splPath->GetSplinePath();

View File

@ -61,7 +61,7 @@ public:
virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE; virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE;
static VPointF *CutSplinePath(qreal length, const QSharedPointer<VAbstractCubicBezierPath> &splPath, static VPointF *CutSplinePath(qreal length, const QSharedPointer<VAbstractCubicBezierPath> &splPath,
VSplinePath **splPath1, VSplinePath **splPath2); const QString &pName, VSplinePath **splPath1, VSplinePath **splPath2);
protected: protected:
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ) Q_DECL_OVERRIDE; virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ) Q_DECL_OVERRIDE;
virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE; virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE;

View File

@ -61,7 +61,7 @@ void VisToolCutSplinePath::RefreshGeometry()
{ {
VSplinePath *spPath1 = nullptr; VSplinePath *spPath1 = nullptr;
VSplinePath *spPath2 = nullptr; VSplinePath *spPath2 = nullptr;
VPointF *p = VToolCutSplinePath::CutSplinePath(length, splPath, &spPath1, &spPath2); VPointF *p = VToolCutSplinePath::CutSplinePath(length, splPath, "X", &spPath1, &spPath2);
SCASSERT(p != nullptr); SCASSERT(p != nullptr);
SCASSERT(spPath1 != nullptr); SCASSERT(spPath1 != nullptr);
SCASSERT(spPath2 != nullptr); SCASSERT(spPath2 != nullptr);