Seamly2D
Code documentation
UnionTool Class Reference

The UnionTool class tool union details. More...

#include <union_tool.h>

Inheritance diagram for UnionTool:
Collaboration diagram for UnionTool:

Public Slots

virtual void FullUpdateFromFile () Q_DECL_OVERRIDE
 FullUpdateFromFile update tool data form file. More...
 
virtual void AllowHover (bool) Q_DECL_OVERRIDE
 
virtual void AllowSelecting (bool) Q_DECL_OVERRIDE
 
- Public Slots inherited from VAbstractTool
virtual void FullUpdateFromFile ()=0
 FullUpdateFromFile update tool data form file. More...
 
virtual void AllowHover (bool enabled)=0
 
virtual void AllowSelecting (bool enabled)=0
 
virtual void ToolSelectionType (const SelectionType &type)
 

Public Member Functions

virtual QString getTagName () const Q_DECL_OVERRIDE
 
virtual void ShowVisualization (bool show) Q_DECL_OVERRIDE
 
virtual void incrementReferens () Q_DECL_OVERRIDE
 incrementReferens increment referens. More...
 
virtual void decrementReferens () Q_DECL_OVERRIDE
 decrementReferens decrement referens. More...
 
virtual void GroupVisibility (quint32 object, bool visible) Q_DECL_OVERRIDE
 
- Public Member Functions inherited from VAbstractTool
 VAbstractTool (VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent=nullptr)
 VAbstractTool container. More...
 
virtual ~VAbstractTool () Q_DECL_OVERRIDE
 
quint32 getId () const
 getId return object id. More...
 
const VContainergetData () const
 getData return pointer to data container. More...
 
QMap< QString, quint32 > PointsList () const
 
virtual void setPointNamePosition (quint32 id, const QPointF &pos)
 
virtual void setPointNameVisiblity (quint32 id, bool visible)
 
- Public Member Functions inherited from VDataTool
 VDataTool (VContainer *data, QObject *parent=nullptr)
 VDataTool constructor. More...
 
virtual ~VDataTool () Q_DECL_EQ_DEFAULT
 
VContainer getData () const
 getData return data container. More...
 
void setData (const VContainer *value)
 setData set data container. More...
 
virtual quint32 referens () const
 referens return count of referens. More...
 

Static Public Member Functions

static UnionToolCreate (QSharedPointer< DialogTool > dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
 Create help create tool from GUI. More...
 
static UnionToolCreate (const quint32 _id, const UnionToolInitData &initData)
 Create help create tool. More...
 
- Static Public Member Functions inherited from VAbstractTool
static qreal CheckFormula (const quint32 &toolId, QString &formula, VContainer *data)
 CheckFormula check formula. More...
 
static const QStringList Colors ()
 
static QMap< QString, QString > ColorsList ()
 
static QMap< QString, QString > supportColorsList ()
 
static QMap< QString, QString > backgroundColorsList ()
 
static QPixmap createColorIcon (const int w, const int h, const QString &color)
 
static const QStringList fills ()
 
static void AddRecord (const quint32 id, const Tool &toolType, VAbstractPattern *doc)
 AddRecord add record about tool in history. More...
 
static void AddNodes (VAbstractPattern *doc, QDomElement &domElement, const VPiecePath &path)
 
static void AddNodes (VAbstractPattern *doc, QDomElement &domElement, const VPiece &piece)
 
template<typename T >
static quint32 CreateNode (VContainer *data, quint32 id)
 CreateNode create new node for detail. More...
 

Static Public Attributes

static const QString ToolType = QStringLiteral("union")
 
static const QString TagUnionPiece = QStringLiteral("unionPiece")
 
static const QString TagNode = QStringLiteral("node")
 
static const QString TagChildren = QStringLiteral("children")
 
static const QString TagChild = QStringLiteral("child")
 
static const QString AttrIndexD1 = QStringLiteral("indexD1")
 
static const QString AttrIndexD2 = QStringLiteral("indexD2")
 
static const QString AttrIdObject = QStringLiteral("idObject")
 
static const QString AttrNodeType = QStringLiteral("nodeType")
 
static const QString NodeTypeContour = QStringLiteral("Contour")
 
static const QString NodeTypeModeling = QStringLiteral("Modeling")
 
- Static Public Attributes inherited from VAbstractTool
static bool m_suppressContextMenu = false
 
static const QString AttrInUse = QStringLiteral("inUse")
 

Protected Member Functions

virtual void AddToFile () Q_DECL_OVERRIDE
 AddToFile add tag with Information about tool into file. More...
 
virtual void SetVisualization () Q_DECL_OVERRIDE
 
- Protected Member Functions inherited from VAbstractTool
virtual void RefreshDataInFile ()
 RefreshDataInFile refresh attributes in file. If attributes don't exist create them. More...
 
virtual void RemoveReferens ()
 RemoveReferens decrement value of reference. More...
 
virtual void deleteTool (bool ask=true)
 deleteTool full delete object form scene and file. More...
 
template<typename T >
void AddVisualization ()
 
virtual void ToolCreation (const Source &typeCreation)
 

Private Member Functions

 UnionTool (quint32 id, const UnionToolInitData &initData, QObject *parent=nullptr)
 piece2_Index index edge in second detail. More...
 
void addPiece (QDomElement &domElement, const VPiece &d) const
 addPiece add piece to xml file. More...
 
void AddToModeling (const QDomElement &domElement)
 AddToModeling add tool to xml tree. More...
 
QVector< quint32 > GetReferenceObjects () const
 
QVector< quint32 > ReferenceObjects (const QDomElement &root, const QString &tag, const QString &attribute) const
 

Private Attributes

quint32 piece1_Id
 
quint32 piece2_Id
 d1 first detail id. More...
 
quint32 piece1_Index
 d2 second detail id. More...
 
quint32 piece2_Index
 piece1_Index index edge in first detail. More...
 

Additional Inherited Members

- Signals inherited from VAbstractTool
void toolHasChanges ()
 toolHasChanges emit if tool create change that need save. More...
 
void chosenTool (quint32 id, SceneObject type)
 chosenTool emit if object was clicked. More...
 
void LiteUpdateTree (const Document &parse)
 FullUpdateTree emit if need reparse pattern file. More...
 
void ToolTip (const QString &toolTip)
 
- Static Protected Member Functions inherited from VAbstractTool
static int ConfirmDeletion ()
 
static QDomElement AddSANode (VAbstractPattern *doc, const QString &tagName, const VPieceNode &node)
 
static void AddNode (VAbstractPattern *doc, QDomElement &domElement, const VPieceNode &node)
 
static QVector< VPieceNodePrepareNodes (const VPiecePath &path, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
 
static quint32 PrepareNode (const VPieceNode &node, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
 
- Protected Attributes inherited from VAbstractTool
VAbstractPatterndoc
 doc dom document container More...
 
const quint32 m_id
 id object id. More...
 
QPointer< Visualizationvis
 
SelectionType selectionType
 
- Protected Attributes inherited from VDataTool
VContainer data
 data container with data More...
 
quint32 _referens
 _referens keep count tools what use this tool. If value more than 1 you can't delete tool. More...
 

Detailed Description

The UnionTool class tool union details.

Definition at line 104 of file union_tool.h.

Constructor & Destructor Documentation

◆ UnionTool()

UnionTool::UnionTool ( quint32  id,
const UnionToolInitData initData,
QObject *  parent = nullptr 
)
private

piece2_Index index edge in second detail.

UnionTool costructor.

Parameters
idobject id in container.
initDataglobal init data.
parentparent object.

Definition at line 1425 of file union_tool.cpp.

References VDataTool::_referens, VAbstractTool::ToolCreation(), and UnionToolInitData::typeCreation.

Referenced by Create().

Member Function Documentation

◆ addPiece()

void UnionTool::addPiece ( QDomElement &  domElement,
const VPiece piece 
) const
private

◆ AddToFile()

void UnionTool::AddToFile ( )
protectedvirtual

◆ AddToModeling()

void UnionTool::AddToModeling ( const QDomElement &  domElement)
private

AddToModeling add tool to xml tree.

Parameters
domElementtag in xml tree.

Definition at line 1608 of file union_tool.cpp.

References VAbstractTool::doc, QT_WARNING_POP::getBlockName(), VAbstractPattern::getDraftBlockElement(), piece1_Id, piece2_Id, SCASSERT, and VAbstractPattern::TagModeling.

Referenced by AddToFile().

◆ AllowHover

virtual void UnionTool::AllowHover ( bool  )
inlinevirtualslot

Definition at line 135 of file union_tool.h.

◆ AllowSelecting

virtual void UnionTool::AllowSelecting ( bool  )
inlinevirtualslot

Definition at line 136 of file union_tool.h.

◆ Create() [1/2]

UnionTool * UnionTool::Create ( const quint32  _id,
const UnionToolInitData initData 
)
static

◆ Create() [2/2]

UnionTool * UnionTool::Create ( QSharedPointer< DialogTool dialog,
VMainGraphicsScene scene,
VAbstractPattern doc,
VContainer data 
)
static

Create help create tool from GUI.

Parameters
dialogdialog.
docdom document container.
datacontainer with variables.

Definition at line 1503 of file union_tool.cpp.

References VDataTool::data, VAbstractTool::doc, FromGui, FullParse, UnionToolInitData::piece1_Id, qApp, and SCASSERT.

Referenced by VPattern::ParseToolsElement().

◆ decrementReferens()

◆ FullUpdateFromFile

virtual void UnionTool::FullUpdateFromFile ( )
inlinevirtualslot

FullUpdateFromFile update tool data form file.

Definition at line 134 of file union_tool.h.

◆ GetReferenceObjects()

◆ getTagName()

QString UnionTool::getTagName ( ) const
virtual

◆ GroupVisibility()

void UnionTool::GroupVisibility ( quint32  object,
bool  visible 
)
virtual

Implements VDataTool.

Definition at line 1490 of file union_tool.cpp.

◆ incrementReferens()

◆ ReferenceObjects()

QVector< quint32 > UnionTool::ReferenceObjects ( const QDomElement &  root,
const QString &  tag,
const QString &  attribute 
) const
private

◆ SetVisualization()

virtual void UnionTool::SetVisualization ( )
inlineprotectedvirtual

Implements VAbstractTool.

Definition at line 140 of file union_tool.h.

◆ ShowVisualization()

void UnionTool::ShowVisualization ( bool  show)
virtual

Implements VAbstractTool.

Definition at line 1444 of file union_tool.cpp.

Member Data Documentation

◆ AttrIdObject

const QString UnionTool::AttrIdObject = QStringLiteral("idObject")
static

Definition at line 119 of file union_tool.h.

Referenced by GetReferenceObjects().

◆ AttrIndexD1

const QString UnionTool::AttrIndexD1 = QStringLiteral("indexD1")
static

Definition at line 117 of file union_tool.h.

Referenced by AddToFile(), and VPattern::ParseToolsElement().

◆ AttrIndexD2

const QString UnionTool::AttrIndexD2 = QStringLiteral("indexD2")
static

Definition at line 118 of file union_tool.h.

Referenced by AddToFile(), and VPattern::ParseToolsElement().

◆ AttrNodeType

const QString UnionTool::AttrNodeType = QStringLiteral("nodeType")
static

Definition at line 120 of file union_tool.h.

◆ NodeTypeContour

const QString UnionTool::NodeTypeContour = QStringLiteral("Contour")
static

Definition at line 121 of file union_tool.h.

◆ NodeTypeModeling

const QString UnionTool::NodeTypeModeling = QStringLiteral("Modeling")
static

Definition at line 122 of file union_tool.h.

◆ piece1_Id

quint32 UnionTool::piece1_Id
private

Definition at line 145 of file union_tool.h.

Referenced by AddToFile(), and AddToModeling().

◆ piece1_Index

quint32 UnionTool::piece1_Index
private

d2 second detail id.

Definition at line 147 of file union_tool.h.

Referenced by AddToFile().

◆ piece2_Id

quint32 UnionTool::piece2_Id
private

d1 first detail id.

Definition at line 146 of file union_tool.h.

Referenced by AddToFile(), and AddToModeling().

◆ piece2_Index

quint32 UnionTool::piece2_Index
private

piece1_Index index edge in first detail.

Definition at line 148 of file union_tool.h.

Referenced by AddToFile().

◆ TagChild

const QString UnionTool::TagChild = QStringLiteral("child")
static

Definition at line 116 of file union_tool.h.

Referenced by QT_WARNING_POP::GetChildren(), and QT_WARNING_POP::SaveChildren().

◆ TagChildren

const QString UnionTool::TagChildren = QStringLiteral("children")
static

Definition at line 115 of file union_tool.h.

Referenced by QT_WARNING_POP::GetChildren(), and QT_WARNING_POP::GetTagChildren().

◆ TagNode

const QString UnionTool::TagNode = QStringLiteral("node")
static

Definition at line 114 of file union_tool.h.

Referenced by GetReferenceObjects().

◆ TagUnionPiece

const QString UnionTool::TagUnionPiece = QStringLiteral("unionPiece")
static

◆ ToolType

const QString UnionTool::ToolType = QStringLiteral("union")
static

Definition at line 112 of file union_tool.h.

Referenced by AddToFile(), and VPattern::ParseToolsElement().


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