Seamly2D
Code documentation
vtranslatemeasurements.h
Go to the documentation of this file.
1 /******************************************************************************
2 * @file vtranslatemeasurements.h
3 ** @author DSCaskey <dscaskey@gmail.com>
4 ** @date 5 Jun, 2023
5 **
6 ** @brief
7 ** @copyright
8 ** This source code is part of the Seamly2D project, a pattern making
9 ** program to create and model patterns of clothing.
10 ** Copyright (C) 2017-2023 Seamly2D project
11 ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
12 **
13 ** Seamly2D is free software: you can redistribute it and/or modify
14 ** it under the terms of the GNU General Public License as published by
15 ** the Free Software Foundation, either version 3 of the License, or
16 ** (at your option) any later version.
17 **
18 ** Seamly2D is distributed in the hope that it will be useful,
19 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ** GNU General Public License for more details.
22 **
23 ** You should have received a copy of the GNU General Public License
24 ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
25 **
26 *************************************************************************/
27 
28 /************************************************************************
29  **
30  ** @file vtranslatemeasurements.h
31  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
32  ** @date 2 8, 2015
33  **
34  ** @brief
35  ** @copyright
36  ** This source code is part of the Valentina project, a pattern making
37  ** program, whose allow create and modeling patterns of clothing.
38  ** Copyright (C) 2015 Valentina project
39  **
40  ** Valentina is free software: you can redistribute it and/or modify
41  ** it under the terms of the GNU General Public License as published by
42  ** the Free Software Foundation, either version 3 of the License, or
43  ** (at your option) any later version.
44  **
45  ** Valentina is distributed in the hope that it will be useful,
46  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
47  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48  ** GNU General Public License for more details.
49  **
50  ** You should have received a copy of the GNU General Public License
51  ** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
52  **
53  *************************************************************************/
54 
55 #ifndef VTRANSLATEMEASUREMENTS_H
56 #define VTRANSLATEMEASUREMENTS_H
57 
58 #include <QMap>
59 #include <QString>
60 #include <QtGlobal>
61 
62 #include "../qmuparser/qmutranslation.h"
63 
65 {
66 public:
68  virtual ~VTranslateMeasurements();
69 
70  bool MeasurementsFromUser(QString &newFormula, int position, const QString &token, int &bias) const;
71 
72  QString MToUser(const QString &measurement) const;
73  QString MNumber(const QString &measurement) const;
74  QString MFormula(const QString &measurement) const;
75  QString guiText(const QString &measurement) const;
76  QString Description(const QString &measurement) const;
77 
78  virtual void Retranslate();
79 
80 protected:
82 
83 private:
84  Q_DISABLE_COPY(VTranslateMeasurements)
85  QMap<QString, qmu::QmuTranslation> m_guiTexts;
86  QMap<QString, qmu::QmuTranslation> m_descriptions;
87  QMap<QString, QString> m_numbers;
88  QMap<QString, QString> m_formulas;
89 
90  void InitGroupA(); // Direct Height
91  void InitGroupB(); // Direct Width
92  void InitGroupC(); // Indentation
93  void InitGroupD(); // Circumference and Arc
94  void InitGroupE(); // Vertical
95  void InitGroupF(); // Horizontal
96  void InitGroupG(); // Bust
97  void InitGroupH(); // Balance
98  void InitGroupI(); // Arm
99  void InitGroupJ(); // Leg
100  void InitGroupK(); // Crotch and Rise
101  void InitGroupL(); // Hand
102  void InitGroupM(); // Foot
103  void InitGroupN(); // Head
104  void InitGroupO(); // Men & Tailoring
105  void InitGroupP(); // Historical & Specialty
106  void InitGroupQ(); // Patternmaking measurements
107 
108  void InitMeasurements();
109 
110  void InitMeasurement(const QString &name, const qmu::QmuTranslation &m, const qmu::QmuTranslation &g,
111  const qmu::QmuTranslation &d, const QString &number, const QString &formula = QString());
112 };
113 
114 #endif // VTRANSLATEMEASUREMENTS_H
QMap< QString, QString > m_formulas
QString guiText(const QString &measurement) const
void InitMeasurement(const QString &name, const qmu::QmuTranslation &m, const qmu::QmuTranslation &g, const qmu::QmuTranslation &d, const QString &number, const QString &formula=QString())
QString MNumber(const QString &measurement) const
bool MeasurementsFromUser(QString &newFormula, int position, const QString &token, int &bias) const
MeasurementsFromUser translate measurement to internal look.
QString MToUser(const QString &measurement) const
QMap< QString, qmu::QmuTranslation > m_descriptions
QMap< QString, qmu::QmuTranslation > m_guiTexts
QMap< QString, qmu::QmuTranslation > m_measurements
QString Description(const QString &measurement) const
QString MFormula(const QString &measurement) const
QMap< QString, QString > m_numbers
Namespace for mathematical applications.