Seamly2D
Code documentation
vabstractmconverter.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  ** @file vabstractmconverter.cpp
3  ** @author Douglas S Caskey
4  ** @date Dec 27, 2022
5  **
6  ** @copyright
7  ** Copyright (C) 2017 - 2022 Seamly, LLC
8  ** https://github.com/fashionfreedom/seamly2d
9  **
10  ** @brief
11  ** Seamly2D is free software: you can redistribute it and/or modify
12  ** it under the terms of the GNU General Public License as published by
13  ** the Free Software Foundation, either version 3 of the License, or
14  ** (at your option) any later version.
15  **
16  ** Seamly2D is distributed in the hope that it will be useful,
17  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  ** GNU General Public License for more details.
20  **
21  ** You should have received a copy of the GNU General Public License
22  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
23  **************************************************************************/
24 
25 /************************************************************************
26  **
27  ** @file vabstractmconverter.cpp
28  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
29  ** @date 5 9, 2015
30  **
31  ** @brief
32  ** @copyright
33  ** This source code is part of the Valentina project, a pattern making
34  ** program, whose allow create and modeling patterns of clothing.
35  ** Copyright (C) 2015 Valentina project
36  ** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
37  **
38  ** Valentina is free software: you can redistribute it and/or modify
39  ** it under the terms of the GNU General Public License as published by
40  ** the Free Software Foundation, either version 3 of the License, or
41  ** (at your option) any later version.
42  **
43  ** Valentina is distributed in the hope that it will be useful,
44  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
45  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46  ** GNU General Public License for more details.
47  **
48  ** You should have received a copy of the GNU General Public License
49  ** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
50  **
51  *************************************************************************/
52 
53 #include "vabstractmconverter.h"
54 
55 #include <QDomElement>
56 #include <QStaticStringData>
57 #include <QStringData>
58 #include <QStringDataPtr>
59 
60 #include "vabstractconverter.h"
61 
62 //---------------------------------------------------------------------------------------------------------------------
64  :VAbstractConverter(fileName)
65 {
66 }
67 
68 //---------------------------------------------------------------------------------------------------------------------
70 {
71  const QString rootComment =
72  QStringLiteral("Measurements created with Seamly2D (https://seamly.net).");
73 
74  QDomElement rootElement = this->documentElement();
75  rootElement.insertBefore(createComment(rootComment), rootElement.firstChild());
76 }
77 
78 //---------------------------------------------------------------------------------------------------------------------
80 {
81  // new name, old name
82  QMultiMap<QString, QString> names;
83 
84  names.insert(QStringLiteral("height_neck_back"), QStringLiteral("cervicale_height"));
85  names.insert(QStringLiteral("height_scapula"), QStringLiteral("height_scapular_point"));
86  names.insert(QStringLiteral("height_armpit"), QStringLiteral("height_back_angle_axilla"));
87  names.insert(QStringLiteral("height_waist_side"), QStringLiteral("waist_height"));
88  names.insert(QStringLiteral("height_hip"), QStringLiteral("hip_height"));
89  names.insert(QStringLiteral("height_knee"), QStringLiteral("knee_height"));
90  names.insert(QStringLiteral("height_ankle"), QStringLiteral("ankle_height"));
91  names.insert(QStringLiteral("height_highhip"), QStringLiteral("high_hip_height"));
92  names.insert(QStringLiteral("height_waist_front"), QStringLiteral("front_waist_to_floor"));
93  names.insert(QStringLiteral("height_bustpoint"), QStringLiteral("height_nipple_point"));
94 
95  QString name = QStringLiteral("height_shoulder_tip");
96  names.insert(name, QStringLiteral("shoulder_height"));
97  names.insert(name, QStringLiteral("height_shoulder_point"));
98 
99  name = QStringLiteral("height_neck_front");
100  names.insert(name, QStringLiteral("height_clavicular_point"));
101  names.insert(name, QStringLiteral("height_front_neck_base_point"));
102 
103  names.insert(QStringLiteral("height_neck_side"), QStringLiteral("height_base_neck_side_point"));
104 
105  name = QStringLiteral("height_neck_back_to_knee");
106  names.insert(name, QStringLiteral("neck_to_knee_point"));
107  names.insert(name, QStringLiteral("cervicale_to_knee_height"));
108 
109  names.insert(QStringLiteral("height_waist_side_to_knee"), QStringLiteral("waist_to_knee_height"));
110  names.insert(QStringLiteral("height_waist_side_to_hip"), QStringLiteral("waist_to_hip_height"));
111  names.insert(QStringLiteral("indent_neck_back"), QStringLiteral("body_position"));
112 
113  name = QStringLiteral("neck_mid_circ");
114  names.insert(name, QStringLiteral("half_girth_neck_for_shirts"));
115  names.insert(name, QStringLiteral("mid_neck_girth"));
116 
117  names.insert(QStringLiteral("neck_circ"), QStringLiteral("neck_base_girth"));
118  names.insert(QStringLiteral("highbust_circ"), QStringLiteral("upper_chest_girth"));
119  names.insert(QStringLiteral("bust_circ"), QStringLiteral("bust_girth"));
120  names.insert(QStringLiteral("lowbust_circ"), QStringLiteral("under_bust_girth"));
121  names.insert(QStringLiteral("waist_circ"), QStringLiteral("waist_girth"));
122  names.insert(QStringLiteral("highhip_circ"), QStringLiteral("high_hip_girth"));
123  names.insert(QStringLiteral("hip_circ"), QStringLiteral("hips_excluding_protruding_abdomen"));
124  names.insert(QStringLiteral("hip_circ_with_abdomen"), QStringLiteral("hip_girth"));
125 
126  name = QStringLiteral("neck_arc_f");
127  names.insert(name, QStringLiteral("half_girth_neck"));
128  names.insert(name, QStringLiteral("front_neck_arc"));
129 
130  name = QStringLiteral("highbust_arc_f");
131  names.insert(name, QStringLiteral("half_girth_chest_first"));
132  names.insert(name, QStringLiteral("front_upper_chest_arc"));
133 
134  names.insert(QStringLiteral("bust_arc_f"), QStringLiteral("half_girth_chest_second"));
135  names.insert(QStringLiteral("lowbust_arc_f"), QStringLiteral("half_girth_chest_third"));
136 
137  name = QStringLiteral("waist_arc_f");
138  names.insert(name, QStringLiteral("half_girth_waist"));
139  names.insert(name, QStringLiteral("front_waist_arc"));
140 
141  names.insert(QStringLiteral("highhip_arc_f"), QStringLiteral("front_upper_hip_arc"));
142 
143  name = QStringLiteral("hip_arc_f");
144  names.insert(name, QStringLiteral("half_girth_hips_excluding_protruding_abdomen"));
145  names.insert(name, QStringLiteral("front_hip_arc"));
146 
147  names.insert(QStringLiteral("neck_arc_b"), QStringLiteral("back_neck_arc"));
148  names.insert(QStringLiteral("highbust_arc_b"), QStringLiteral("back_upper_chest_arc"));
149  names.insert(QStringLiteral("waist_arc_b"), QStringLiteral("back_waist_arc"));
150  names.insert(QStringLiteral("highhip_arc_b"), QStringLiteral("back_upper_hip_arc"));
151  names.insert(QStringLiteral("hip_arc_b"), QStringLiteral("back_hip_arc"));
152  names.insert(QStringLiteral("hip_with_abdomen_arc_f"),
153  QStringLiteral("half_girth_hips_considering_protruding_abdomen"));
154  names.insert(QStringLiteral("body_armfold_circ"), QStringLiteral("shoulder_girth"));
155  names.insert(QStringLiteral("body_torso_circ"), QStringLiteral("trunk_length"));
156  names.insert(QStringLiteral("neck_front_to_waist_f"), QStringLiteral("front_waist_length"));
157  names.insert(QStringLiteral("neck_front_to_waist_flat_f"), QStringLiteral("center_front_waist_length"));
158  names.insert(QStringLiteral("armpit_to_waist_side"), QStringLiteral("side_waist_length"));
159  names.insert(QStringLiteral("neck_side_to_waist_b"), QStringLiteral("waist_to_neck_side"));
160 
161  name = QStringLiteral("neck_side_to_waist_f");
162  names.insert(name, QStringLiteral("neck_to_front_waist_line"));
163  names.insert(name, QStringLiteral("front_shoulder_to_waist_length"));
164 
165  names.insert(QStringLiteral("neck_side_to_waist_b"), QStringLiteral("back_shoulder_to_waist_length"));
166  names.insert(QStringLiteral("neck_back_to_waist_b"), QStringLiteral("center_back_waist_length"));
167 
168  name = QStringLiteral("neck_front_to_highbust_f");
169  names.insert(name, QStringLiteral("neck_to_first_line_chest_circumference"));
170  names.insert(name, QStringLiteral("front_neck_to_upper_chest_height"));
171 
172  names.insert(QStringLiteral("neck_front_to_bust_f"), QStringLiteral("front_neck_to_bust_height"));
173  names.insert(QStringLiteral("highbust_to_waist_f"), QStringLiteral("front_waist_to_upper_chest"));
174  names.insert(QStringLiteral("lowbust_to_waist_f"), QStringLiteral("front_waist_to_lower_breast"));
175  names.insert(QStringLiteral("neck_back_to_highbust_b"), QStringLiteral("neck_to_back_line_chest_circumference"));
176  names.insert(QStringLiteral("waist_to_highhip_f"), QStringLiteral("depth_waist_first"));
177  names.insert(QStringLiteral("waist_to_hip_f"), QStringLiteral("depth_waist_second"));
178  names.insert(QStringLiteral("shoulder_slope_neck_side_angle"), QStringLiteral("shoulder_slope_degrees"));
179  names.insert(QStringLiteral("shoulder_slope_neck_side_length"), QStringLiteral("shoulder_drop"));
180  names.insert(QStringLiteral("shoulder_length"), QStringLiteral("shoulder_length"));
181  names.insert(QStringLiteral("shoulder_tip_to_shoulder_tip_f"), QStringLiteral("across_front_shoulder_width"));
182  names.insert(QStringLiteral("across_chest_f"), QStringLiteral("upper_front_chest_width"));
183  names.insert(QStringLiteral("across_chest_f"), QStringLiteral("chest_width"));
184  names.insert(QStringLiteral("armfold_to_armfold_f"), QStringLiteral("front_chest_width"));
185 
186  name = QStringLiteral("shoulder_tip_to_shoulder_tip_b");
187  names.insert(name, QStringLiteral("arc_behind_shoulder_girdle"));
188  names.insert(name, QStringLiteral("across_back_shoulder_width"));
189 
190  names.insert(QStringLiteral("across_back_b"), QStringLiteral("upper_back_width"));
191  names.insert(QStringLiteral("armfold_to_armfold_b"), QStringLiteral("back_width"));
192  names.insert(QStringLiteral("neck_width"), QStringLiteral("neck_transverse_diameter"));
193  names.insert(QStringLiteral("bustpoint_to_bustpoint"), QStringLiteral("bustpoint_to_bustpoint"));
194  names.insert(QStringLiteral("bustpoint_to_neck_side"), QStringLiteral("neck_to_bustpoint"));
195  names.insert(QStringLiteral("bustpoint_to_bustpoint_halter"), QStringLiteral("halter_bustpoint_to_bustpoint"));
196 
197  name = QStringLiteral("shoulder_tip_to_waist_front");
198  names.insert(name, QStringLiteral("front_slash_shoulder_height"));
199  names.insert(name, QStringLiteral("front_shoulder_slope_length"));
200 
201  names.insert(QStringLiteral("neck_front_to_waist_side"), QStringLiteral("front_waist_slope"));
202 
203  name = QStringLiteral("neck_side_to_armfold_f");
204  names.insert(name, QStringLiteral("height_armhole_slash"));
205  names.insert(name, QStringLiteral("chest_slope"));
206 
207  name = QStringLiteral("shoulder_tip_to_waist_back");
208  names.insert(name, QStringLiteral("slash_shoulder_height"));
209  names.insert(name, QStringLiteral("back_shoulder_slope_length"));
210 
211  names.insert(QStringLiteral("neck_back_to_waist_side"), QStringLiteral("back_waist_slope"));
212  names.insert(QStringLiteral("neck_side_to_armfold_b"), QStringLiteral("back_slope"));
213  names.insert(QStringLiteral("arm_shoulder_tip_to_wrist"), QStringLiteral("arm_length"));
214  names.insert(QStringLiteral("arm_shoulder_tip_to_elbow"), QStringLiteral("shoulder_to_elbow_length"));
215  names.insert(QStringLiteral("arm_armpit_to_wrist"), QStringLiteral("underarm_length"));
216  names.insert(QStringLiteral("arm_upper_circ"), QStringLiteral("upper_arm_girth"));
217  names.insert(QStringLiteral("arm_wrist_circ"), QStringLiteral("wrist_girth"));
218  names.insert(QStringLiteral("armscye_circ"), QStringLiteral("armscye_girth"));
219  names.insert(QStringLiteral("armscye_width"), QStringLiteral("anteroposterior_diameter_hands"));
220  names.insert(QStringLiteral("arm_neck_side_to_finger_tip"), QStringLiteral("neck_to_third_finger"));
221  names.insert(QStringLiteral("arm_neck_side_to_outer_elbow"), QStringLiteral("neck_to_radial_point"));
222  names.insert(QStringLiteral("arm_neck_side_to_wrist"), QStringLiteral("shoulder_and_arm_length"));
223  names.insert(QStringLiteral("leg_crotch_to_floor"), QStringLiteral("crotch_height"));
224  names.insert(QStringLiteral("leg_waist_side_to_floor"), QStringLiteral("side_waist_to_floor"));
225  names.insert(QStringLiteral("leg_waist_side_to_knee"), QStringLiteral("waist_to_knee"));
226  names.insert(QStringLiteral("leg_thigh_upper_circ"), QStringLiteral("thigh_girth"));
227  names.insert(QStringLiteral("leg_thigh_mid_circ"), QStringLiteral("mid_thigh_girth"));
228  names.insert(QStringLiteral("leg_knee_circ"), QStringLiteral("knee_girth"));
229  names.insert(QStringLiteral("leg_calf_circ"), QStringLiteral("calf_girth"));
230  names.insert(QStringLiteral("leg_ankle_circ"), QStringLiteral("ankle_girth"));
231  names.insert(QStringLiteral("leg_knee_circ_bent"), QStringLiteral("girth_knee_flexed_feet"));
232 
233  name = QStringLiteral("crotch_length");
234  names.insert(name, QStringLiteral("arc_through_groin_area"));
235  names.insert(name, QStringLiteral("crotch_length"));
236 
237  names.insert(QStringLiteral("rise_length_side_sitting"), QStringLiteral("waist_to_plane_seat"));
238  names.insert(QStringLiteral("rise_length_diag"), QStringLiteral("rise_height"));
239 
240  name = QStringLiteral("hand_length");
241  names.insert(name, QStringLiteral("hand_vertical_diameter"));
242  names.insert(name, QStringLiteral("hand_length"));
243 
244  names.insert(QStringLiteral("hand_palm_width"), QStringLiteral("hand_width"));
245  names.insert(QStringLiteral("hand_circ"), QStringLiteral("hand_girth"));
246  names.insert(QStringLiteral("foot_width"), QStringLiteral("foot_width"));
247  names.insert(QStringLiteral("foot_length"), QStringLiteral("foot_length"));
248  names.insert(QStringLiteral("foot_instep_circ"), QStringLiteral("girth_foot_instep"));
249  names.insert(QStringLiteral("head_length"), QStringLiteral("head_height"));
250  names.insert(QStringLiteral("head_crown_to_neck_back"), QStringLiteral("head_and_neck_length"));
251  names.insert(QStringLiteral("head_chin_to_neck_back"), QStringLiteral("neck_to_neck_base"));
252  names.insert(QStringLiteral("waist_to_waist_halter"), QStringLiteral("arc_length_upper_body"));
253  names.insert(QStringLiteral("arm_neck_back_to_wrist_bent"), QStringLiteral("cervicale_to_wrist_length"));
254  names.insert(QStringLiteral("highbust_b_over_shoulder_to_highbust_f"), QStringLiteral("strap_length"));
255  names.insert(QStringLiteral("armscye_arc"), QStringLiteral("arc_through_shoulder_joint"));
256  names.insert(QStringLiteral("head_circ"), QStringLiteral("head_girth"));
257  names.insert(QStringLiteral("arm_elbow_circ"), QStringLiteral("elbow_girth"));
258  names.insert(QStringLiteral("height_gluteal_fold"), QStringLiteral("height_under_buttock_folds"));
259  names.insert(QStringLiteral("neck_back_to_highbust_b"), QStringLiteral("scye_depth"));
260  names.insert(QStringLiteral("across_back_to_waist_b"), QStringLiteral("back_waist_to_upper_chest"));
261 
262  return names;
263 }
264 
265 //---------------------------------------------------------------------------------------------------------------------
267 {
268  // new name, old name
270 
271  names.insert(QStringLiteral("rise_length_side_sitting"), QStringLiteral("rise_length_side"));
272 
273  return names;
274 }
static QMap< QString, QString > OldNamesToNewNames_InV0_3_3()
static QMultiMap< QString, QString > OldNamesToNewNames_InV0_3_0()
VAbstractMConverter(const QString &fileName)