2014-12-11 16:12:16 +01:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file vpatternconverter.h
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 11 12, 2014
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
2017-10-05 11:20:01 +02:00
|
|
|
** This source code is part of the Valentina project, a pattern making
|
2014-12-11 16:12:16 +01:00
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
2015-02-27 11:27:48 +01:00
|
|
|
** Copyright (C) 2013-2015 Valentina project
|
2014-12-11 16:12:16 +01:00
|
|
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
|
|
|
**
|
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
** (at your option) any later version.
|
|
|
|
**
|
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
**
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
#ifndef VPATTERNCONVERTER_H
|
|
|
|
#define VPATTERNCONVERTER_H
|
|
|
|
|
2016-08-08 13:44:49 +02:00
|
|
|
#include <qcompilerdetection.h>
|
|
|
|
#include <QCoreApplication>
|
|
|
|
#include <QDomElement>
|
|
|
|
#include <QMap>
|
|
|
|
#include <QSet>
|
|
|
|
#include <QString>
|
|
|
|
#include <QStringList>
|
|
|
|
#include <QVector>
|
|
|
|
#include <QtGlobal>
|
|
|
|
|
2014-12-11 16:12:16 +01:00
|
|
|
#include "vabstractconverter.h"
|
|
|
|
|
2016-08-08 13:44:49 +02:00
|
|
|
class QDomElement;
|
|
|
|
|
2014-12-11 16:12:16 +01:00
|
|
|
class VPatternConverter : public VAbstractConverter
|
|
|
|
{
|
2014-12-31 13:28:08 +01:00
|
|
|
Q_DECLARE_TR_FUNCTIONS(VPatternConverter)
|
2014-12-11 16:12:16 +01:00
|
|
|
public:
|
2015-10-12 13:52:48 +02:00
|
|
|
explicit VPatternConverter(const QString &fileName);
|
2017-04-01 16:27:55 +02:00
|
|
|
virtual ~VPatternConverter() Q_DECL_EQ_DEFAULT;
|
2014-12-11 16:12:16 +01:00
|
|
|
|
2016-07-07 17:04:26 +02:00
|
|
|
static const QString PatternMaxVerStr;
|
|
|
|
static const QString CurrentSchema;
|
2018-07-26 20:44:37 +02:00
|
|
|
static Q_DECL_CONSTEXPR const int PatternMinVer = FORMAT_VERSION(0, 1, 4);
|
2019-12-13 09:51:29 +01:00
|
|
|
static Q_DECL_CONSTEXPR const int PatternMaxVer = FORMAT_VERSION(0, 8, 6);
|
2014-12-11 20:44:48 +01:00
|
|
|
|
|
|
|
protected:
|
2018-06-26 14:53:48 +02:00
|
|
|
virtual int MinVer() const override;
|
|
|
|
virtual int MaxVer() const override;
|
2014-12-11 20:44:48 +01:00
|
|
|
|
2018-06-26 14:53:48 +02:00
|
|
|
virtual QString MinVerStr() const override;
|
|
|
|
virtual QString MaxVerStr() const override;
|
2014-12-11 21:16:03 +01:00
|
|
|
|
2018-06-26 14:53:48 +02:00
|
|
|
virtual QString XSDSchema(int ver) const override;
|
|
|
|
virtual void ApplyPatches() override;
|
|
|
|
virtual void DowngradeToCurrentMaxVersion() override;
|
2014-12-11 21:16:03 +01:00
|
|
|
|
2018-06-26 14:53:48 +02:00
|
|
|
virtual bool IsReadOnly() const override;
|
2017-02-04 12:28:47 +01:00
|
|
|
|
2014-12-11 20:44:48 +01:00
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY(VPatternConverter)
|
2016-07-07 17:04:26 +02:00
|
|
|
static const QString PatternMinVerStr;
|
2014-12-16 08:42:24 +01:00
|
|
|
|
2015-08-26 16:20:23 +02:00
|
|
|
void ToV0_2_0();
|
2015-11-11 15:26:48 +01:00
|
|
|
void ToV0_2_1();
|
2015-12-11 15:19:11 +01:00
|
|
|
void ToV0_2_2();
|
2015-12-26 14:08:41 +01:00
|
|
|
void ToV0_2_3();
|
2016-01-07 17:43:08 +01:00
|
|
|
void ToV0_2_4();
|
2016-01-22 11:45:18 +01:00
|
|
|
void ToV0_2_5();
|
2016-02-16 14:38:08 +01:00
|
|
|
void ToV0_2_6();
|
2016-02-26 15:38:42 +01:00
|
|
|
void ToV0_2_7();
|
2016-04-07 18:56:41 +02:00
|
|
|
void ToV0_3_0();
|
2016-05-13 19:33:52 +02:00
|
|
|
void ToV0_3_1();
|
2016-06-26 13:45:39 +02:00
|
|
|
void ToV0_3_2();
|
2016-07-24 19:48:31 +02:00
|
|
|
void ToV0_3_3();
|
2016-09-06 12:24:52 +02:00
|
|
|
void ToV0_3_4();
|
2016-09-13 10:27:44 +02:00
|
|
|
void ToV0_3_5();
|
2016-10-04 16:34:37 +02:00
|
|
|
void ToV0_3_6();
|
2016-10-16 20:38:29 +02:00
|
|
|
void ToV0_3_7();
|
2016-10-25 00:53:01 +02:00
|
|
|
void ToV0_3_8();
|
2016-12-19 14:14:13 +01:00
|
|
|
void ToV0_3_9();
|
2016-11-08 15:32:18 +01:00
|
|
|
void ToV0_4_0();
|
2017-02-01 13:18:45 +01:00
|
|
|
void ToV0_4_1();
|
2017-02-22 13:48:48 +01:00
|
|
|
void ToV0_4_2();
|
2017-03-09 12:10:46 +01:00
|
|
|
void ToV0_4_3();
|
2017-03-10 18:14:14 +01:00
|
|
|
void ToV0_4_4();
|
2017-03-21 16:18:48 +01:00
|
|
|
void ToV0_4_5();
|
2017-03-24 13:48:07 +01:00
|
|
|
void ToV0_4_6();
|
2017-04-05 12:22:33 +02:00
|
|
|
void ToV0_4_7();
|
2017-04-25 10:42:08 +02:00
|
|
|
void ToV0_4_8();
|
2017-05-16 12:07:53 +02:00
|
|
|
void ToV0_5_0();
|
2017-07-20 16:38:56 +02:00
|
|
|
void ToV0_5_1();
|
2017-08-15 10:17:54 +02:00
|
|
|
void ToV0_6_0();
|
2017-08-30 07:55:07 +02:00
|
|
|
void ToV0_6_1();
|
2017-09-02 13:47:44 +02:00
|
|
|
void ToV0_6_2();
|
2017-09-17 18:52:18 +02:00
|
|
|
void ToV0_6_3();
|
2017-09-26 11:54:52 +02:00
|
|
|
void ToV0_6_4();
|
2017-09-28 20:18:13 +02:00
|
|
|
void ToV0_6_5();
|
2017-10-11 12:51:06 +02:00
|
|
|
void ToV0_6_6();
|
2017-10-15 11:25:20 +02:00
|
|
|
void ToV0_7_0();
|
2017-10-27 10:53:35 +02:00
|
|
|
void ToV0_7_1();
|
2017-11-13 18:39:11 +01:00
|
|
|
void ToV0_7_2();
|
2017-11-17 11:28:57 +01:00
|
|
|
void ToV0_7_3();
|
2017-12-17 14:06:46 +01:00
|
|
|
void ToV0_7_4();
|
2018-01-03 18:31:50 +01:00
|
|
|
void ToV0_7_5();
|
2018-02-04 11:35:27 +01:00
|
|
|
void ToV0_7_6();
|
2018-03-05 11:05:59 +01:00
|
|
|
void ToV0_7_7();
|
2018-03-25 16:43:28 +02:00
|
|
|
void ToV0_7_8();
|
2018-07-20 09:30:05 +02:00
|
|
|
void ToV0_7_9();
|
2018-07-26 19:00:24 +02:00
|
|
|
void ToV0_7_10();
|
2018-09-24 13:44:45 +02:00
|
|
|
void ToV0_7_11();
|
2018-09-29 18:47:32 +02:00
|
|
|
void ToV0_7_12();
|
2018-11-30 16:47:29 +01:00
|
|
|
void ToV0_7_13();
|
2019-01-14 16:38:59 +01:00
|
|
|
void ToV0_8_0();
|
2019-01-24 08:26:57 +01:00
|
|
|
void ToV0_8_1();
|
2019-03-27 08:46:08 +01:00
|
|
|
void ToV0_8_2();
|
2019-04-17 12:02:22 +02:00
|
|
|
void ToV0_8_3();
|
2019-04-23 16:42:09 +02:00
|
|
|
void ToV0_8_4();
|
2019-05-08 14:16:04 +02:00
|
|
|
void ToV0_8_5();
|
2019-12-13 09:51:29 +01:00
|
|
|
void ToV0_8_6();
|
2015-08-27 10:25:11 +02:00
|
|
|
|
|
|
|
void TagUnitToV0_2_0();
|
|
|
|
void TagIncrementToV0_2_0();
|
2015-09-07 15:51:13 +02:00
|
|
|
void ConvertMeasurementsToV0_2_0();
|
2015-08-27 10:25:11 +02:00
|
|
|
void TagMeasurementsToV0_2_0();
|
|
|
|
|
2015-11-11 15:26:48 +01:00
|
|
|
void ConvertMeasurementsToV0_2_1();
|
|
|
|
|
2016-05-19 14:40:55 +02:00
|
|
|
void RemoveColorToolCutV0_3_1();
|
|
|
|
|
2015-08-27 10:25:11 +02:00
|
|
|
QSet<QString> FixIncrementsToV0_2_0();
|
|
|
|
QString FixIncrementInFormulaToV0_2_0(const QString &formula, const QSet<QString> &names);
|
|
|
|
void FixPointExpressionsToV0_2_0(const QSet<QString> &names);
|
|
|
|
void FixArcExpressionsToV0_2_0(const QSet<QString> &names);
|
|
|
|
void FixPathPointExpressionsToV0_2_0(const QSet<QString> &names);
|
|
|
|
|
2015-09-07 15:51:13 +02:00
|
|
|
void ConvertPointExpressionsToV0_2_0(const QMap<QString, QString> &names);
|
|
|
|
void ConvertArcExpressionsToV0_2_0(const QMap<QString, QString> &names);
|
|
|
|
void ConvertPathPointExpressionsToV0_2_0(const QMap<QString, QString> &names);
|
|
|
|
QString FixMeasurementInFormulaToV0_2_0(const QString &formula, const QMap<QString, QString> &names);
|
|
|
|
|
2015-08-27 10:25:11 +02:00
|
|
|
QString MUnitV0_1_4() const;
|
|
|
|
QDomElement TagMeasurementsV0_1_4() const;
|
2015-08-27 13:00:20 +02:00
|
|
|
QDomElement TagIncrementsV0_1_4() const;
|
2015-09-07 15:51:13 +02:00
|
|
|
|
2016-01-07 17:43:08 +01:00
|
|
|
void FixToolUnionToV0_2_4();
|
|
|
|
void ParseModelingToV0_2_4(const QDomElement &modeling);
|
|
|
|
void SaveChildrenToolUnionToV0_2_4(quint32 id, const QVector<quint32> &children);
|
|
|
|
|
2015-09-07 15:51:13 +02:00
|
|
|
static QMap<QString, QString> OldNamesToNewNames_InV0_2_0();
|
2015-11-11 15:26:48 +01:00
|
|
|
static QMap<QString, QString> OldNamesToNewNames_InV0_2_1();
|
2016-08-20 16:32:45 +02:00
|
|
|
|
|
|
|
void FixCutPoint();
|
|
|
|
void FixSubPaths(int i, quint32 id, quint32 baseCurve);
|
2016-11-08 15:32:18 +01:00
|
|
|
|
2016-11-25 12:19:38 +01:00
|
|
|
void TagRemoveAttributeTypeObjectInV0_4_0();
|
2016-11-08 15:32:18 +01:00
|
|
|
void TagDetailToV0_4_0();
|
2017-01-18 14:17:16 +01:00
|
|
|
void TagUnionDetailsToV0_4_0();
|
|
|
|
QDomElement GetUnionDetailNodesV0_4_0(const QDomElement &detail);
|
|
|
|
QDomElement GetUnionChildrenNodesV0_4_0(const QDomElement &detail);
|
2017-03-14 12:54:15 +01:00
|
|
|
|
|
|
|
void LabelTagToV0_4_4(const QString &tagName);
|
2017-08-16 15:39:16 +02:00
|
|
|
|
|
|
|
QDomElement AddTagPatternLabelV0_5_1();
|
2017-08-18 08:02:03 +02:00
|
|
|
void PortPatternLabeltoV0_6_0(QDomElement &label);
|
2017-08-16 15:39:16 +02:00
|
|
|
void AddLabelTemplateLineV0_6_0(QDomElement &label, const QString &text, bool bold, bool italic, int alignment,
|
|
|
|
int fontSizeIncrement);
|
2017-08-18 08:02:03 +02:00
|
|
|
void PortPieceLabelstoV0_6_0();
|
2017-08-16 15:39:16 +02:00
|
|
|
void RemoveUnusedTagsV0_6_0();
|
|
|
|
void RemoveUniqueTagV0_6_0(const QString &tag);
|
2017-09-02 13:47:44 +02:00
|
|
|
|
|
|
|
void AddTagPreviewCalculationsV0_6_2();
|
2014-12-11 16:12:16 +01:00
|
|
|
};
|
|
|
|
|
2016-07-07 17:04:26 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline int VPatternConverter::MinVer() const
|
|
|
|
{
|
|
|
|
return PatternMinVer;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline int VPatternConverter::MaxVer() const
|
|
|
|
{
|
|
|
|
return PatternMaxVer;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline QString VPatternConverter::MinVerStr() const
|
|
|
|
{
|
|
|
|
return PatternMinVerStr;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline QString VPatternConverter::MaxVerStr() const
|
|
|
|
{
|
|
|
|
return PatternMaxVerStr;
|
|
|
|
}
|
|
|
|
|
2014-12-11 16:12:16 +01:00
|
|
|
#endif // VPATTERNCONVERTER_H
|