2014-12-11 16:12:16 +01:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file vpatternconverter.h
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 11 12, 2014
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
|
|
|
** This source code is part of the Valentine project, a pattern making
|
|
|
|
** 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);
|
2015-07-03 15:36:54 +02:00
|
|
|
virtual ~VPatternConverter() Q_DECL_OVERRIDE;
|
2014-12-11 16:12:16 +01:00
|
|
|
|
2016-07-07 17:04:26 +02:00
|
|
|
static const QString PatternMaxVerStr;
|
|
|
|
static const QString CurrentSchema;
|
2016-08-21 11:28:23 +02:00
|
|
|
// GCC 4.6 doesn't allow constexpr and const together
|
2016-08-21 22:04:23 +02:00
|
|
|
#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) <= 406
|
2016-08-21 11:28:23 +02:00
|
|
|
static Q_DECL_CONSTEXPR int PatternMinVer = CONVERTER_VERSION_CHECK(0, 1, 0);
|
2017-03-09 12:10:46 +01:00
|
|
|
static Q_DECL_CONSTEXPR int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 4, 3);
|
2016-08-21 22:04:23 +02:00
|
|
|
#else
|
|
|
|
static Q_DECL_CONSTEXPR const int PatternMinVer = CONVERTER_VERSION_CHECK(0, 1, 0);
|
2017-03-09 12:10:46 +01:00
|
|
|
static Q_DECL_CONSTEXPR const int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 4, 3);
|
2016-08-21 11:28:23 +02:00
|
|
|
#endif
|
2014-12-11 20:44:48 +01:00
|
|
|
|
|
|
|
protected:
|
2015-07-03 15:36:54 +02:00
|
|
|
virtual int MinVer() const Q_DECL_OVERRIDE;
|
|
|
|
virtual int MaxVer() const Q_DECL_OVERRIDE;
|
2014-12-11 20:44:48 +01:00
|
|
|
|
2015-07-03 15:36:54 +02:00
|
|
|
virtual QString MinVerStr() const Q_DECL_OVERRIDE;
|
|
|
|
virtual QString MaxVerStr() const Q_DECL_OVERRIDE;
|
2014-12-11 21:16:03 +01:00
|
|
|
|
2016-05-03 18:50:37 +02:00
|
|
|
virtual QString XSDSchema(int ver) const Q_DECL_OVERRIDE;
|
2015-07-03 15:36:54 +02:00
|
|
|
virtual void ApplyPatches() Q_DECL_OVERRIDE;
|
2016-01-19 16:25:46 +01:00
|
|
|
virtual void DowngradeToCurrentMaxVersion() Q_DECL_OVERRIDE;
|
2014-12-11 21:16:03 +01:00
|
|
|
|
2017-02-04 12:28:47 +01:00
|
|
|
virtual bool IsReadOnly() const Q_DECL_OVERRIDE;
|
|
|
|
|
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
|
|
|
|
2014-12-27 12:15:34 +01:00
|
|
|
void ToV0_1_1();
|
2014-12-17 13:56:14 +01:00
|
|
|
void ToV0_1_2();
|
2015-02-03 12:15:52 +01:00
|
|
|
void ToV0_1_3();
|
2015-05-28 11:07:52 +02:00
|
|
|
void ToV0_1_4();
|
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();
|
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-08-27 10:25:11 +02:00
|
|
|
QStringList ListPathPointExpressionsV0_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);
|
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
|