Seamly2D
Code documentation
vabstractpattern.h
Go to the documentation of this file.
1 /***************************************************************************
2  ** @file vabstractpattern.h
3  ** @author Douglas S Caskey
4  ** @date Mar 1, 2023
5  **
6  ** @copyright
7  ** Copyright (C) 2017 - 2023 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 vabstractpattern.h
28  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
29  ** @date 15 6, 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 #ifndef VABSTRACTPATTERN_H
54 #define VABSTRACTPATTERN_H
55 
56 #include <qcompilerdetection.h>
57 #include <QHash>
58 #include <QMap>
59 #include <QMetaObject>
60 #include <QObject>
61 #include <QPair>
62 #include <QString>
63 #include <QStringList>
64 #include <QVector>
65 #include <QtGlobal>
66 #include <QVector>
67 
68 #include "vdomdocument.h"
69 #include "vtoolrecord.h"
70 #include "../vmisc/def.h"
71 #include "../vwidgets/pen_toolbar.h"
72 
73 class QDomElement;
74 class VPiecePath;
75 class VPieceNode;
76 class PenToolBar;
77 
78 enum class Document : char { LiteParse, LiteBlockParse, FullParse };
79 enum class LabelType : char {NewPatternPiece, NewLabel};
80 
81 // Don't touch values!!!. Same values stored in xml.
82 enum class CrossCirclesPoint : char {FirstPoint = 1, SecondPoint = 2};
83 enum class VCrossCurvesPoint : char {HighestPoint = 1, LowestPoint = 2};
84 enum class HCrossCurvesPoint : char {LeftmostPoint = 1, RightmostPoint = 2};
85 enum class AxisType : char {VerticalAxis = 1, HorizontalAxis = 2};
86 
87 class VContainer;
88 class VDataTool;
89 
90 QT_WARNING_PUSH
91 QT_WARNING_DISABLE_GCC("-Weffc++")
92 
94 {
95  QString expression;
96  QDomElement element;
97  QString attribute;
98 };
99 
101 {
102  QString name;
103  bool visible;
104  bool locked;
105  QString color;
106  QString linetype;
107  QString lineweight;
108 };
109 
111 
112 class VAbstractPattern : public QObject, public VDomDocument
113 {
114  Q_OBJECT
115 public:
116  explicit VAbstractPattern(QObject *parent = nullptr);
117  virtual ~VAbstractPattern() Q_DECL_EQ_DEFAULT;
118 
119  QStringList ListMeasurements() const;
122 
123  virtual void CreateEmptyFile()=0;
124 
125  void changeActiveDraftBlock(const QString &name, const Document &parse = Document::FullParse);
126  QString getActiveDraftBlockName() const;
127 
128  bool draftBlockNameExists(const QString &name) const;
129  int draftBlockCount() const;
130  QDomElement getDraftBlockElement(const QString &name);
131  bool renameDraftBlock(const QString &oldName, const QString &newName);
132  bool appendDraftBlock(const QString &name);
133 
134  bool getActiveNodeElement(const QString &name, QDomElement &element) const;
135 
136  quint32 getCursor() const;
137  void setCursor(const quint32 &value);
138 
139  void setDefaultPen(Pen pen);
140  QString getDefaultLineColor() const;
141  qreal getDefaultLineWeight() const;
142  QString getDefaultLineType() const;
143 
144  virtual void IncrementReferens(quint32 id) const=0;
145  virtual void DecrementReferens(quint32 id) const=0;
146 
147  virtual QString GenerateLabel(const LabelType &type, const QString &reservedName = QString())const=0;
148  virtual QString GenerateSuffix(const QString &type) const=0;
149 
150  virtual void UpdateToolData(const quint32 &id, VContainer *data)=0;
151 
152  static VDataTool *getTool(quint32 id);
153  static void AddTool(quint32 id, VDataTool *tool);
154  static void RemoveTool(quint32 id);
155 
156  static VPiecePath ParsePieceNodes(const QDomElement &domElement);
157  static QVector<CustomSARecord> ParsePieceCSARecords(const QDomElement &domElement);
158  static QVector<quint32> ParsePieceInternalPaths(const QDomElement &domElement);
159  static QVector<quint32> ParsePieceAnchors(const QDomElement &domElement);
160 
161  void AddToolOnRemove(VDataTool *tool);
162 
165  QMap<quint32, Tool> getGroupObjHistory() const;
166 
167  QString MPath() const;
168  void SetMPath(const QString &path);
169 
170  quint32 SiblingNodeId(const quint32 &nodeId) const;
171 
172  QStringList getPatternPieces() const;
173 
174  QMap<GHeights, bool> GetGradationHeights() const;
175  void SetGradationHeights(const QMap<GHeights, bool> &options);
176 
177  QMap<GSizes, bool> GetGradationSizes() const;
178  void SetGradationSizes(const QMap<GSizes, bool> &options);
179 
180  QString GetDescription() const;
181  void SetDescription(const QString &text);
182 
183  QString GetNotes() const;
184  void SetNotes(const QString &text);
185 
186  QString GetPatternName() const;
187  void SetPatternName(const QString &qsName);
188 
189  QString GetCompanyName() const;
190  void SetCompanyName(const QString &qsName);
191 
192  QString GetPatternNumber() const;
193  void SetPatternNumber(const QString &qsNum);
194 
195  QString GetCustomerName() const;
196  void SetCustomerName(const QString &qsName);
197 
198  QString GetLabelDateFormat() const;
199  void SetLabelDateFormat(const QString &format);
200 
201  QString GetLabelTimeFormat() const;
202  void SetLabelTimeFormat(const QString &format);
203 
205 
207 
208  void SetPatternWasChanged(bool changed);
209  bool GetPatternWasChanged() const;
210 
211  QString GetImage() const;
212  QString GetImageExtension() const;
213  void SetImage(const QString &text, const QString &extension);
214  void DeleteImage();
215 
216  QString GetVersion() const;
217  void SetVersion();
218 
219  QVector<quint32> getOpItems(const quint32 &toolId, const QString &itemType);
220  QVector<quint32> getDartItems(const quint32 &toolId);
221 
222  bool IsModified() const;
223  void SetModified(bool modified);
224 
225  QDomElement getDraw(const QString &name) const;
226 
227  void parseGroups(const QDomElement &domElement);
228  QDomElement createGroups();
229  QDomElement createGroup(quint32 id, const QString &name, const QString &color, const QString &type,
230  const QString &weight, const QMap<quint32, quint32> &groupData);
231 
232  QDomElement addGroupItems(const QString &name, const QMap<quint32, quint32> &groupData);
233  QString getGroupName(quint32 id);
234  void setGroupName(quint32 id, const QString &name);
235 
236  QMap<quint32, GroupAttributes> getGroups();
237 
238  QStringList groupListByName();
239  QDomElement getGroupByName(const QString &name);
240  quint32 getGroupIdByName(const QString &name);
241  QMap<quint32, QString> getGroupsContainingItem(quint32 toolId, quint32 objectId, bool containsItem);
242 
243  void deleteToolFromGroup(quint32 toolId);
244  void addToolToGroup(quint32 toolId, quint32 objectId, const QString &groupName );
245 
246  QDomElement addGroupItem(quint32 toolId, quint32 objectId, quint32 groupId);
247  QDomElement removeGroupItem(quint32 toolId, quint32 objectId, quint32 groupId);
248  bool isGroupEmpty(quint32 id);
249 
250  bool getGroupVisibility(quint32 id);
251  void setGroupVisibility(quint32 id, bool visible);
252 
253  bool getGroupLock(quint32 id);
254  void setGroupLock(quint32 id, bool locked);
255 
256  QString getGroupColor(quint32 id);
257  void setGroupColor(quint32 id, QString color);
258 
259  QString getGroupLineType(quint32 id);
260  void setGroupLineType(quint32 id, QString type);
261 
262  QString getGroupLineWeight(quint32 id);
263  void setGroupLineWeight(quint32 id, QString weight);
264 
265  bool groupNameExists(const QString &groupName);
266 
267  QString useGroupColor(quint32 toolId, QString color);
268  QString useGroupLineType(quint32 toolId, QString type);
269  QString useGroupLineWeight(quint32 toolId, QString weight);
270 
271  QPair<bool, QMap<quint32, quint32> > parseItemElement(const QDomElement &domElement);
272 
273  static const QString TagPattern;
274  static const QString TagCalculation;
275  static const QString TagModeling;
276  static const QString TagPieces;
277  static const QString TagPiece;
278  static const QString TagDescription;
279  static const QString TagImage;
280  static const QString TagNotes;
281  static const QString TagMeasurements;
282  static const QString TagIncrements;
283  static const QString TagIncrement;
284  static const QString TagDraftBlock;
285  static const QString TagGroups;
286  static const QString TagGroup;
287  static const QString TagGroupItem;
288  static const QString TagPoint;
289  static const QString TagSpline;
290  static const QString TagArc;
291  static const QString TagElArc;
292  static const QString TagTools;
293  static const QString TagOperation;
294  static const QString TagGradation;
295  static const QString TagHeights;
296  static const QString TagSizes;
297  static const QString TagData;
298  static const QString TagPatternInfo;
299  static const QString TagPatternName;
300  static const QString TagPatternNum;
301  static const QString TagCompanyName;
302  static const QString TagCustomerName;
303  static const QString TagPatternLabel;
304  static const QString TagGrainline;
305  static const QString TagPath;
306  static const QString TagNodes;
307  static const QString TagNode;
308  static const QString TagLine;
309 
310  static const QString AttrName;
311  static const QString AttrVisible;
312  static const QString AttrGroupLocked;
313  static const QString AttrGroupColor;
314  static const QString AttrObject;
315  static const QString AttrTool;
316  static const QString AttrType;
317  static const QString AttrLetter;
318  static const QString AttrAnnotation;
319  static const QString AttrOrientation;
320  static const QString AttrRotationWay;
321  static const QString AttrTilt;
322  static const QString AttrFoldPosition;
323  static const QString AttrQuantity;
324  static const QString AttrOnFold;
325  static const QString AttrDateFormat;
326  static const QString AttrTimeFormat;
327  static const QString AttrArrows;
328  static const QString AttrNodeReverse;
329  static const QString AttrNodeExcluded;
330  static const QString AttrNodeIsNotch;
331  static const QString AttrNodeNotchType;
332  static const QString AttrNodeNotchSubType;
333  static const QString AttrNodeShowNotch;
334  static const QString AttrNodeShowSecondNotch;
335  static const QString AttrNodeNotchLength;
336  static const QString AttrNodeNotchWidth;
337  static const QString AttrNodeNotchAngle;
338  static const QString AttrNodeNotchCount;
339  static const QString AttrSABefore;
340  static const QString AttrSAAfter;
341  static const QString AttrStart;
342  static const QString AttrPath;
343  static const QString AttrEnd;
344  static const QString AttrIncludeAs;
345  static const QString AttrWidth;
346  static const QString AttrRotation;
347 
348  static const QString AttrAll;
349 
350  static const QString AttrH50;
351  static const QString AttrH56;
352  static const QString AttrH62;
353  static const QString AttrH68;
354  static const QString AttrH74;
355  static const QString AttrH80;
356  static const QString AttrH86;
357  static const QString AttrH92;
358  static const QString AttrH98;
359  static const QString AttrH104;
360  static const QString AttrH110;
361  static const QString AttrH116;
362  static const QString AttrH122;
363  static const QString AttrH128;
364  static const QString AttrH134;
365  static const QString AttrH140;
366  static const QString AttrH146;
367  static const QString AttrH152;
368  static const QString AttrH158;
369  static const QString AttrH164;
370  static const QString AttrH170;
371  static const QString AttrH176;
372  static const QString AttrH182;
373  static const QString AttrH188;
374  static const QString AttrH194;
375  static const QString AttrH200;
376 
377  static const QString AttrS22;
378  static const QString AttrS24;
379  static const QString AttrS26;
380  static const QString AttrS28;
381  static const QString AttrS30;
382  static const QString AttrS32;
383  static const QString AttrS34;
384  static const QString AttrS36;
385  static const QString AttrS38;
386  static const QString AttrS40;
387  static const QString AttrS42;
388  static const QString AttrS44;
389  static const QString AttrS46;
390  static const QString AttrS48;
391  static const QString AttrS50;
392  static const QString AttrS52;
393  static const QString AttrS54;
394  static const QString AttrS56;
395  static const QString AttrS58;
396  static const QString AttrS60;
397  static const QString AttrS62;
398  static const QString AttrS64;
399  static const QString AttrS66;
400  static const QString AttrS68;
401  static const QString AttrS70;
402  static const QString AttrS72;
403 
404  static const QString AttrCustom;
405  static const QString AttrDefHeight;
406  static const QString AttrDefSize;
407  static const QString AttrExtension;
408 
409  static const QString IncrementName;
410  static const QString IncrementFormula;
411  static const QString IncrementDescription;
412 
413  static const QString NodeArc;
414  static const QString NodeElArc;
415  static const QString NodePoint;
416  static const QString NodeSpline;
417  static const QString NodeSplinePath;
418 
419 signals:
420  /**
421  * @brief activeDraftBlockChanged change active draft block.
422  * @param newName new pattern peace name.
423  */
424  void activeDraftBlockChanged(const QString &newName);
425 
426  /**
427  * @brief ChangedCursor change cursor position.
428  * @param id tool id.
429  */
430  void ChangedCursor(quint32 id);
431 
432  /**
433  * @brief draftBlockNameChanged save new name draft block.
434  * @param oldName old name.
435  * @param newName new name.
436  */
437  void draftBlockNameChanged(const QString &oldName, const QString &newName);
438  /**
439  * @brief FullUpdateFromFile update tool data form file.
440  */
442  /**
443  * @brief patternChanged emit if we have unsaved change.
444  */
445  void patternChanged(bool saved);
447  /**
448  * @brief ShowTool highlight tool.
449  * @param id tool id.
450  * @param enable enable or disable highlight.
451  */
452  void ShowTool(quint32 id, bool enable);
454  void UndoCommand();
455  void SetEnabledGUI(bool enabled);
456  void CheckLayout();
457  void UpdateInLayoutList(quint32 id);
458  void showPiece(quint32 id);
459  void setCurrentDraftBlock(const QString &patterPiece);
460  void patternHasGroups(bool value);
461  void updateGroups();
462 
463 public slots:
464  virtual void LiteParseTree(const Document &parse)=0;
465  void haveLiteChange();
466  void NeedFullParsing();
467  void ClearScene();
468  void updatePieceList(quint32 id);
469  void selectedPiece(quint32 id);
470 
471 protected:
472  /** @brief activeBlockName name current pattern peace. */
474 
478 
480 
481  /** @brief cursor cursor keep id tool after which we will add new tool in file. */
482  quint32 cursor;
483 
485 
486  /** @brief history history records. */
488 
489  /** @brief patternPieces list of patern pieces names for combobox*/
490  QStringList patternPieces;
491 
492  /** @brief modified keep state of the document for cases that do not cover QUndoStack*/
493  mutable bool modified;
494 
495  /** @brief tools list with pointer on tools. */
496  static QHash<quint32, VDataTool*> tools;
497  /** @brief patternLabelLines list to speed up reading a template by many pieces. */
500 
501  static void ToolExists(const quint32 &id);
502  static VPiecePath ParsePathNodes(const QDomElement &domElement);
503  static VPieceNode ParseSANode(const QDomElement &domElement);
504 
505  void setActiveDraftBlock(const QString &name);
506 
507  QDomElement CheckTagExists(const QString &tag);
508  void InsertTag(const QStringList &tags, const QDomElement &element);
509 
510  void SetChildTag(const QString &qsParent, const QString &qsChild, const QString &qsValue);
511 
512  int getActiveDraftBlockIndex() const;
513  bool getActiveDraftElement(QDomElement &element) const;
514 
515  bool hasGroupItem(const QDomElement &domElement, quint32 toolId, quint32 objectId);
516 
517 private:
518  Q_DISABLE_COPY(VAbstractPattern)
519 
520  QStringList ListIncrements() const;
527  QVector<VFormulaField> ListNodesExpressions(const QDomElement &nodes) const;
529  QVector<VFormulaField> ListGrainlineExpressions(const QDomElement &element) const;
531 
532  bool IsVariable(const QString &token) const;
533  bool IsPostfixOperator(const QString &token) const;
534  bool IsFunction(const QString &token) const;
535 
536  QPair<bool, QMap<quint32, quint32> > ParseItemElement(const QDomElement &domElement);
537 
538 };
539 
540 #endif // VABSTRACTPATTERN_H
Definition: pen.h:37
static const QString AttrTimeFormat
void setGroupLock(quint32 id, bool locked)
void SetPatternNumber(const QString &qsNum)
void updatePieceList(quint32 id)
static const QString AttrS28
static const QString TagNode
void SetGradationHeights(const QMap< GHeights, bool > &options)
static const QString AttrLetter
static const QString AttrObject
bool getGroupLock(quint32 id)
static const QString AttrEnd
static const QString AttrS66
virtual void LiteParseTree(const Document &parse)=0
bool IsFunction(const QString &token) const
void SetImage(const QString &text, const QString &extension)
virtual QString GenerateLabel(const LabelType &type, const QString &reservedName=QString()) const =0
static const QString TagData
void setGroupColor(quint32 id, QString color)
QString lastSavedExportFormat
QMap< quint32, GroupAttributes > getGroups()
bool GetPatternWasChanged() const
QVector< VFormulaField > ListArcExpressions() const
static const QString TagSpline
void setGroupLineWeight(quint32 id, QString weight)
void deleteToolFromGroup(quint32 toolId)
Deletes an item from the group containing the toolId.
void AddToolOnRemove(VDataTool *tool)
VAbstractPattern(QObject *parent=nullptr)
static QVector< VLabelTemplateLine > patternLabelLines
patternLabelLines list to speed up reading a template by many pieces.
QString GetCompanyName() const
static const QString AttrS70
static const QString AttrS60
static const QString AttrS50
void draftBlockNameChanged(const QString &oldName, const QString &newName)
draftBlockNameChanged save new name draft block.
static const QString AttrS36
QVector< VLabelTemplateLine > getPatternLabelTemplate() const
static const QString AttrAnnotation
void FullUpdateFromFile()
FullUpdateFromFile update tool data form file.
QDomElement createGroups()
static const QString AttrS56
static const QString AttrType
void UpdateInLayoutList(quint32 id)
static const QString AttrH50
static const QString AttrH182
static const QString AttrS54
static const QString AttrGroupColor
QDomElement removeGroupItem(quint32 toolId, quint32 objectId, quint32 groupId)
Removes the item of given toolId and objectId from the group of given groupId.
static const QString AttrH158
bool IsPostfixOperator(const QString &token) const
QDomElement getGroupByName(const QString &name)
QStringList groupListByName()
static const QString AttrTilt
QPair< bool, QMap< quint32, quint32 > > parseItemElement(const QDomElement &domElement)
static const QString TagPieces
bool isGroupEmpty(quint32 id)
Returns true if the given group is empty.
void ChangedCursor(quint32 id)
ChangedCursor change cursor position.
static QVector< quint32 > ParsePieceAnchors(const QDomElement &domElement)
static const QString NodeArc
static const QString AttrRotation
QString GetLabelDateFormat() const
QVector< quint32 > getDartItems(const quint32 &toolId)
static const QString AttrNodeNotchType
virtual void UpdateToolData(const quint32 &id, VContainer *data)=0
static const QString TagDescription
static const QString AttrS34
void SetModified(bool modified)
bool renameDraftBlock(const QString &oldName, const QString &newName)
renameDraftBlock change draft block name.
static const QString AttrS52
static const QString AttrFoldPosition
static const QString AttrStart
int draftBlockCount() const
static const QString NodePoint
static const QString AttrCustom
static const QString AttrExtension
QString useGroupColor(quint32 toolId, QString color)
static const QString AttrS26
static const QString TagMeasurements
static const QString IncrementDescription
QString MPath() const
static const QString AttrS62
static const QString AttrAll
QString GetPatternName() const
QString GetPatternNumber() const
static const QString AttrH134
QStringList getPatternPieces() const
static const QString AttrH68
static const QString TagModeling
quint32 SiblingNodeId(const quint32 &nodeId) const
static const QString TagArc
void SetPatternWasChanged(bool changed)
static const QString TagPatternName
QPair< bool, QMap< quint32, quint32 > > ParseItemElement(const QDomElement &domElement)
QString activeDraftBlock
activeBlockName name current pattern peace.
bool draftBlockNameExists(const QString &name) const
draftBlockNameExists check if draft block with this name exists.
QString GetImageExtension() const
void ShowTool(quint32 id, bool enable)
ShowTool highlight tool.
quint32 getGroupIdByName(const QString &name)
void setActiveDraftBlock(const QString &name)
setActiveDraftBlock set current draft block.
static const QString AttrH128
static const QString AttrDefSize
static const QString TagPattern
QVector< quint32 > getOpItems(const quint32 &toolId, const QString &itemType)
getOpItems get vector of operation tool obects.
void SetChildTag(const QString &qsParent, const QString &qsChild, const QString &qsValue)
static const QString AttrOnFold
virtual void IncrementReferens(quint32 id) const =0
static const QString AttrH140
void SetPatternName(const QString &qsName)
void haveLiteChange()
haveLiteChange we have unsaved change.
void addToolToGroup(quint32 toolId, quint32 objectId, const QString &groupName)
Adds an item to the given group with the given toolId and objectId.
QDomElement getDraftBlockElement(const QString &name)
static const QString AttrS58
static void AddTool(quint32 id, VDataTool *tool)
AddTool add tool to list tools.
bool appendDraftBlock(const QString &name)
appendDraftBlock add new draft block.
QDomElement addGroupItem(quint32 toolId, quint32 objectId, quint32 groupId)
Adds an item to the given group with the given toolId and objectId.
void setPatternLabelTemplate(const QVector< VLabelTemplateLine > &lines)
static const QString AttrWidth
static const QString TagNotes
static const QString AttrH92
void activeDraftBlockChanged(const QString &newName)
activeDraftBlockChanged change active draft block.
static const QString TagTools
QString getGroupName(quint32 id)
static const QString AttrH80
void patternChanged(bool saved)
patternChanged emit if we have unsaved change.
static const QString TagGroupItem
void ClearMainWindow()
static const QString AttrH86
void SetCustomerName(const QString &qsName)
static const QString AttrS40
QString GetVersion() const
static const QString TagGroup
static const QString AttrNodeNotchSubType
QDomElement addGroupItems(const QString &name, const QMap< quint32, quint32 > &groupData)
static const QString AttrH74
QString GetDescription() const
static const QString NodeSplinePath
static const QString AttrPath
static const QString TagCustomerName
static const QString AttrGroupLocked
static const QString AttrH194
static const QString TagPatternInfo
static const QString AttrS32
QDomElement createGroup(quint32 id, const QString &name, const QString &color, const QString &type, const QString &weight, const QMap< quint32, quint32 > &groupData)
static const QString TagHeights
static const QString AttrH56
QVector< VToolRecord > history
history history records.
static const QString TagElArc
static const QString AttrH110
QVector< VFormulaField > ListOperationExpressions() const
static const QString NodeSpline
static const QString AttrH146
bool getGroupVisibility(quint32 id)
static const QString AttrNodeShowSecondNotch
static const QString AttrQuantity
QVector< VFormulaField > ListGrainlineExpressions(const QDomElement &element) const
static const QString AttrS44
QVector< VFormulaField > ListPathPointExpressions() const
static const QString AttrRotationWay
void parseGroups(const QDomElement &domElement)
static QHash< quint32, VDataTool * > tools
tools list with pointer on tools.
QString getGroupLineWeight(quint32 id)
void UpdatePatternLabel()
static const QString AttrH164
QMap< GHeights, bool > GetGradationHeights() const
static const QString AttrOrientation
static const QString AttrSAAfter
virtual ~VAbstractPattern() Q_DECL_EQ_DEFAULT
QVector< VFormulaField > ListElArcExpressions() const
static const QString TagPatternLabel
void selectedPiece(quint32 id)
static const QString AttrTool
static const QString AttrH188
static VPiecePath ParsePathNodes(const QDomElement &domElement)
QVector< VToolRecord > getBlockHistory() const
QString GetImage() const
static const QString AttrS46
static const QString TagLine
void setGroupName(quint32 id, const QString &name)
virtual void CreateEmptyFile()=0
static VDataTool * getTool(quint32 id)
getTool return tool from tool list.
QDomElement getDraw(const QString &name) const
static const QString TagIncrement
static const QString AttrNodeNotchLength
static const QString TagGroups
bool getActiveDraftElement(QDomElement &element) const
getActiveDraftElement return draftBlock element for current draft block.
static const QString TagPatternNum
static void RemoveTool(quint32 id)
quint32 cursor
cursor cursor keep id tool after which we will add new tool in file.
void setDefaultPen(Pen pen)
static const QString AttrNodeNotchCount
static const QString AttrSABefore
static const QString AttrH98
void SetEnabledGUI(bool enabled)
static VPieceNode ParseSANode(const QDomElement &domElement)
static const QString AttrArrows
static const QString AttrS22
static const QString AttrS38
static const QString AttrH62
QStringList ListMeasurements() const
static const QString TagDraftBlock
static QVector< CustomSARecord > ParsePieceCSARecords(const QDomElement &domElement)
QString GetCustomerName() const
QStringList ListIncrements() const
void setGroupLineType(quint32 id, QString type)
QMap< GSizes, bool > GetGradationSizes() const
QString getGroupLineType(quint32 id)
static VPiecePath ParsePieceNodes(const QDomElement &domElement)
bool IsVariable(const QString &token) const
static const QString IncrementName
static const QString NodeElArc
void InsertTag(const QStringList &tags, const QDomElement &element)
static const QString AttrS30
QString useGroupLineWeight(quint32 toolId, QString weight)
QMap< quint32, Tool > getGroupObjHistory() const
static const QString TagOperation
static const QString AttrS64
static const QString AttrIncludeAs
void showPiece(quint32 id)
void setCursor(const quint32 &value)
static const QString AttrH104
QString getDefaultLineType() const
static const QString AttrH200
void SetNotes(const QString &text)
static const QString IncrementFormula
static const QString AttrH176
bool getActiveNodeElement(const QString &name, QDomElement &element) const
getActiveNodeElement find element in current draft block by name.
void SetCompanyName(const QString &qsName)
QString useGroupLineType(quint32 toolId, QString type)
void SetLabelDateFormat(const QString &format)
static const QString AttrH152
static const QString AttrNodeReverse
QString getActiveDraftBlockName() const
getActiveDraftBlockName return current draft block name.
static const QString AttrS48
QMap< quint32, QString > getGroupsContainingItem(quint32 toolId, quint32 objectId, bool containsItem)
Returns the groups that contain or do not contain the item identified by the toolid and the objectid.
QVector< VFormulaField > ListExpressions() const
quint32 getCursor() const
static const QString AttrNodeExcluded
bool groupNameExists(const QString &groupName)
static const QString TagPath
static const QString TagPiece
static const QString TagCompanyName
static const QString AttrH116
QVector< VDataTool * > toolsOnRemove
QVector< VFormulaField > ListIncrementExpressions() const
static const QString AttrH122
void SetGradationSizes(const QMap< GSizes, bool > &options)
QDomElement CheckTagExists(const QString &tag)
static const QString AttrS24
bool hasGroupItem(const QDomElement &domElement, quint32 toolId, quint32 objectId)
Checks if the given group has the item with the given toolId and objectId.
static void ToolExists(const quint32 &id)
static const QString TagImage
static const QString AttrS42
QVector< VFormulaField > ListPointExpressions() const
static const QString AttrDateFormat
static const QString TagCalculation
QVector< VFormulaField > ListNodesExpressions(const QDomElement &nodes) const
QString getGroupColor(quint32 id)
static const QString AttrH170
static const QString TagGrainline
virtual QString GenerateSuffix(const QString &type) const =0
void setCurrentDraftBlock(const QString &patterPiece)
void setGroupVisibility(quint32 id, bool visible)
QString GetLabelTimeFormat() const
static const QString AttrName
QVector< VFormulaField > ListPieceExpressions() const
static const QString AttrNodeNotchAngle
static const QString AttrNodeIsNotch
qreal getDefaultLineWeight() const
QString GetNotes() const
void SetLabelTimeFormat(const QString &format)
static const QString AttrVisible
static const QString TagPoint
static const QString TagGradation
bool modified
modified keep state of the document for cases that do not cover QUndoStack
QString getDefaultLineColor() const
void changeActiveDraftBlock(const QString &name, const Document &parse=Document::FullParse)
changeActiveDraftBlock set new active draft block name.
static const QString AttrS68
static const QString AttrS72
static const QString AttrNodeNotchWidth
virtual void DecrementReferens(quint32 id) const =0
static const QString AttrDefHeight
QVector< VToolRecord > * getHistory()
getHistory return list with list of history records.
static const QString TagNodes
static const QString AttrNodeShowNotch
QVector< VFormulaField > ListSplineExpressions() const
static bool patternLabelWasChanged
static const QString TagIncrements
int getActiveDraftBlockIndex() const
void SetMPath(const QString &path)
void SetDescription(const QString &text)
void patternHasGroups(bool value)
QStringList patternPieces
patternPieces list of patern pieces names for combobox
static const QString TagSizes
static QVector< quint32 > ParsePieceInternalPaths(const QDomElement &domElement)
QVector< VFormulaField > ListPathExpressions() const
The VContainer class container of all variables.
Definition: vcontainer.h:141
The VDataTool class need for getting access to data container of tool.
Definition: vdatatool.h:71
The VDomDocument class represents a Seamly2D document (.val file).
Definition: vdomdocument.h:105
The VToolRecord class record about tool in history.
Definition: vtoolrecord.h:64
GHeights
Definition: def.h:280
GSizes
Definition: def.h:287
Tool
Definition: def.h:161
The CustomSA struct contains record about custom seam allowanse (SA).
Definition: def.h:510
QDomElement element
Document
@ LiteBlockParse
HCrossCurvesPoint
VCrossCurvesPoint
AxisType
@ HorizontalAxis
LabelType
CrossCirclesPoint
UndoCommand
Definition: vundocommand.h:70