Seamly2D
Code documentation
vabstractnode.h
Go to the documentation of this file.
1 /***************************************************************************
2  * *
3  * Copyright (C) 2017 Seamly, LLC *
4  * *
5  * https://github.com/fashionfreedom/seamly2d *
6  * *
7  ***************************************************************************
8  **
9  ** Seamly2D is free software: you can redistribute it and/or modify
10  ** it under the terms of the GNU General Public License as published by
11  ** the Free Software Foundation, either version 3 of the License, or
12  ** (at your option) any later version.
13  **
14  ** Seamly2D is distributed in the hope that it will be useful,
15  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  ** GNU General Public License for more details.
18  **
19  ** You should have received a copy of the GNU General Public License
20  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
21  **
22  **************************************************************************
23 
24  ************************************************************************
25  **
26  ** @file vabstractnode.h
27  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
28  ** @date November 15, 2013
29  **
30  ** @brief
31  ** @copyright
32  ** This source code is part of the Valentine project, a pattern making
33  ** program, whose allow create and modeling patterns of clothing.
34  ** Copyright (C) 2013-2015 Seamly2D project
35  ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
36  **
37  ** Seamly2D is free software: you can redistribute it and/or modify
38  ** it under the terms of the GNU General Public License as published by
39  ** the Free Software Foundation, either version 3 of the License, or
40  ** (at your option) any later version.
41  **
42  ** Seamly2D is distributed in the hope that it will be useful,
43  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
44  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45  ** GNU General Public License for more details.
46  **
47  ** You should have received a copy of the GNU General Public License
48  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
49  **
50  *************************************************************************/
51 
52 #ifndef VABSTRACTNODE_H
53 #define VABSTRACTNODE_H
54 
55 #include <qcompilerdetection.h>
56 #include <QColor>
57 #include <QDomElement>
58 #include <QMetaObject>
59 #include <QObject>
60 #include <QString>
61 #include <QtGlobal>
62 
63 #include "../vabstracttool.h"
64 
65 enum class ParentType : bool {Scene, Item};
66 
67 /**
68  * @brief The VAbstractNode class parent class for all detail node.
69  */
71 {
72  Q_OBJECT
73 public:
74  VAbstractNode(VAbstractPattern *doc, VContainer *data, const quint32 &id, const quint32 &idNode,
75  const QString &blockName = QString(), const quint32 &idTool = 0, QObject *parent = nullptr);
76  virtual ~VAbstractNode() Q_DECL_EQ_DEFAULT;
77  static const QString AttrIdTool;
78  virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE;
79  virtual void incrementReferens() Q_DECL_OVERRIDE;
80  virtual void decrementReferens() Q_DECL_OVERRIDE;
81 
82  ParentType GetParentType() const;
83  void SetParentType(const ParentType &value);
84 
85  virtual void GroupVisibility(quint32 object, bool visible) Q_DECL_OVERRIDE;
86 
87  bool IsExluded() const;
88  void SetExluded(bool exluded);
89 
90 protected:
92 
93  /** @brief idNodenode id. */
94  quint32 idNode;
95 
96  /** @brief idTool id tool. */
97  quint32 idTool;
98 
99  QString m_blockName;
100 
101  bool m_exluded;
102 
103  void AddToModeling(const QDomElement &domElement);
104  virtual void ToolCreation(const Source &typeCreation) Q_DECL_OVERRIDE;
105  virtual void SetVisualization() Q_DECL_OVERRIDE {}
106 
107  virtual void ShowNode()=0;
108  virtual void HideNode()=0;
109 private:
110  Q_DISABLE_COPY(VAbstractNode)
111 };
112 
113 #endif // VABSTRACTNODE_H
The VAbstractNode class parent class for all detail node.
Definition: vabstractnode.h:71
virtual void HideNode()=0
ParentType parentType
Definition: vabstractnode.h:91
static const QString AttrIdTool
Definition: vabstractnode.h:77
quint32 idTool
idTool id tool.
Definition: vabstractnode.h:97
void SetExluded(bool exluded)
QString m_blockName
Definition: vabstractnode.h:99
ParentType GetParentType() const
virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE
VAbstractNode(VAbstractPattern *doc, VContainer *data, const quint32 &id, const quint32 &idNode, const QString &blockName=QString(), const quint32 &idTool=0, QObject *parent=nullptr)
VAbstractNode constructor.
virtual void incrementReferens() Q_DECL_OVERRIDE
incrementReferens increment referens.
virtual void ShowNode()=0
quint32 idNode
idNodenode id.
Definition: vabstractnode.h:94
virtual void ToolCreation(const Source &typeCreation) Q_DECL_OVERRIDE
virtual void SetVisualization() Q_DECL_OVERRIDE
virtual ~VAbstractNode() Q_DECL_EQ_DEFAULT
void AddToModeling(const QDomElement &domElement)
AddToModeling add tag to modeling tag current pattern peace.
bool IsExluded() const
void SetParentType(const ParentType &value)
virtual void GroupVisibility(quint32 object, bool visible) Q_DECL_OVERRIDE
virtual void decrementReferens() Q_DECL_OVERRIDE
decrementReferens decrement reference for all parent objects.
The VAbstractTool abstract class for all tools.
Definition: vabstracttool.h:80
VAbstractPattern * doc
doc dom document container
The VContainer class container of all variables.
Definition: vcontainer.h:141
VContainer data
data container with data
Definition: vdatatool.h:84
Source
Definition: def.h:106
ParentType
Definition: vabstractnode.h:65