Refactoring. Use tag names from class VAbstractPattern.
--HG-- branch : feature
This commit is contained in:
parent
7dbba35919
commit
ac49d298f8
|
@ -305,8 +305,7 @@ quint32 VPattern::SPointActiveDraw()
|
||||||
const QDomElement domElement = domNode.toElement();
|
const QDomElement domElement = domNode.toElement();
|
||||||
if (domElement.isNull() == false)
|
if (domElement.isNull() == false)
|
||||||
{
|
{
|
||||||
if (domElement.tagName() == VToolSinglePoint::TagName &&
|
if (domElement.tagName() == TagPoint && domElement.attribute(AttrType, "") == VToolBasePoint::ToolType)
|
||||||
domElement.attribute(AttrType, "") == VToolBasePoint::ToolType)
|
|
||||||
{
|
{
|
||||||
return GetParametrId(domElement);
|
return GetParametrId(domElement);
|
||||||
}
|
}
|
||||||
|
@ -658,7 +657,7 @@ void VPattern::ParseDetails(const QDomElement &domElement, const Document &parse
|
||||||
const QDomElement domElement = domNode.toElement();
|
const QDomElement domElement = domNode.toElement();
|
||||||
if (domElement.isNull() == false)
|
if (domElement.isNull() == false)
|
||||||
{
|
{
|
||||||
if (domElement.tagName() == VToolDetail::TagName)
|
if (domElement.tagName() == TagDetail)
|
||||||
{
|
{
|
||||||
ParseDetailElement(domElement, parse);
|
ParseDetailElement(domElement, parse);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@ const QString VAbstractPattern::TagPattern = QStringLiteral("pattern");
|
||||||
const QString VAbstractPattern::TagCalculation = QStringLiteral("calculation");
|
const QString VAbstractPattern::TagCalculation = QStringLiteral("calculation");
|
||||||
const QString VAbstractPattern::TagModeling = QStringLiteral("modeling");
|
const QString VAbstractPattern::TagModeling = QStringLiteral("modeling");
|
||||||
const QString VAbstractPattern::TagDetails = QStringLiteral("details");
|
const QString VAbstractPattern::TagDetails = QStringLiteral("details");
|
||||||
|
const QString VAbstractPattern::TagDetail = QStringLiteral("detail");
|
||||||
const QString VAbstractPattern::TagAuthor = QStringLiteral("author");
|
const QString VAbstractPattern::TagAuthor = QStringLiteral("author");
|
||||||
const QString VAbstractPattern::TagDescription = QStringLiteral("description");
|
const QString VAbstractPattern::TagDescription = QStringLiteral("description");
|
||||||
const QString VAbstractPattern::TagNotes = QStringLiteral("notes");
|
const QString VAbstractPattern::TagNotes = QStringLiteral("notes");
|
||||||
|
|
|
@ -132,6 +132,7 @@ public:
|
||||||
static const QString TagCalculation;
|
static const QString TagCalculation;
|
||||||
static const QString TagModeling;
|
static const QString TagModeling;
|
||||||
static const QString TagDetails;
|
static const QString TagDetails;
|
||||||
|
static const QString TagDetail;
|
||||||
static const QString TagAuthor;
|
static const QString TagAuthor;
|
||||||
static const QString TagDescription;
|
static const QString TagDescription;
|
||||||
static const QString TagImage;
|
static const QString TagImage;
|
||||||
|
|
|
@ -32,8 +32,6 @@
|
||||||
|
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
|
|
||||||
const QString VAbstractSpline::TagName = QStringLiteral("spline");
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VAbstractSpline::VAbstractSpline(VAbstractPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent)
|
VAbstractSpline::VAbstractSpline(VAbstractPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent)
|
||||||
:VDrawTool(doc, data, id), QGraphicsPathItem(parent), controlPoints(QVector<VControlPointSpline *>()),
|
:VDrawTool(doc, data, id), QGraphicsPathItem(parent), controlPoints(QVector<VControlPointSpline *>()),
|
||||||
|
@ -49,7 +47,7 @@ VAbstractSpline::~VAbstractSpline()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString VAbstractSpline::getTagName() const
|
QString VAbstractSpline::getTagName() const
|
||||||
{
|
{
|
||||||
return VAbstractSpline::TagName;
|
return VAbstractPattern::TagSpline;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -42,8 +42,7 @@ class VAbstractSpline:public VDrawTool, public QGraphicsPathItem
|
||||||
public:
|
public:
|
||||||
VAbstractSpline(VAbstractPattern *doc, VContainer *data, quint32 id, QGraphicsItem * parent = nullptr);
|
VAbstractSpline(VAbstractPattern *doc, VContainer *data, quint32 id, QGraphicsItem * parent = nullptr);
|
||||||
virtual ~VAbstractSpline() Q_DECL_OVERRIDE;
|
virtual ~VAbstractSpline() Q_DECL_OVERRIDE;
|
||||||
// cppcheck-suppress duplInheritedMember
|
|
||||||
static const QString TagName;
|
|
||||||
virtual int type() const Q_DECL_OVERRIDE {return Type;}
|
virtual int type() const Q_DECL_OVERRIDE {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Tool::AbstractSpline)};
|
enum { Type = UserType + static_cast<int>(Tool::AbstractSpline)};
|
||||||
virtual QString getTagName() const Q_DECL_OVERRIDE;
|
virtual QString getTagName() const Q_DECL_OVERRIDE;
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
|
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
|
|
||||||
const QString VToolArc::TagName = QStringLiteral("arc");
|
|
||||||
const QString VToolArc::ToolType = QStringLiteral("simple");
|
const QString VToolArc::ToolType = QStringLiteral("simple");
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -165,7 +164,7 @@ VToolArc* VToolArc::Create(const quint32 _id, const quint32 ¢er, QString &ra
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString VToolArc::getTagName() const
|
QString VToolArc::getTagName() const
|
||||||
{
|
{
|
||||||
return VToolArc::TagName;
|
return VAbstractPattern::TagArc;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -45,7 +45,7 @@ public:
|
||||||
static VToolArc* Create(const quint32 _id, const quint32 ¢er, QString &radius, QString &f1, QString &f2,
|
static VToolArc* Create(const quint32 _id, const quint32 ¢er, QString &radius, QString &f1, QString &f2,
|
||||||
const QString &color, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
|
const QString &color, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
|
||||||
const Document &parse, const Source &typeCreation);
|
const Document &parse, const Source &typeCreation);
|
||||||
static const QString TagName;
|
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
virtual int type() const Q_DECL_OVERRIDE {return Type;}
|
virtual int type() const Q_DECL_OVERRIDE {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Tool::Arc)};
|
enum { Type = UserType + static_cast<int>(Tool::Arc)};
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
|
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
|
|
||||||
const QString VToolArcWithLength::TagName = QStringLiteral("arc");
|
|
||||||
const QString VToolArcWithLength::ToolType = QStringLiteral("arcWithLength");
|
const QString VToolArcWithLength::ToolType = QStringLiteral("arcWithLength");
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -134,7 +133,7 @@ VToolArcWithLength *VToolArcWithLength::Create(const quint32 _id, const quint32
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString VToolArcWithLength::getTagName() const
|
QString VToolArcWithLength::getTagName() const
|
||||||
{
|
{
|
||||||
return VToolArcWithLength::TagName;
|
return VAbstractPattern::TagArc;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -44,7 +44,7 @@ public:
|
||||||
QString &length, const QString &color, VMainGraphicsScene *scene,
|
QString &length, const QString &color, VMainGraphicsScene *scene,
|
||||||
VAbstractPattern *doc,
|
VAbstractPattern *doc,
|
||||||
VContainer *data, const Document &parse, const Source &typeCreation);
|
VContainer *data, const Document &parse, const Source &typeCreation);
|
||||||
static const QString TagName;
|
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
virtual int type() const Q_DECL_OVERRIDE {return Type;}
|
virtual int type() const Q_DECL_OVERRIDE {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Tool::ArcWithLength)};
|
enum { Type = UserType + static_cast<int>(Tool::ArcWithLength)};
|
||||||
|
|
|
@ -125,7 +125,7 @@ void VToolBasePoint::AddToFile()
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(not namePP.isEmpty(), Q_FUNC_INFO, "name pattern piece is empty");
|
Q_ASSERT_X(not namePP.isEmpty(), Q_FUNC_INFO, "name pattern piece is empty");
|
||||||
|
|
||||||
QDomElement sPoint = doc->createElement(TagName);
|
QDomElement sPoint = doc->createElement(getTagName());
|
||||||
|
|
||||||
// Create SPoint tag
|
// Create SPoint tag
|
||||||
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
||||||
|
|
|
@ -29,8 +29,6 @@
|
||||||
#include "vabstractpoint.h"
|
#include "vabstractpoint.h"
|
||||||
#include "../vgeometry/vpointf.h"
|
#include "../vgeometry/vpointf.h"
|
||||||
|
|
||||||
const QString VAbstractPoint::TagName = QStringLiteral("point");
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VAbstractPoint::VAbstractPoint(VAbstractPattern *doc, VContainer *data, quint32 id)
|
VAbstractPoint::VAbstractPoint(VAbstractPattern *doc, VContainer *data, quint32 id)
|
||||||
:VDrawTool(doc, data, id)
|
:VDrawTool(doc, data, id)
|
||||||
|
@ -43,7 +41,7 @@ VAbstractPoint::~VAbstractPoint()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString VAbstractPoint::getTagName() const
|
QString VAbstractPoint::getTagName() const
|
||||||
{
|
{
|
||||||
return VAbstractPoint::TagName;
|
return VAbstractPattern::TagPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -40,7 +40,6 @@ public:
|
||||||
virtual ~VAbstractPoint() Q_DECL_OVERRIDE;
|
virtual ~VAbstractPoint() Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
virtual QString getTagName() const Q_DECL_OVERRIDE;
|
virtual QString getTagName() const Q_DECL_OVERRIDE;
|
||||||
static const QString TagName;
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void ShowToolVisualization(bool show);
|
void ShowToolVisualization(bool show);
|
||||||
|
|
|
@ -33,8 +33,6 @@
|
||||||
#include "../../dialogs/tools/dialogline.h"
|
#include "../../dialogs/tools/dialogline.h"
|
||||||
#include "../../visualization/line/vistoolline.h"
|
#include "../../visualization/line/vistoolline.h"
|
||||||
|
|
||||||
const QString VToolLine::TagName = QStringLiteral("line");
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief VToolLine constructor.
|
* @brief VToolLine constructor.
|
||||||
|
@ -167,7 +165,7 @@ VToolLine * VToolLine::Create(const quint32 &_id, const quint32 &firstPoint, con
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString VToolLine::getTagName() const
|
QString VToolLine::getTagName() const
|
||||||
{
|
{
|
||||||
return VToolLine::TagName;
|
return VAbstractPattern::TagLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -249,7 +247,7 @@ void VToolLine::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
*/
|
*/
|
||||||
void VToolLine::AddToFile()
|
void VToolLine::AddToFile()
|
||||||
{
|
{
|
||||||
QDomElement domElement = doc->createElement(TagName);
|
QDomElement domElement = doc->createElement(getTagName());
|
||||||
QSharedPointer<VGObject> obj = QSharedPointer<VGObject> ();
|
QSharedPointer<VGObject> obj = QSharedPointer<VGObject> ();
|
||||||
SaveOptions(domElement, obj);
|
SaveOptions(domElement, obj);
|
||||||
AddToCalculation(domElement);
|
AddToCalculation(domElement);
|
||||||
|
|
|
@ -45,7 +45,6 @@ public:
|
||||||
const QString &typeLine, const QString &lineColor, VMainGraphicsScene *scene,
|
const QString &typeLine, const QString &lineColor, VMainGraphicsScene *scene,
|
||||||
VAbstractPattern *doc, VContainer *data, const Document &parse,
|
VAbstractPattern *doc, VContainer *data, const Document &parse,
|
||||||
const Source &typeCreation);
|
const Source &typeCreation);
|
||||||
static const QString TagName;
|
|
||||||
|
|
||||||
virtual int type() const Q_DECL_OVERRIDE {return Type;}
|
virtual int type() const Q_DECL_OVERRIDE {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Tool::Line)};
|
enum { Type = UserType + static_cast<int>(Tool::Line)};
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
#include <QGraphicsSceneMouseEvent>
|
#include <QGraphicsSceneMouseEvent>
|
||||||
#include <QPen>
|
#include <QPen>
|
||||||
|
|
||||||
const QString VNodeArc::TagName = QStringLiteral("arc");
|
|
||||||
const QString VNodeArc::ToolType = QStringLiteral("modeling");
|
const QString VNodeArc::ToolType = QStringLiteral("modeling");
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -94,7 +93,7 @@ void VNodeArc::Create(VAbstractPattern *doc, VContainer *data, quint32 id, quint
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString VNodeArc::getTagName() const
|
QString VNodeArc::getTagName() const
|
||||||
{
|
{
|
||||||
return VNodeArc::TagName;
|
return VAbstractPattern::TagArc;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -117,7 +116,7 @@ void VNodeArc::AllowSelecting(bool enabled)
|
||||||
*/
|
*/
|
||||||
void VNodeArc::AddToFile()
|
void VNodeArc::AddToFile()
|
||||||
{
|
{
|
||||||
QDomElement domElement = doc->createElement(TagName);
|
QDomElement domElement = doc->createElement(getTagName());
|
||||||
|
|
||||||
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
|
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
|
||||||
doc->SetAttribute(domElement, AttrType, ToolType);
|
doc->SetAttribute(domElement, AttrType, ToolType);
|
||||||
|
|
|
@ -41,7 +41,7 @@ class VNodeArc :public VAbstractNode
|
||||||
public:
|
public:
|
||||||
static void Create(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Document &parse,
|
static void Create(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Document &parse,
|
||||||
const Source &typeCreation, const quint32 &idTool = 0);
|
const Source &typeCreation, const quint32 &idTool = 0);
|
||||||
static const QString TagName;
|
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
virtual QString getTagName() const Q_DECL_OVERRIDE;
|
virtual QString getTagName() const Q_DECL_OVERRIDE;
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
#include <QBrush>
|
#include <QBrush>
|
||||||
#include <QGraphicsSceneMouseEvent>
|
#include <QGraphicsSceneMouseEvent>
|
||||||
|
|
||||||
const QString VNodePoint::TagName = QStringLiteral("point");
|
|
||||||
const QString VNodePoint::ToolType = QStringLiteral("modeling");
|
const QString VNodePoint::ToolType = QStringLiteral("modeling");
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -119,7 +118,7 @@ void VNodePoint::Create(VAbstractPattern *doc, VContainer *data, VMainGraphicsSc
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString VNodePoint::getTagName() const
|
QString VNodePoint::getTagName() const
|
||||||
{
|
{
|
||||||
return VNodePoint::TagName;
|
return VAbstractPattern::TagPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -195,7 +194,7 @@ void VNodePoint::FullUpdateFromFile()
|
||||||
void VNodePoint::AddToFile()
|
void VNodePoint::AddToFile()
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
QDomElement domElement = doc->createElement(TagName);
|
QDomElement domElement = doc->createElement(getTagName());
|
||||||
|
|
||||||
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
|
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
|
||||||
doc->SetAttribute(domElement, AttrType, ToolType);
|
doc->SetAttribute(domElement, AttrType, ToolType);
|
||||||
|
|
|
@ -47,7 +47,7 @@ public:
|
||||||
static void Create(VAbstractPattern *doc, VContainer *data, VMainGraphicsScene *scene,
|
static void Create(VAbstractPattern *doc, VContainer *data, VMainGraphicsScene *scene,
|
||||||
quint32 id, quint32 idPoint, const Document &parse,
|
quint32 id, quint32 idPoint, const Document &parse,
|
||||||
const Source &typeCreation, const quint32 &idTool = 0);
|
const Source &typeCreation, const quint32 &idTool = 0);
|
||||||
static const QString TagName;
|
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
virtual int type() const Q_DECL_OVERRIDE {return Type;}
|
virtual int type() const Q_DECL_OVERRIDE {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Tool::NodePoint)};
|
enum { Type = UserType + static_cast<int>(Tool::NodePoint)};
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
#include <QGraphicsSceneMouseEvent>
|
#include <QGraphicsSceneMouseEvent>
|
||||||
#include <QPen>
|
#include <QPen>
|
||||||
|
|
||||||
const QString VNodeSpline::TagName = QStringLiteral("spline");
|
|
||||||
const QString VNodeSpline::ToolType = QStringLiteral("modelingSpline");
|
const QString VNodeSpline::ToolType = QStringLiteral("modelingSpline");
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -98,7 +97,7 @@ VNodeSpline *VNodeSpline::Create(VAbstractPattern *doc, VContainer *data, quint3
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString VNodeSpline::getTagName() const
|
QString VNodeSpline::getTagName() const
|
||||||
{
|
{
|
||||||
return VNodeSpline::TagName;
|
return VAbstractPattern::TagSpline;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -121,7 +120,7 @@ void VNodeSpline::AllowSelecting(bool enabled)
|
||||||
*/
|
*/
|
||||||
void VNodeSpline::AddToFile()
|
void VNodeSpline::AddToFile()
|
||||||
{
|
{
|
||||||
QDomElement domElement = doc->createElement(TagName);
|
QDomElement domElement = doc->createElement(getTagName());
|
||||||
|
|
||||||
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
|
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
|
||||||
doc->SetAttribute(domElement, AttrType, ToolType);
|
doc->SetAttribute(domElement, AttrType, ToolType);
|
||||||
|
|
|
@ -42,7 +42,7 @@ public:
|
||||||
static VNodeSpline *Create(VAbstractPattern *doc, VContainer *data, quint32 id,
|
static VNodeSpline *Create(VAbstractPattern *doc, VContainer *data, quint32 id,
|
||||||
quint32 idSpline, const Document &parse,
|
quint32 idSpline, const Document &parse,
|
||||||
const Source &typeCreation, const quint32 &idTool = 0);
|
const Source &typeCreation, const quint32 &idTool = 0);
|
||||||
static const QString TagName;
|
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
virtual QString getTagName() const Q_DECL_OVERRIDE;
|
virtual QString getTagName() const Q_DECL_OVERRIDE;
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
#include <QGraphicsSceneMouseEvent>
|
#include <QGraphicsSceneMouseEvent>
|
||||||
#include <QPen>
|
#include <QPen>
|
||||||
|
|
||||||
const QString VNodeSplinePath::TagName = QStringLiteral("spline");
|
|
||||||
const QString VNodeSplinePath::ToolType = QStringLiteral("modelingPath");
|
const QString VNodeSplinePath::ToolType = QStringLiteral("modelingPath");
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -95,7 +94,7 @@ void VNodeSplinePath::Create(VAbstractPattern *doc, VContainer *data, quint32 id
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString VNodeSplinePath::getTagName() const
|
QString VNodeSplinePath::getTagName() const
|
||||||
{
|
{
|
||||||
return VNodeSplinePath::TagName;
|
return VAbstractPattern::TagSpline;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -118,7 +117,7 @@ void VNodeSplinePath::AllowSelecting(bool enabled)
|
||||||
*/
|
*/
|
||||||
void VNodeSplinePath::AddToFile()
|
void VNodeSplinePath::AddToFile()
|
||||||
{
|
{
|
||||||
QDomElement domElement = doc->createElement(TagName);
|
QDomElement domElement = doc->createElement(getTagName());
|
||||||
|
|
||||||
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
|
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
|
||||||
doc->SetAttribute(domElement, AttrType, ToolType);
|
doc->SetAttribute(domElement, AttrType, ToolType);
|
||||||
|
|
|
@ -42,7 +42,7 @@ public:
|
||||||
static void Create(VAbstractPattern *doc, VContainer *data, quint32 id,
|
static void Create(VAbstractPattern *doc, VContainer *data, quint32 id,
|
||||||
quint32 idSpline, const Document &parse,
|
quint32 idSpline, const Document &parse,
|
||||||
const Source &typeCreation, const quint32 &idTool = 0);
|
const Source &typeCreation, const quint32 &idTool = 0);
|
||||||
static const QString TagName;
|
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
virtual QString getTagName() const Q_DECL_OVERRIDE;
|
virtual QString getTagName() const Q_DECL_OVERRIDE;
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -47,8 +47,6 @@
|
||||||
#include <QGraphicsView>
|
#include <QGraphicsView>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
|
|
||||||
const QString VToolDetail::TagName = QStringLiteral("detail");
|
|
||||||
const QString VToolDetail::TagNode = QStringLiteral("node");
|
const QString VToolDetail::TagNode = QStringLiteral("node");
|
||||||
|
|
||||||
const QString VToolDetail::AttrSupplement = QStringLiteral("supplement");
|
const QString VToolDetail::AttrSupplement = QStringLiteral("supplement");
|
||||||
|
@ -315,7 +313,7 @@ void VToolDetail::FullUpdateFromGuiOk(int result)
|
||||||
void VToolDetail::AddToFile()
|
void VToolDetail::AddToFile()
|
||||||
{
|
{
|
||||||
VDetail detail = VAbstractTool::data.GetDetail(id);
|
VDetail detail = VAbstractTool::data.GetDetail(id);
|
||||||
QDomElement domElement = doc->createElement(TagName);
|
QDomElement domElement = doc->createElement(getTagName());
|
||||||
|
|
||||||
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
|
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
|
||||||
doc->SetAttribute(domElement, AttrName, detail.getName());
|
doc->SetAttribute(domElement, AttrName, detail.getName());
|
||||||
|
@ -619,7 +617,7 @@ void VToolDetail::AddNode(VAbstractPattern *doc, QDomElement &domElement, const
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString VToolDetail::getTagName() const
|
QString VToolDetail::getTagName() const
|
||||||
{
|
{
|
||||||
return VToolDetail::TagName;
|
return VAbstractPattern::TagDetail;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -64,7 +64,6 @@ public:
|
||||||
static void Create(const quint32 &_id, const VDetail &newDetail, VMainGraphicsScene *scene,
|
static void Create(const quint32 &_id, const VDetail &newDetail, VMainGraphicsScene *scene,
|
||||||
VAbstractPattern *doc, VContainer *data, const Document &parse,
|
VAbstractPattern *doc, VContainer *data, const Document &parse,
|
||||||
const Source &typeCreation, const QString &drawName = QString());
|
const Source &typeCreation, const QString &drawName = QString());
|
||||||
static const QString TagName;
|
|
||||||
static const QString TagNode;
|
static const QString TagNode;
|
||||||
static const QString AttrSupplement;
|
static const QString AttrSupplement;
|
||||||
static const QString AttrClosed;
|
static const QString AttrClosed;
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
|
|
||||||
#include <QUndoStack>
|
#include <QUndoStack>
|
||||||
|
|
||||||
const QString VToolUnionDetails::TagName = QStringLiteral("tools");
|
|
||||||
const QString VToolUnionDetails::ToolType = QStringLiteral("unionDetails");
|
const QString VToolUnionDetails::ToolType = QStringLiteral("unionDetails");
|
||||||
const QString VToolUnionDetails::TagDetail = QStringLiteral("det");
|
const QString VToolUnionDetails::TagDetail = QStringLiteral("det");
|
||||||
const QString VToolUnionDetails::TagNode = QStringLiteral("node");
|
const QString VToolUnionDetails::TagNode = QStringLiteral("node");
|
||||||
|
@ -439,7 +438,7 @@ void VToolUnionDetails::BiasRotatePoint(VPointF *point, const qreal &dx, const q
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString VToolUnionDetails::getTagName() const
|
QString VToolUnionDetails::getTagName() const
|
||||||
{
|
{
|
||||||
return VToolUnionDetails::TagName;
|
return VAbstractPattern::TagTools;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -778,7 +777,7 @@ QVector<VDetail> VToolUnionDetails::GetDetailFromFile(VAbstractPattern *doc, con
|
||||||
*/
|
*/
|
||||||
void VToolUnionDetails::AddToFile()
|
void VToolUnionDetails::AddToFile()
|
||||||
{
|
{
|
||||||
QDomElement domElement = doc->createElement(TagName);
|
QDomElement domElement = doc->createElement(getTagName());
|
||||||
|
|
||||||
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
|
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
|
||||||
doc->SetAttribute(domElement, AttrType, ToolType);
|
doc->SetAttribute(domElement, AttrType, ToolType);
|
||||||
|
|
|
@ -56,7 +56,7 @@ public:
|
||||||
static void PointsOnEdge(const VDetail &d, const quint32 &index, VPointF &p1, VPointF &p2, VContainer *data);
|
static void PointsOnEdge(const VDetail &d, const quint32 &index, VPointF &p1, VPointF &p2, VContainer *data);
|
||||||
static void FindIndexJ(const qint32 &pointsD2, const VDetail &d2, const quint32 &indexD2, qint32 &j);
|
static void FindIndexJ(const qint32 &pointsD2, const VDetail &d2, const quint32 &indexD2, qint32 &j);
|
||||||
static QVector<VDetail> GetDetailFromFile(VAbstractPattern *doc, const QDomElement &domElement);
|
static QVector<VDetail> GetDetailFromFile(VAbstractPattern *doc, const QDomElement &domElement);
|
||||||
static const QString TagName;
|
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
static const QString TagDetail;
|
static const QString TagDetail;
|
||||||
static const QString TagNode;
|
static const QString TagNode;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user