Seamly2D
Code documentation
VLitePattern Class Reference

#include <vlitepattern.h>

Inheritance diagram for VLitePattern:
Collaboration diagram for VLitePattern:

Public Slots

virtual void LiteParseTree (const Document &parse) Q_DECL_OVERRIDE
 
- Public Slots inherited from VAbstractPattern
virtual void LiteParseTree (const Document &parse)=0
 
void haveLiteChange ()
 haveLiteChange we have unsaved change. More...
 
void NeedFullParsing ()
 
void ClearScene ()
 
void updatePieceList (quint32 id)
 
void selectedPiece (quint32 id)
 

Public Member Functions

 VLitePattern (QObject *parent=nullptr)
 
virtual void CreateEmptyFile () Q_DECL_OVERRIDE
 
virtual void IncrementReferens (quint32 id) const Q_DECL_OVERRIDE
 
virtual void DecrementReferens (quint32 id) const Q_DECL_OVERRIDE
 
virtual QString GenerateLabel (const LabelType &type, const QString &reservedName=QString()) const Q_DECL_OVERRIDE
 
virtual QString GenerateSuffix (const QString &type) const Q_DECL_OVERRIDE
 
virtual void UpdateToolData (const quint32 &id, VContainer *data) Q_DECL_OVERRIDE
 
- Public Member Functions inherited from VAbstractPattern
 VAbstractPattern (QObject *parent=nullptr)
 
virtual ~VAbstractPattern () Q_DECL_EQ_DEFAULT
 
QStringList ListMeasurements () const
 
QVector< VFormulaFieldListExpressions () const
 
QVector< VFormulaFieldListIncrementExpressions () const
 
void changeActiveDraftBlock (const QString &name, const Document &parse=Document::FullParse)
 changeActiveDraftBlock set new active draft block name. More...
 
QString getActiveDraftBlockName () const
 getActiveDraftBlockName return current draft block name. More...
 
bool draftBlockNameExists (const QString &name) const
 draftBlockNameExists check if draft block with this name exists. More...
 
int draftBlockCount () const
 
QDomElement getDraftBlockElement (const QString &name)
 
bool renameDraftBlock (const QString &oldName, const QString &newName)
 renameDraftBlock change draft block name. More...
 
bool appendDraftBlock (const QString &name)
 appendDraftBlock add new draft block. More...
 
bool getActiveNodeElement (const QString &name, QDomElement &element) const
 getActiveNodeElement find element in current draft block by name. More...
 
quint32 getCursor () const
 
void setCursor (const quint32 &value)
 
void setDefaultPen (Pen pen)
 
QString getDefaultLineColor () const
 
qreal getDefaultLineWeight () const
 
QString getDefaultLineType () const
 
void AddToolOnRemove (VDataTool *tool)
 
QVector< VToolRecord > * getHistory ()
 getHistory return list with list of history records. More...
 
QVector< VToolRecordgetBlockHistory () const
 
QMap< quint32, ToolgetGroupObjHistory () const
 
QString MPath () const
 
void SetMPath (const QString &path)
 
quint32 SiblingNodeId (const quint32 &nodeId) const
 
QStringList getPatternPieces () const
 
QMap< GHeights, bool > GetGradationHeights () const
 
void SetGradationHeights (const QMap< GHeights, bool > &options)
 
QMap< GSizes, bool > GetGradationSizes () const
 
void SetGradationSizes (const QMap< GSizes, bool > &options)
 
QString GetDescription () const
 
void SetDescription (const QString &text)
 
QString GetNotes () const
 
void SetNotes (const QString &text)
 
QString GetPatternName () const
 
void SetPatternName (const QString &qsName)
 
QString GetCompanyName () const
 
void SetCompanyName (const QString &qsName)
 
QString GetPatternNumber () const
 
void SetPatternNumber (const QString &qsNum)
 
QString GetCustomerName () const
 
void SetCustomerName (const QString &qsName)
 
QString GetLabelDateFormat () const
 
void SetLabelDateFormat (const QString &format)
 
QString GetLabelTimeFormat () const
 
void SetLabelTimeFormat (const QString &format)
 
void setPatternLabelTemplate (const QVector< VLabelTemplateLine > &lines)
 
QVector< VLabelTemplateLinegetPatternLabelTemplate () const
 
void SetPatternWasChanged (bool changed)
 
bool GetPatternWasChanged () const
 
QString GetImage () const
 
QString GetImageExtension () const
 
void SetImage (const QString &text, const QString &extension)
 
void DeleteImage ()
 
QString GetVersion () const
 
void SetVersion ()
 
QVector< quint32 > getOpItems (const quint32 &toolId, const QString &itemType)
 getOpItems get vector of operation tool obects. More...
 
QVector< quint32 > getDartItems (const quint32 &toolId)
 
bool IsModified () const
 
void SetModified (bool modified)
 
QDomElement getDraw (const QString &name) const
 
void parseGroups (const QDomElement &domElement)
 
QDomElement createGroups ()
 
QDomElement createGroup (quint32 id, const QString &name, const QString &color, const QString &type, const QString &weight, const QMap< quint32, quint32 > &groupData)
 
QDomElement addGroupItems (const QString &name, const QMap< quint32, quint32 > &groupData)
 
QString getGroupName (quint32 id)
 
void setGroupName (quint32 id, const QString &name)
 
QMap< quint32, GroupAttributesgetGroups ()
 
QStringList groupListByName ()
 
QDomElement getGroupByName (const QString &name)
 
quint32 getGroupIdByName (const QString &name)
 
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. More...
 
void deleteToolFromGroup (quint32 toolId)
 Deletes an item from the group containing the toolId. More...
 
void addToolToGroup (quint32 toolId, quint32 objectId, const QString &groupName)
 Adds an item to the given group with the given toolId and objectId. More...
 
QDomElement addGroupItem (quint32 toolId, quint32 objectId, quint32 groupId)
 Adds an item to the given group with the given toolId and objectId. More...
 
QDomElement removeGroupItem (quint32 toolId, quint32 objectId, quint32 groupId)
 Removes the item of given toolId and objectId from the group of given groupId. More...
 
bool isGroupEmpty (quint32 id)
 Returns true if the given group is empty. More...
 
bool getGroupVisibility (quint32 id)
 
void setGroupVisibility (quint32 id, bool visible)
 
bool getGroupLock (quint32 id)
 
void setGroupLock (quint32 id, bool locked)
 
QString getGroupColor (quint32 id)
 
void setGroupColor (quint32 id, QString color)
 
QString getGroupLineType (quint32 id)
 
void setGroupLineType (quint32 id, QString type)
 
QString getGroupLineWeight (quint32 id)
 
void setGroupLineWeight (quint32 id, QString weight)
 
bool groupNameExists (const QString &groupName)
 
QString useGroupColor (quint32 toolId, QString color)
 
QString useGroupLineType (quint32 toolId, QString type)
 
QString useGroupLineWeight (quint32 toolId, QString weight)
 
QPair< bool, QMap< quint32, quint32 > > parseItemElement (const QDomElement &domElement)
 
- Public Member Functions inherited from VDomDocument
 VDomDocument ()
 
virtual ~VDomDocument () Q_DECL_EQ_DEFAULT
 
QDomElement elementById (quint32 id, const QString &tagName=QString())
 
template<typename T >
void SetAttribute (QDomElement &domElement, const QString &name, const T &value) const
 SetAttribute set attribute in pattern file. Replace "," by ".". More...
 
Unit MUnit () const
 
virtual void setXMLContent (const QString &fileName)
 
virtual bool SaveDocument (const QString &fileName, QString &error)
 
QString Major () const
 
QString Minor () const
 
QString Patch () const
 
QDomNode ParentNodeById (const quint32 &nodeId)
 
QDomElement CloneNodeById (const quint32 &nodeId)
 
QDomElement NodeById (const quint32 &nodeId)
 
QVector< VLabelTemplateLineGetLabelTemplate (const QDomElement &element) const
 
void SetLabelTemplate (QDomElement &element, const QVector< VLabelTemplateLine > &lines)
 
template<>
void SetAttribute (QDomElement &domElement, const QString &name, const QString &value) const
 
template<>
void SetAttribute (QDomElement &domElement, const QString &name, const bool &value) const
 
template<>
void SetAttribute (QDomElement &domElement, const QString &name, const MeasurementsType &value) const
 

Additional Inherited Members

- Signals inherited from VAbstractPattern
void activeDraftBlockChanged (const QString &newName)
 activeDraftBlockChanged change active draft block. More...
 
void ChangedCursor (quint32 id)
 ChangedCursor change cursor position. More...
 
void draftBlockNameChanged (const QString &oldName, const QString &newName)
 draftBlockNameChanged save new name draft block. More...
 
void FullUpdateFromFile ()
 FullUpdateFromFile update tool data form file. More...
 
void patternChanged (bool saved)
 patternChanged emit if we have unsaved change. More...
 
void UpdatePatternLabel ()
 
void ShowTool (quint32 id, bool enable)
 ShowTool highlight tool. More...
 
void ClearMainWindow ()
 
void UndoCommand ()
 
void SetEnabledGUI (bool enabled)
 
void CheckLayout ()
 
void UpdateInLayoutList (quint32 id)
 
void showPiece (quint32 id)
 
void setCurrentDraftBlock (const QString &patterPiece)
 
void patternHasGroups (bool value)
 
void updateGroups ()
 
- Static Public Member Functions inherited from VAbstractPattern
static VDataToolgetTool (quint32 id)
 getTool return tool from tool list. More...
 
static void AddTool (quint32 id, VDataTool *tool)
 AddTool add tool to list tools. More...
 
static void RemoveTool (quint32 id)
 
static VPiecePath ParsePieceNodes (const QDomElement &domElement)
 
static QVector< CustomSARecordParsePieceCSARecords (const QDomElement &domElement)
 
static QVector< quint32 > ParsePieceInternalPaths (const QDomElement &domElement)
 
static QVector< quint32 > ParsePieceAnchors (const QDomElement &domElement)
 
- Static Public Member Functions inherited from VDomDocument
static quint32 GetParametrUInt (const QDomElement &domElement, const QString &name, const QString &defValue)
 Returns the long long value of the given attribute. RENAME: GetParameterLongLong? More...
 
static bool getParameterBool (const QDomElement &domElement, const QString &name, const QString &defValue)
 
static NodeUsage GetParametrUsage (const QDomElement &domElement, const QString &name)
 
static void SetParametrUsage (QDomElement &domElement, const QString &name, const NodeUsage &value)
 
static QString GetParametrString (const QDomElement &domElement, const QString &name, const QString &defValue=QString())
 Returns the string value of the given attribute. RENAME: see above. More...
 
static QString GetParametrEmptyString (const QDomElement &domElement, const QString &name)
 
static qreal GetParametrDouble (const QDomElement &domElement, const QString &name, const QString &defValue)
 Returns the double value of the given attribute. More...
 
static quint32 getParameterId (const QDomElement &domElement)
 getParameterId return value id attribute. More...
 
static void ValidateXML (const QString &schema, const QString &fileName)
 ValidateXML validate xml file by xsd schema. More...
 
static QString UnitsHelpString ()
 
static void RemoveAllChildren (QDomElement &domElement)
 RemoveAllChildren remove all children from file. More...
 
static bool SafeCopy (const QString &source, const QString &destination, QString &error)
 
- Static Public Attributes inherited from VAbstractPattern
static const QString TagPattern = QStringLiteral("pattern")
 
static const QString TagCalculation = QStringLiteral("calculation")
 
static const QString TagModeling = QStringLiteral("modeling")
 
static const QString TagPieces = QStringLiteral("pieces")
 
static const QString TagPiece = QStringLiteral("piece")
 
static const QString TagDescription = QStringLiteral("description")
 
static const QString TagImage = QStringLiteral("image")
 
static const QString TagNotes = QStringLiteral("notes")
 
static const QString TagMeasurements = QStringLiteral("measurements")
 
static const QString TagIncrements = QStringLiteral("increments")
 
static const QString TagIncrement = QStringLiteral("increment")
 
static const QString TagDraftBlock = QStringLiteral("draftBlock")
 
static const QString TagGroups = QStringLiteral("groups")
 
static const QString TagGroup = QStringLiteral("group")
 
static const QString TagGroupItem = QStringLiteral("item")
 
static const QString TagPoint = QStringLiteral("point")
 
static const QString TagSpline = QStringLiteral("spline")
 
static const QString TagArc = QStringLiteral("arc")
 
static const QString TagElArc = QStringLiteral("elArc")
 
static const QString TagTools = QStringLiteral("tools")
 
static const QString TagOperation = QStringLiteral("operation")
 
static const QString TagGradation = QStringLiteral("gradation")
 
static const QString TagHeights = QStringLiteral("heights")
 
static const QString TagSizes = QStringLiteral("sizes")
 
static const QString TagData = QStringLiteral("data")
 
static const QString TagPatternInfo = QStringLiteral("patternInfo")
 
static const QString TagPatternName = QStringLiteral("patternName")
 
static const QString TagPatternNum = QStringLiteral("patternNumber")
 
static const QString TagCompanyName = QStringLiteral("company")
 
static const QString TagCustomerName = QStringLiteral("customer")
 
static const QString TagPatternLabel = QStringLiteral("patternLabel")
 
static const QString TagGrainline = QStringLiteral("grainline")
 
static const QString TagPath = QStringLiteral("path")
 
static const QString TagNodes = QStringLiteral("nodes")
 
static const QString TagNode = QStringLiteral("node")
 
static const QString TagLine = QStringLiteral("line")
 
static const QString AttrName = QStringLiteral("name")
 
static const QString AttrVisible = QStringLiteral("visible")
 
static const QString AttrGroupLocked = QStringLiteral("locked")
 
static const QString AttrGroupColor = QStringLiteral("groupColor")
 
static const QString AttrObject = QStringLiteral("object")
 
static const QString AttrTool = QStringLiteral("tool")
 
static const QString AttrType = QStringLiteral("type")
 
static const QString AttrLetter = QStringLiteral("letter")
 
static const QString AttrAnnotation = QStringLiteral("annotation")
 
static const QString AttrOrientation = QStringLiteral("orientation")
 
static const QString AttrRotationWay = QStringLiteral("rotationWay")
 
static const QString AttrTilt = QStringLiteral("tilt")
 
static const QString AttrFoldPosition = QStringLiteral("foldPosition")
 
static const QString AttrQuantity = QStringLiteral("quantity")
 
static const QString AttrOnFold = QStringLiteral("onFold")
 
static const QString AttrDateFormat = QStringLiteral("dateFormat")
 
static const QString AttrTimeFormat = QStringLiteral("timeFormat")
 
static const QString AttrArrows = QStringLiteral("arrows")
 
static const QString AttrNodeReverse = QStringLiteral("reverse")
 
static const QString AttrNodeExcluded = QStringLiteral("excluded")
 
static const QString AttrNodeIsNotch = QStringLiteral("notch")
 
static const QString AttrNodeNotchType = QStringLiteral("notchType")
 
static const QString AttrNodeNotchSubType = QStringLiteral("notchSubtype")
 
static const QString AttrNodeShowNotch = QStringLiteral("showNotch")
 
static const QString AttrNodeShowSecondNotch = QStringLiteral("showSecondNotch")
 
static const QString AttrNodeNotchLength = QStringLiteral("notchLength")
 
static const QString AttrNodeNotchWidth = QStringLiteral("notchWidth")
 
static const QString AttrNodeNotchAngle = QStringLiteral("notchAngle")
 
static const QString AttrNodeNotchCount = QStringLiteral("notchCount")
 
static const QString AttrSABefore = QStringLiteral("before")
 
static const QString AttrSAAfter = QStringLiteral("after")
 
static const QString AttrStart = QStringLiteral("start")
 
static const QString AttrPath = QStringLiteral("path")
 
static const QString AttrEnd = QStringLiteral("end")
 
static const QString AttrIncludeAs = QStringLiteral("includeAs")
 
static const QString AttrWidth = QStringLiteral("width")
 
static const QString AttrRotation = QStringLiteral("rotation")
 
static const QString AttrAll = QStringLiteral("all")
 
static const QString AttrH50 = QStringLiteral("h50")
 
static const QString AttrH56 = QStringLiteral("h56")
 
static const QString AttrH62 = QStringLiteral("h62")
 
static const QString AttrH68 = QStringLiteral("h68")
 
static const QString AttrH74 = QStringLiteral("h74")
 
static const QString AttrH80 = QStringLiteral("h80")
 
static const QString AttrH86 = QStringLiteral("h86")
 
static const QString AttrH92 = QStringLiteral("h92")
 
static const QString AttrH98 = QStringLiteral("h98")
 
static const QString AttrH104 = QStringLiteral("h104")
 
static const QString AttrH110 = QStringLiteral("h110")
 
static const QString AttrH116 = QStringLiteral("h116")
 
static const QString AttrH122 = QStringLiteral("h122")
 
static const QString AttrH128 = QStringLiteral("h128")
 
static const QString AttrH134 = QStringLiteral("h134")
 
static const QString AttrH140 = QStringLiteral("h140")
 
static const QString AttrH146 = QStringLiteral("h146")
 
static const QString AttrH152 = QStringLiteral("h152")
 
static const QString AttrH158 = QStringLiteral("h158")
 
static const QString AttrH164 = QStringLiteral("h164")
 
static const QString AttrH170 = QStringLiteral("h170")
 
static const QString AttrH176 = QStringLiteral("h176")
 
static const QString AttrH182 = QStringLiteral("h182")
 
static const QString AttrH188 = QStringLiteral("h188")
 
static const QString AttrH194 = QStringLiteral("h194")
 
static const QString AttrH200 = QStringLiteral("h200")
 
static const QString AttrS22 = QStringLiteral("s22")
 
static const QString AttrS24 = QStringLiteral("s24")
 
static const QString AttrS26 = QStringLiteral("s26")
 
static const QString AttrS28 = QStringLiteral("s28")
 
static const QString AttrS30 = QStringLiteral("s30")
 
static const QString AttrS32 = QStringLiteral("s32")
 
static const QString AttrS34 = QStringLiteral("s34")
 
static const QString AttrS36 = QStringLiteral("s36")
 
static const QString AttrS38 = QStringLiteral("s38")
 
static const QString AttrS40 = QStringLiteral("s40")
 
static const QString AttrS42 = QStringLiteral("s42")
 
static const QString AttrS44 = QStringLiteral("s44")
 
static const QString AttrS46 = QStringLiteral("s46")
 
static const QString AttrS48 = QStringLiteral("s48")
 
static const QString AttrS50 = QStringLiteral("s50")
 
static const QString AttrS52 = QStringLiteral("s52")
 
static const QString AttrS54 = QStringLiteral("s54")
 
static const QString AttrS56 = QStringLiteral("s56")
 
static const QString AttrS58 = QStringLiteral("s58")
 
static const QString AttrS60 = QStringLiteral("s60")
 
static const QString AttrS62 = QStringLiteral("s62")
 
static const QString AttrS64 = QStringLiteral("s64")
 
static const QString AttrS66 = QStringLiteral("s66")
 
static const QString AttrS68 = QStringLiteral("s68")
 
static const QString AttrS70 = QStringLiteral("s70")
 
static const QString AttrS72 = QStringLiteral("s72")
 
static const QString AttrCustom = QStringLiteral("custom")
 
static const QString AttrDefHeight = QStringLiteral("defHeight")
 
static const QString AttrDefSize = QStringLiteral("defSize")
 
static const QString AttrExtension = QStringLiteral("extension")
 
static const QString IncrementName = QStringLiteral("name")
 
static const QString IncrementFormula = QStringLiteral("formula")
 
static const QString IncrementDescription = QStringLiteral("description")
 
static const QString NodeArc = QStringLiteral("NodeArc")
 
static const QString NodeElArc = QStringLiteral("NodeElArc")
 
static const QString NodePoint = QStringLiteral("NodePoint")
 
static const QString NodeSpline = QStringLiteral("NodeSpline")
 
static const QString NodeSplinePath = QStringLiteral("NodeSplinePath")
 
- Static Public Attributes inherited from VDomDocument
static const QString AttrId = QStringLiteral("id")
 
static const QString AttrText = QStringLiteral("text")
 
static const QString AttrBold = QStringLiteral("bold")
 
static const QString AttrItalic = QStringLiteral("italic")
 
static const QString AttrAlignment = QStringLiteral("alignment")
 
static const QString AttrFSIncrement = QStringLiteral("sfIncrement")
 
static const QString TagVersion = QStringLiteral("version")
 
static const QString TagUnit = QStringLiteral("unit")
 
static const QString TagLine = QStringLiteral("line")
 
- Protected Member Functions inherited from VAbstractPattern
void setActiveDraftBlock (const QString &name)
 setActiveDraftBlock set current draft block. More...
 
QDomElement CheckTagExists (const QString &tag)
 
void InsertTag (const QStringList &tags, const QDomElement &element)
 
void SetChildTag (const QString &qsParent, const QString &qsChild, const QString &qsValue)
 
int getActiveDraftBlockIndex () const
 
bool getActiveDraftElement (QDomElement &element) const
 getActiveDraftElement return draftBlock element for current draft block. More...
 
bool hasGroupItem (const QDomElement &domElement, quint32 toolId, quint32 objectId)
 Checks if the given group has the item with the given toolId and objectId. More...
 
- Protected Member Functions inherited from VDomDocument
bool setTagText (const QString &tag, const QString &text)
 
bool setTagText (const QDomElement &domElement, const QString &text)
 
QString UniqueTagText (const QString &tagName, const QString &defVal=QString()) const
 
void TestUniqueId () const
 TestUniqueId test exist unique id in pattern file. Each id must be unique. More...
 
void CollectId (const QDomElement &node, QVector< quint32 > &vector) const
 
- Static Protected Member Functions inherited from VAbstractPattern
static void ToolExists (const quint32 &id)
 
static VPiecePath ParsePathNodes (const QDomElement &domElement)
 
static VPieceNode ParseSANode (const QDomElement &domElement)
 
- Protected Attributes inherited from VAbstractPattern
QString activeDraftBlock
 activeBlockName name current pattern peace. More...
 
QString m_DefaultLineColor
 
qreal m_DefaultLineWeight
 
QString m_DefaultLineType
 
QString lastSavedExportFormat
 
quint32 cursor
 cursor cursor keep id tool after which we will add new tool in file. More...
 
QVector< VDataTool * > toolsOnRemove
 
QVector< VToolRecordhistory
 history history records. More...
 
QStringList patternPieces
 patternPieces list of patern pieces names for combobox More...
 
bool modified
 modified keep state of the document for cases that do not cover QUndoStack More...
 
- Static Protected Attributes inherited from VAbstractPattern
static QHash< quint32, VDataTool * > tools = QHash<quint32, VDataTool*>()
 tools list with pointer on tools. More...
 
static QVector< VLabelTemplateLinepatternLabelLines = QVector<VLabelTemplateLine>()
 patternLabelLines list to speed up reading a template by many pieces. More...
 
static bool patternLabelWasChanged = false
 

Detailed Description

Definition at line 57 of file vlitepattern.h.

Constructor & Destructor Documentation

◆ VLitePattern()

VLitePattern::VLitePattern ( QObject *  parent = nullptr)
explicit

Definition at line 55 of file vlitepattern.cpp.

Member Function Documentation

◆ CreateEmptyFile()

void VLitePattern::CreateEmptyFile ( )
virtual

Implements VAbstractPattern.

Definition at line 61 of file vlitepattern.cpp.

◆ DecrementReferens()

void VLitePattern::DecrementReferens ( quint32  id) const
virtual

Implements VAbstractPattern.

Definition at line 72 of file vlitepattern.cpp.

◆ GenerateLabel()

QString VLitePattern::GenerateLabel ( const LabelType type,
const QString &  reservedName = QString() 
) const
virtual

Implements VAbstractPattern.

Definition at line 78 of file vlitepattern.cpp.

◆ GenerateSuffix()

QString VLitePattern::GenerateSuffix ( const QString &  type) const
virtual

Implements VAbstractPattern.

Definition at line 86 of file vlitepattern.cpp.

◆ IncrementReferens()

void VLitePattern::IncrementReferens ( quint32  id) const
virtual

Implements VAbstractPattern.

Definition at line 66 of file vlitepattern.cpp.

◆ LiteParseTree

void VLitePattern::LiteParseTree ( const Document parse)
virtualslot

Definition at line 100 of file vlitepattern.cpp.

◆ UpdateToolData()

void VLitePattern::UpdateToolData ( const quint32 &  id,
VContainer data 
)
virtual

Implements VAbstractPattern.

Definition at line 93 of file vlitepattern.cpp.


The documentation for this class was generated from the following files: