diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 077e5164b..2eacb3bb6 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -1842,7 +1842,8 @@ void VPattern::ParseToolTrueDarts(VMainGraphicsScene *scene, const QDomElement & } //--------------------------------------------------------------------------------------------------------------------- -void VPattern::ParseToolSpline(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse) +// TODO. Delete if minimal supported version is 0.2.7 +void VPattern::ParseOldToolSpline(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse) { SCASSERT(scene != nullptr); Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); @@ -1865,10 +1866,10 @@ void VPattern::ParseToolSpline(VMainGraphicsScene *scene, const QDomElement &dom const auto p1 = data->GeometricObject(point1); const auto p4 = data->GeometricObject(point4); - VSpline spline(*p1, *p4, angle1, angle2, kAsm1, kAsm2, kCurve); + auto spline = new VSpline(*p1, *p4, angle1, angle2, kAsm1, kAsm2, kCurve); if (duplicate > 0) { - spline.SetDuplicate(duplicate); + spline->SetDuplicate(duplicate); } VToolSpline::Create(id, spline, color, scene, this, data, parse, Source::FromFile); @@ -1881,6 +1882,63 @@ void VPattern::ParseToolSpline(VMainGraphicsScene *scene, const QDomElement &dom } } +//--------------------------------------------------------------------------------------------------------------------- +void VPattern::ParseToolSpline(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) +{ + SCASSERT(scene != nullptr); + Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); + + try + { + quint32 id = 0; + + ToolsCommonAttributes(domElement, id); + const quint32 point1 = GetParametrUInt(domElement, AttrPoint1, NULL_ID_STR); + const quint32 point4 = GetParametrUInt(domElement, AttrPoint4, NULL_ID_STR); + + const QString angle1 = GetParametrString(domElement, AttrAngle1, "0"); + QString a1 = angle1;//need for saving fixed formula; + + const QString angle2 = GetParametrString(domElement, AttrAngle2, "0"); + QString a2 = angle2;//need for saving fixed formula; + + const QString length1 = GetParametrString(domElement, AttrLength1, "0"); + QString l1 = length1;//need for saving fixed formula; + + const QString length2 = GetParametrString(domElement, AttrLength2, "0"); + QString l2 = length2;//need for saving fixed formula; + + const qreal kCurve = GetParametrDouble(domElement, AttrKCurve, "1.0"); + const QString color = GetParametrString(domElement, AttrColor, ColorBlack); + const quint32 duplicate = GetParametrUInt(domElement, AttrDuplicate, "0"); + + VToolSpline::Create(id, point1, point4, a1, a2, l1, l2, kCurve, duplicate, color, scene, this, data, parse, + Source::FromFile); + //Rewrite attribute formula. Need for situation when we have wrong formula. + if (a1 != angle1 || a2 != angle2 || l1 != length1 || l2 != length2) + { + SetAttribute(domElement, AttrAngle1, a1); + SetAttribute(domElement, AttrAngle2, a2); + SetAttribute(domElement, AttrLength1, l1); + SetAttribute(domElement, AttrLength2, l2); + modified = true; + haveLiteChange(); + } + } + catch (const VExceptionBadId &e) + { + VExceptionObjectError excep(tr("Error creating or updating simple curve"), domElement); + excep.AddMoreInformation(e.ErrorMessage()); + throw excep; + } + catch (qmu::QmuParserError &e) + { + VExceptionObjectError excep(tr("Error creating or updating simple interactive spline"), domElement); + excep.AddMoreInformation(QString("Message: " + e.GetMsg() + "\n"+ "Expression: " + e.GetExpr())); + throw excep; + } +} + //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse) { @@ -2217,32 +2275,37 @@ void VPattern::GarbageCollector() * @param parse parser file mode. * @param type type of spline. */ -void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement &domElement, +void VPattern::ParseSplineElement(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse, const QString &type) { SCASSERT(scene != nullptr); Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null"); Q_ASSERT_X(type.isEmpty() == false, Q_FUNC_INFO, "type of spline is empty"); - QStringList splines = QStringList() << VToolSpline::ToolType /*0*/ - << VToolSplinePath::ToolType /*1*/ - << VNodeSpline::ToolType /*2*/ - << VNodeSplinePath::ToolType; /*3*/ + QStringList splines = QStringList() << VToolSpline::OldToolType /*0*/ + << VToolSpline::ToolType /*1*/ + << VToolSplinePath::ToolType /*2*/ + << VNodeSpline::ToolType /*3*/ + << VNodeSplinePath::ToolType; /*4*/ switch (splines.indexOf(type)) { - case 0: //VToolSpline::ToolType + case 0: //VToolSpline::OldToolType + qCDebug(vXML, "VToolSpline."); + ParseOldToolSpline(scene, domElement, parse);// TODO. Delete if minimal supported version is 0.2.7 + break; + case 1: //VToolSpline::ToolType qCDebug(vXML, "VToolSpline."); ParseToolSpline(scene, domElement, parse); break; - case 1: //VToolSplinePath::ToolType + case 2: //VToolSplinePath::ToolType qCDebug(vXML, "VToolSplinePath."); ParseToolSplinePath(scene, domElement, parse); break; - case 2: //VNodeSpline::ToolType + case 3: //VNodeSpline::ToolType qCDebug(vXML, "VNodeSpline."); ParseNodeSpline(domElement, parse); break; - case 3: //VNodeSplinePath::ToolType + case 4: //VNodeSplinePath::ToolType qCDebug(vXML, "VNodeSplinePath."); ParseNodeSplinePath(domElement, parse); break; diff --git a/src/app/valentina/xml/vpattern.h b/src/app/valentina/xml/vpattern.h index 108fd5e46..c6ba1b231 100644 --- a/src/app/valentina/xml/vpattern.h +++ b/src/app/valentina/xml/vpattern.h @@ -119,7 +119,7 @@ private: const Document &parse, const QString &type); void ParseLineElement(VMainGraphicsScene *scene, const QDomElement& domElement, const Document &parse); - void ParseSplineElement(VMainGraphicsScene *scene, const QDomElement& domElement, + void ParseSplineElement(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse, const QString& type); void ParseArcElement(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse, const QString& type); @@ -167,7 +167,10 @@ private: const Document &parse); void ParseToolTrueDarts(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse); - void ParseToolSpline(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse); + // TODO. Delete if minimal supported version is 0.2.7 + void ParseOldToolSpline(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse); + + void ParseToolSpline(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse); void ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse); void ParseNodeSpline(const QDomElement &domElement, const Document &parse); void ParseNodeSplinePath(const QDomElement &domElement, const Document &parse); diff --git a/src/libs/ifc/ifcdef.cpp b/src/libs/ifc/ifcdef.cpp index e086d1c20..e79ebba23 100644 --- a/src/libs/ifc/ifcdef.cpp +++ b/src/libs/ifc/ifcdef.cpp @@ -89,6 +89,8 @@ const QString AttrRadius = QStringLiteral("radius"); const QString AttrAngle = QStringLiteral("angle"); const QString AttrAngle1 = QStringLiteral("angle1"); const QString AttrAngle2 = QStringLiteral("angle2"); +const QString AttrLength1 = QStringLiteral("length1"); +const QString AttrLength2 = QStringLiteral("length2"); const QString AttrP1Line = QStringLiteral("p1Line"); const QString AttrP2Line = QStringLiteral("p2Line"); const QString AttrP1Line1 = QStringLiteral("p1Line1"); diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index 8553e8d15..0e28af2dc 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -91,6 +91,8 @@ extern const QString AttrRadius; extern const QString AttrAngle; extern const QString AttrAngle1; extern const QString AttrAngle2; +extern const QString AttrLength1; +extern const QString AttrLength2; extern const QString AttrP1Line; extern const QString AttrP2Line; extern const QString AttrP1Line1; @@ -101,8 +103,8 @@ extern const QString AttrPShoulder; extern const QString AttrPoint1; extern const QString AttrPoint2; extern const QString AttrPoint4; -extern const QString AttrKAsm1; -extern const QString AttrKAsm2; +extern const QString AttrKAsm1;// TODO. Delete if minimal supported version is 0.2.7 +extern const QString AttrKAsm2;// TODO. Delete if minimal supported version is 0.2.7 extern const QString AttrKCurve; extern const QString AttrDuplicate; extern const QString AttrPathPoint; diff --git a/src/libs/ifc/schema.qrc b/src/libs/ifc/schema.qrc index 24a646a18..1fe74a4c7 100644 --- a/src/libs/ifc/schema.qrc +++ b/src/libs/ifc/schema.qrc @@ -12,6 +12,7 @@ schema/pattern/v0.2.4.xsd schema/pattern/v0.2.5.xsd schema/pattern/v0.2.6.xsd + schema/pattern/v0.2.7.xsd schema/standard_measurements/v0.3.0.xsd schema/standard_measurements/v0.4.0.xsd schema/standard_measurements/v0.4.1.xsd diff --git a/src/libs/ifc/schema/pattern/v0.2.7.xsd b/src/libs/ifc/schema/pattern/v0.2.7.xsd new file mode 100644 index 000000000..0221f3b68 --- /dev/null +++ b/src/libs/ifc/schema/pattern/v0.2.7.xsd @@ -0,0 +1,437 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libs/ifc/xml/vpatternconverter.cpp b/src/libs/ifc/xml/vpatternconverter.cpp index 4814337dd..f725d1d65 100644 --- a/src/libs/ifc/xml/vpatternconverter.cpp +++ b/src/libs/ifc/xml/vpatternconverter.cpp @@ -43,8 +43,8 @@ */ const QString VPatternConverter::PatternMinVerStr = QStringLiteral("0.1.0"); -const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.2.6"); -const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.2.6.xsd"); +const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.2.7"); +const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.2.7.xsd"); //--------------------------------------------------------------------------------------------------------------------- VPatternConverter::VPatternConverter(const QString &fileName) @@ -109,6 +109,8 @@ QString VPatternConverter::XSDSchema(int ver) const case (0x000205): return QStringLiteral("://schema/pattern/v0.2.5.xsd"); case (0x000206): + return QStringLiteral("://schema/pattern/v0.2.6.xsd"); + case (0x000207): return CurrentSchema; default: InvalidVersion(ver); @@ -201,6 +203,13 @@ void VPatternConverter::ApplyPatches() V_FALLTHROUGH } case (0x000206): + { + ToV0_2_7(); + const QString schema = XSDSchema(0x000207); + ValidateXML(schema, fileName); + V_FALLTHROUGH + } + case (0x000207): break; default: break; @@ -315,6 +324,13 @@ void VPatternConverter::ToV0_2_6() Save(); } +//--------------------------------------------------------------------------------------------------------------------- +void VPatternConverter::ToV0_2_7() +{ + SetVersion(QStringLiteral("0.2.7")); + Save(); +} + //--------------------------------------------------------------------------------------------------------------------- void VPatternConverter::TagUnitToV0_2_0() { diff --git a/src/libs/ifc/xml/vpatternconverter.h b/src/libs/ifc/xml/vpatternconverter.h index 7b6f76bb2..d1a0be553 100644 --- a/src/libs/ifc/xml/vpatternconverter.h +++ b/src/libs/ifc/xml/vpatternconverter.h @@ -67,6 +67,7 @@ private: void ToV0_2_4(); void ToV0_2_5(); void ToV0_2_6(); + void ToV0_2_7(); void TagUnitToV0_2_0(); void TagIncrementToV0_2_0(); diff --git a/src/libs/vgeometry/vspline_p.h b/src/libs/vgeometry/vspline_p.h index 3ce66d267..018c17bcc 100644 --- a/src/libs/vgeometry/vspline_p.h +++ b/src/libs/vgeometry/vspline_p.h @@ -30,10 +30,12 @@ #define VSPLINE_P_H #include -#include "vpointf.h" #include #include +#include "vpointf.h" +#include "../vmisc/vabstractapplication.h" + #ifdef Q_CC_GNU #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Weffc++" @@ -139,12 +141,12 @@ VSplineData::VSplineData(VPointF p1, VPointF p4, qreal angle1, qreal angle2, qre QLineF p1p2(p1.x(), p1.y(), p1.x() + L * kAsm1, p1.y()); p1p2.setAngle(angle1); c1Length = p1p2.length(); - c1LengthF = QString().number(c1Length); + c1LengthF = QString().number(qApp->fromPixel(c1Length)); QLineF p4p3(p4.x(), p4.y(), p4.x() + L * kAsm2, p4.y()); p4p3.setAngle(angle2); c2Length = p4p3.length(); - c2LengthF = QString().number(c2Length); + c2LengthF = QString().number(qApp->fromPixel(c2Length)); } //--------------------------------------------------------------------------------------------------------------------- @@ -167,7 +169,7 @@ VSplineData::VSplineData(VPointF p1, QPointF p2, QPointF p3, VPointF p4, qreal k angle1F = QString().number(angle1); c1Length = p1p2.length(); - c1LengthF = QString().number(c1Length); + c1LengthF = QString().number(qApp->fromPixel(c1Length)); QLineF p4p3(p4.toQPointF(), p3); @@ -175,7 +177,7 @@ VSplineData::VSplineData(VPointF p1, QPointF p2, QPointF p3, VPointF p4, qreal k angle2F = QString().number(angle2); c2Length = p4p3.length(); - c2LengthF = QString().number(c2Length); + c2LengthF = QString().number(qApp->fromPixel(c2Length)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp index c58ec1290..6b3b6a5c9 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp @@ -39,7 +39,8 @@ # include #endif -const QString VToolSpline::ToolType = QStringLiteral("simple"); +const QString VToolSpline::ToolType = QStringLiteral("simpleInteractive"); +const QString VToolSpline::OldToolType = QStringLiteral("simple"); //--------------------------------------------------------------------------------------------------------------------- /** @@ -124,8 +125,8 @@ VToolSpline* VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, auto dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - auto spl = Create(0, dialogTool->GetSpline(), dialogTool->GetColor(), scene, doc, data, Document::FullParse, - Source::FromGui); + auto spl = Create(0, new VSpline(dialogTool->GetSpline()), dialogTool->GetColor(), scene, doc, data, + Document::FullParse, Source::FromGui); if (spl != nullptr) { @@ -138,7 +139,7 @@ VToolSpline* VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, /** * @brief Create help create tool. * @param _id tool id, 0 if tool doesn't exist yet. - * @param spl spline. + * @param spline spline. * @param color spline color. * @param scene pointer to scene. * @param doc dom document container. @@ -147,11 +148,10 @@ VToolSpline* VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, * @param typeCreation way we create this tool. * @return the created tool */ -VToolSpline* VToolSpline::Create(const quint32 _id, const VSpline &spl, const QString &color, VMainGraphicsScene *scene, +VToolSpline* VToolSpline::Create(const quint32 _id, VSpline *spline, const QString &color, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { - auto spline = new VSpline(spl); quint32 id = _id; if (typeCreation == Source::FromGui) { @@ -185,6 +185,30 @@ VToolSpline* VToolSpline::Create(const quint32 _id, const VSpline &spl, const QS return nullptr; } +//--------------------------------------------------------------------------------------------------------------------- +VToolSpline *VToolSpline::Create(const quint32 _id, quint32 point1, quint32 point4, QString &a1, QString &a2, + QString &l1, QString &l2, qreal kCurve, quint32 duplicate, const QString &color, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation) +{ + qreal calcAngle1 = CheckFormula(_id, a1, data); + qreal calcAngle2 = CheckFormula(_id, a2, data); + + qreal calcLength1 = qApp->toPixel(CheckFormula(_id, l1, data)); + qreal calcLength2 = qApp->toPixel(CheckFormula(_id, l2, data)); + + auto p1 = data->GeometricObject(point1); + auto p4 = data->GeometricObject(point4); + + auto spline = new VSpline(*p1, *p4, calcAngle1, a1, calcAngle2, a2, calcLength1, l1, calcLength2, l2, kCurve); + if (duplicate > 0) + { + spline->SetDuplicate(duplicate); + } + + return VToolSpline::Create(_id, spline, color, scene, doc, data, parse, typeCreation); +} + //--------------------------------------------------------------------------------------------------------------------- VSpline VToolSpline::getSpline() const { @@ -290,14 +314,8 @@ void VToolSpline::SaveDialog(QDomElement &domElement) controlPoints[0]->blockSignals(false); controlPoints[1]->blockSignals(false); - doc->SetAttribute(domElement, AttrPoint1, spl.GetP1().id()); - doc->SetAttribute(domElement, AttrPoint4, spl.GetP4().id()); - doc->SetAttribute(domElement, AttrAngle1, spl.GetStartAngle()); - doc->SetAttribute(domElement, AttrAngle2, spl.GetEndAngle()); - doc->SetAttribute(domElement, AttrKAsm1, spl.GetKasm1()); - doc->SetAttribute(domElement, AttrKAsm2, spl.GetKasm2()); - doc->SetAttribute(domElement, AttrKCurve, spl.GetKcurve()); - doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor()); + SetSplineAttributes(domElement, spl); + doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor()); } //--------------------------------------------------------------------------------------------------------------------- @@ -305,29 +323,9 @@ void VToolSpline::SaveOptions(QDomElement &tag, QSharedPointer &obj) { VAbstractSpline::SaveOptions(tag, obj); - QSharedPointer spl = qSharedPointerDynamicCast(obj); + auto spl = qSharedPointerDynamicCast(obj); SCASSERT(spl.isNull() == false); - - doc->SetAttribute(tag, AttrType, ToolType); - doc->SetAttribute(tag, AttrPoint1, spl->GetP1().id()); - doc->SetAttribute(tag, AttrPoint4, spl->GetP4().id()); - doc->SetAttribute(tag, AttrAngle1, spl->GetStartAngle()); - doc->SetAttribute(tag, AttrAngle2, spl->GetEndAngle()); - doc->SetAttribute(tag, AttrKAsm1, spl->GetKasm1()); - doc->SetAttribute(tag, AttrKAsm2, spl->GetKasm2()); - doc->SetAttribute(tag, AttrKCurve, spl->GetKcurve()); - - if (spl->GetDuplicate() > 0) - { - doc->SetAttribute(tag, AttrDuplicate, spl->GetDuplicate()); - } - else - { - if (tag.hasAttribute(AttrDuplicate)) - { - tag.removeAttribute(AttrDuplicate); - } - } + SetSplineAttributes(tag, *spl); } //--------------------------------------------------------------------------------------------------------------------- @@ -525,3 +523,42 @@ void VToolSpline::RefreshGeometry() point->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); } } + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSpline::SetSplineAttributes(QDomElement &domElement, const VSpline &spl) +{ + if (domElement.attribute(AttrType) == OldToolType) + { + doc->SetAttribute(domElement, AttrType, ToolType); + } + + doc->SetAttribute(domElement, AttrPoint1, spl.GetP1().id()); + doc->SetAttribute(domElement, AttrPoint4, spl.GetP4().id()); + doc->SetAttribute(domElement, AttrAngle1, spl.GetStartAngleFormula()); + doc->SetAttribute(domElement, AttrAngle2, spl.GetEndAngleFormula()); + doc->SetAttribute(domElement, AttrLength1, spl.GetC1LengthFormula()); + doc->SetAttribute(domElement, AttrLength2, spl.GetC2LengthFormula()); + doc->SetAttribute(domElement, AttrKCurve, spl.GetKcurve()); + + if (spl.GetDuplicate() > 0) + { + doc->SetAttribute(domElement, AttrDuplicate, spl.GetDuplicate()); + } + else + { + if (domElement.hasAttribute(AttrDuplicate)) + { + domElement.removeAttribute(AttrDuplicate); + } + } + + if (domElement.hasAttribute(AttrKAsm1)) + { + domElement.removeAttribute(AttrKAsm1); + } + + if (domElement.hasAttribute(AttrKAsm2)) + { + domElement.removeAttribute(AttrKAsm2); + } +} diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.h b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.h index 6d563b57b..fdbde89c3 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.h @@ -45,10 +45,15 @@ public: virtual ~VToolSpline() Q_DECL_OVERRIDE; virtual void setDialog() Q_DECL_OVERRIDE; static VToolSpline *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); - static VToolSpline *Create(const quint32 _id, const VSpline &spl, const QString &color, VMainGraphicsScene *scene, + static VToolSpline *Create(const quint32 _id, VSpline *spline, const QString &color, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); + static VToolSpline *Create(const quint32 _id, quint32 point1, quint32 point4, QString &a1, QString &a2, QString &l1, + QString &l2, qreal kCurve, quint32 duplicate, const QString &color, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation); static const QString ToolType; + static const QString OldToolType; virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::Spline)}; @@ -73,8 +78,10 @@ protected: virtual void SetVisualization() Q_DECL_OVERRIDE; private: Q_DISABLE_COPY(VToolSpline) - void RefreshGeometry (); QPointF oldPosition; + + void RefreshGeometry (); + void SetSplineAttributes(QDomElement &domElement, const VSpline &spl); }; #endif // VTOOLSPLINE_H