53 #ifndef VABSTRACTPATTERN_H
54 #define VABSTRACTPATTERN_H
56 #include <qcompilerdetection.h>
59 #include <QMetaObject>
63 #include <QStringList>
70 #include "../vmisc/def.h"
71 #include "../vwidgets/pen_toolbar.h"
91 QT_WARNING_DISABLE_GCC(
"-Weffc++")
167 QString
MPath() const;
213 void SetImage(const QString &text, const QString &extension);
225 QDomElement
getDraw(const QString &name) const;
229 QDomElement
createGroup(quint32
id, const QString &name, const QString &color, const QString &type,
230 const QString &weight, const
QMap<quint32, quint32> &groupData);
232 QDomElement
addGroupItems(const QString &name, const
QMap<quint32, quint32> &groupData);
244 void addToolToGroup(quint32 toolId, quint32 objectId, const QString &groupName );
246 QDomElement
addGroupItem(quint32 toolId, quint32 objectId, quint32 groupId);
247 QDomElement
removeGroupItem(quint32 toolId, quint32 objectId, quint32 groupId);
508 void InsertTag(const QStringList &tags, const QDomElement &element);
510 void SetChildTag(const QString &qsParent, const QString &qsChild, const QString &qsValue);
515 bool hasGroupItem(const QDomElement &domElement, quint32 toolId, quint32 objectId);
static const QString AttrTimeFormat
qreal m_DefaultLineWeight
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
static const QString AttrS62
static const QString AttrAll
QString GetPatternName() const
QString GetPatternNumber() const
static const QString AttrH134
QString m_DefaultLineType
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
QString m_DefaultLineColor
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
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
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
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.
The VDomDocument class represents a Seamly2D document (.val file).
The CustomSA struct contains record about custom seam allowanse (SA).